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,761 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
- 35,754
- 55
- 92
- 145
Jordon Bedwell
- 658
- 3
- 16
7
Or you can use the ecryptfs-recover-private tool now included in Ubuntu 11.04:
enzotib
- 92,255
- 11
- 164
- 178
Nicolas Schirrer
- 657
- 4
- 4
-
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 run `sudo ecryptfs-manager`, then press 4 (exit), then run `ecryptfs-recover-private` again. – Turion Apr 03 '19 at 11:05