After a few months of hacking about in it, this morning I encountered a rather fatal issue with one of my Linux Mint installs which utilises both full disk and home folder encryption. Usually this wouldn’t bother me so much as a fresh install is always nice (particularly since Linux Mint 17.1 is now out), but last night I made some changes to a script and hadn’t yet committed them to my BitBucket repo…
Here’s how I recovered the file.
After downloading the new Linux Mint 17.1 ISO I applied the image to a USB stick using unetbootin – this had to be done anyway. In the the Live USB environment, the following process was used to mount the encrypted volume:
sudo su
No password is required in the Live USB environment.
modprobe dm-crypt
lsblk -o name,uuid,mountpoint
Identify the encrypted partition.
cryptsetup luksOpen crypt1
vgscan –mknodes
Take note of the volume group name.
vgchange -ay
mkdir /volume
mount /dev//root /volume
The encrypted partition is now accessible at /volume:
To recover the encrypted home drive, a single tool can be used:
ecryptfs-recover-private
It will scan for encrypted private directories, then allow you to enter your regular login password and mount them to temporary folders: