wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

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
  1. 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)
  2. Boot from stick
  3. If not installed, install support libraries
    sudo apt-get install lvm2 cryptsetup system-config-lvm
  4. If not existing, create your mount points (presuming LVM contains 2 volumes here)
    sudo mkdir -p /luksdisk/root
    sudo mkdir /luksdisk/home
  5. Probe the drivers
    sudo modprobe dm-crypt
  6. Open the volume (it might be a different disk/partition on your system)
    sudo cryptsetup luksOpen /dev/sda5 crypt1
  7. Show the physical volumes
    sudo pvscan
  8. Find the volume groups
    sudo vgscan --mknodes
    sudo vgchange -ay
  9. List them (memorize the name - I presume it is mylvmdisk here)
    sudo lvscan
  10. Start the LVM GUI and make all necessary changes
    sudo system-config-lvm
  11. When done, mount the volumes
    sudo mount /dev/mylvmdisk/root /luksdisk/root
    sudo mount /dev/mylvmdisk/home /luksdisk/home
Reference: Ubuntu Geek, LinuxWave
As usual YMMV

Posted by on 11 June 2012 | Comments (0) | categories: Linux

Comments

  1. No comments yet, be the first to comment