April 21, 2011

Adding new disk to LVM + crypt



I have currently disk setup like this:


sda2 was encrypted prior to lvm.
I need to increase lvm-root size with new disk, but I'm unsure how to do that properly. Suppose my new disk is sdb, I guess it's just something like

fdisk sdb, add new partition of type 8e
mkfs.ext3 sdb1
pvcreate sdb1
vgextend lvmgroup sdb1
lvextend -L 100%FREE lvm-root

Is this correct? And what about encryption, do I just encrypt sdb1 before doing the above, like I did with sda?
I'm just looking forward to do this without any dataloss from lvm-root.

Click Here!