I opted to encrypt my Home during install, and now I would like to access my data from a LiveCD, unfortunately I'm having trouble following these instructions. I get the error "mounting eCryptfs: [-2] No such file or directory"
Asked
Active
Viewed 3,788 times
13
-
Related: https://askubuntu.com/questions/36573/trying-to-mount-old-encrypted-home – Ciro Santilli OurBigBook.com Jan 24 '19 at 21:08
2 Answers
7
Here is how you recover data from an encrypted home: (sdx should be your SATA drive)
sudo mkdir /recovery
sudo mount /dev/sdx /recovery
sudo mount -o bind /dev /recovery/dev
sudo mount -o bind /dev/shm /recovery/dev/shm
sudo mount -o bind /dev/pts /recovery/dev/pts
sudo mount -o bind /sys /recovery/sys
sudo mount -o bind /proc /recovery/proc
sudo mv /recovery/etc/resolv.conf /recover/etc/resolv.conf.orig
sudo cp /etc/resolv.conf /recovery/etc/resolv.conf
sudo mkdir /data-recovery
sudo mkdir /recovery/data-recovery
sudo mount --rbind /data-recovery /recovery/data-recovery
sudo chroot /recovery
su - user
ecryptfs-mount-private
cd /home/username
sudo mount -o bind /home/username /data-recovery
Remember, don't close the terminal until you are done with the data if you bind it. Once you bind it you should be able to access the folder /data-recovery
(from the LiveCD root) and pull all the data using a GUI. If the last bind does not work, you can remove the last bind and simply cp -avr everything from /home/username
to the chroot /data-recovery
and it show up in the liveCD /data-recovery
.

David Foerster
- 36,264
- 56
- 94
- 147

Jordon Bedwell
- 658
7
Or you can use the ecryptfs-recover-private
tool now included in Ubuntu 11.04:

enzotib
- 93,831

Nicolas Schirrer
- 657
-
Sometimes this gives
Error: Unwrapping passphrase and inserting into the user session keyring failed [-5]
even though the passphrase is correct. As per https://unix.stackexchange.com/questions/285541/mount-no-such-file-or-directory-with-encrypted-recovery/395391#comment878481_395391, it's helpful to runsudo ecryptfs-manager
, then press 4 (exit), then runecryptfs-recover-private
again. – Turion Apr 03 '19 at 11:05