A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

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!