Tuesday, March 8, 2011

Mounting an encrypted logical volume

I found this useful when trying to do some recovery work on my computer which uses dm-crypt for full disk encryption.  The following was done using the Ubuntu Maverick (10.10) livecd.

Mount the encrypted partition
root@ubuntu:/home/ubuntu# sudo cryptsetup luksOpen /dev/sda4 data
Enter passphrase for /dev/sda4:
root@ubuntu:/home/ubuntu# ls /dev/mapper
control  data

Mount the logical volume
root@ubuntu:/home/ubuntu# aptitude install lvm2
root@ubuntu:/home/ubuntu# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg0" using metadata type lvm2
root@ubuntu:/home/ubuntu# vgchange -ay vg0
  2 logical volume(s) in volume group "vg0" now active
root@ubuntu:/home/ubuntu# mkdir /mnt/tmp
root@ubuntu:/home/ubuntu# sudo mount /dev/vg0/root /mnt/tmp

No comments:

Post a Comment