How to extend encrypted LVM volume

Check with the commands above the Volume Group name and the Logical Volume name:

sudo pvdisplay
sudo lvdisplay

In VMWare you could create a new virtual hard disk device to add to the volume group (in this example /dev/sdc):

sudo pvcreate /dev/sdc
sudo vgextend vg_data_group /dev/sdc

or extend an existing virtual hard disk device, create a new partition with fdisk, and add the new partition to the volume group:

sudo fdisk /dev/sdc

fdisk command:
n = create new partition
p = creates primary partition
1 = makes partition the first on the disk
t = change partition type
8e = changes to LVM partition type
p = view partition setup so we can review before writing changes to disk
w = write changes to disk

sudo vgextend vg_data_group /dev/sdc1

After you’ve extended the Volume Group, you are free to extend the underlying Logical Volume (for example 1Tb):

sudo lvextend -L+1000G /dev/vg_data_group/lv_data

Resize the Crypt:

sudo cryptsetup resize cryptpublic1

Resize filesystem:

sudo resize2fs /dev/mapper/cryptpublic1

One thought on “How to extend encrypted LVM volume

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s