Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

#How to create lvm

pvcreate /dev/xvdb
vgcreate vg_name /dev/xvdb
lvcreate -l 100%FREE -n lg vg
echo , | sfdisk /dev/mapper/vg_name-lg_name
mkfs.ext4 -F /dev/mapper/vg_name-lg_name

#How to extend existing lvm disk space.
Lets assume we have added new disk to EC2 instance

pvcreate /dev/xvdc

Add the physical volume to the volume group via ‘vgextend’.

vgextend vg_name /dev/xvdc
e.g: vgextend disk2 /dev/xvdc

Allocate the physical volume to a logical volume (extend the volume size by your new disk size).

$ lvextend -l +100%FREE /dev/mapper/disk2-esdata

Resize the file system on the logical volume so it uses the additional space.

$ resize2fs /dev/mapper/disk2-esdata