How to recover data from an encrypted hard drive on a dead laptop?
I am assuming that you used the "Encrypt the new Ubuntu installation" or its manual equivalent; that is, your hard disk is encrypted by LUKS and in the encrypted container you have an LVM volume group.
Before starting, make sure that you have cryptsetup
and lvm2
installed; if not, install them:
sudo apt-get install cryptsetup-bin lvm2
Take the drive out and put it into a USB enclosure.
Connect it to a working computer running Ubuntu or any other Debian derivative; you can even use a live DVD or USB flash drive for this. Say that the disk is seen by the system as
/dev/sdb
.-
Find out which partition on the disk is the LUKS container:
for p in /dev/sdb*; do sudo cryptsetup isLuks $p && echo $p is a LUKS container done
-
For example, suppose that you found out that
/dev/sdb2
is a LUKS container. Open it:sudo crypsetup luksOpen /dev/sdb2 old-hard-disk
-
LVM should automatically detect the logical volumes; see if it did so with
sudo lvs -o full_name,size,seg_pe_ranges
If not, you may have to trigger LVM recognition with
sudo vgchange -aay
. Now you have the logical volumes in
/dev/mapper
. Mount them onto some directories.
Connect the drive to your new computer (after removing it from your defect notebook, obviously). There are cheap USB connectors for sata or msata drives. When the drive is recognized you can mount it (if you have the password).