I would like to extend the storage capacity on my Ubuntu server by adding more drives.
I'm currently using LVM+LUKS on my server and I'm having some difficulty understanding how I may add new drives to the existing LVM volume without having to re-install the whole system. From what I understand that's the reason of using LVM - extending the storage capacity on the fly -pretty much.
But how do I do this if the volume also in encrypted? Is it even possible since, from what I understand, the LUKS actually pretty static from the initial capacity?
I have two drives set up as a software RAID 0 that I'd like to use in the current running system volume, using only one additions disk.
Cheers, Daniel
You can use
cryptsetup
to initialize a partition on the new disk as another LUKS volume ( you will now have to supply both passphrases at boot time to unlock ), and then usepvcreate
to initialize the new LUKS device as an LVM physical volume. Thenvgextend
to add that volume to the volume group, and finally you can uselvconvert
to convert your existing logical volumes to raid0, which will stripe them between the two drives. You probably will also want to uselvextend
to increase the size of the logical volume, andresize2fs
to expand the filesystem on it to use the additional space.