Change partition layout on LUKS encrypted LVM volumes
This serves as a reference on what to do if you have (a) LUKS encrypted disk(s) that contains a LVM layout and you need to alter the partition layout
As usual YMMV
- Back up your data! While everything typically works out, you want to be save, so back up your data (and make sure the backup is readable)
- Boot from stick
- If not installed, install support libraries
sudo apt-get install lvm2 cryptsetup system-config-lvm
- If not existing, create your mount points (presuming LVM contains 2 volumes here)
sudo mkdir -p /luksdisk/root
sudo mkdir /luksdisk/home - Probe the drivers
sudo modprobe dm-crypt
- Open the volume (it might be a different disk/partition on your system)
sudo cryptsetup luksOpen /dev/sda5 crypt1
- Show the physical volumes
sudo pvscan
- Find the volume groups
sudo vgscan --mknodes
sudo vgchange -ay - List them (memorize the name - I presume it is mylvmdisk here)
sudo lvscan
- Start the LVM GUI and make all necessary changes
sudo system-config-lvm
- When done, mount the volumes
sudo mount /dev/mylvmdisk/root /luksdisk/root
sudo mount /dev/mylvmdisk/home /luksdisk/home
As usual YMMV
Posted by Stephan H Wissel on 11 June 2012 | Comments (0) | categories: Linux