MRW
http://piratenpartei.ch

Piratenpartei Zürich
PC 85-112704-0

Der Politnetz Auftritt von Marc Wäckerlin Im Politnetz unterstützen

How to mount LVM or LUKS Partition in Ubuntu Live CD

Here I have the following situation: My fresh installed Ubuntu with encruption as suggested by the (text) installer does not boot, because I played back a backup from the previous system with other partition and encryption configuration. But playing back the backup failed, the computer was terminated before I was able to restore /etc/fstab, /etc/cryptotab and /boot/grub/menu.lst. So, let's see how to restore it.

Partitions:

  • /dev/sda1: Encrypted LVM partition containing the root filesystem / and swap.
  • /dev/sda5: Extended partition (below /dev/sda2) containing /boot.
  • /dev/sdb1: Encrypted USB backup device, the source to restore from.

Restore the system:

  • Start a Live CD (here Ubuntu 9.04 Jaunty Jackalope).
  • Open a terminal and install lvm2 and cryptseup: type sudo apt-get install lvm2 cryptsetup
  • You can then mount encrypted filesystems and LVM.
    • I mount the backup device from the GUI: Menu Places - Computer, then after clicking on the drive, I am sked the password. Works fine.
    • Mounting the /boot partition is no problem at all, of course, it's a normal partition.
    • Problem: cryptsetup luksOpen /dev/sda1 root should now work, but in fact it does not!
      Restauration without success, retry from scratch… Any Idea why /dev/sda1 cannot be decrypted? (Even loading a lot of modules not help: for module in cbc sha256_generic aes_generic dm_crypt xfs; do sudo modprobe $module; done

Finally I reinstalled the system and restored the backup once again…