Recover files from encrypted Home folder

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Recover files from encrypted Home folder

Postby smssms on Sat May 18, 2013 11:00 am

I want to get some files off of my natively encrypted Home folder but I can no longer get Mint to boot - how can I get the files?

BACKGROUND:
Had dual boot with Windows & Mint and all was well.
One day the HDD would not boot at all.
Tried a few things, and Boot-repair run from a Live USB of Ubuntu was the only one that did anything...
Now the HDD will boot into Windows, but there is no sign of Grub or then Mint at startup any more.

I DO have the passphrase for the encrypted partition.

I'm not actually that bothered about saving the Mint install, but I do want the files out of my Home folder.

Appreciate any tips on how to get my files back - Thanks
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Linux Mint is funded by ads and donations.
 

Re: Recover files from encrypted Home folder

Postby xenopeek on Sat May 18, 2013 11:10 am

These are my notes for recovering access to an encrypted home. Boot from the Linux Mint installation DVD / USB to do this.
Code: Select all
# Mount the disk partition containing the Encrypted Home Directory
# !!! replace /dev/sda1 with your partition !!!
sudo mount /dev/sda1 /mnt

# Establish a proper chroot environment
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /dev/shm /mnt/dev/shm
sudo mount -o bind /proc /mnt/proc
sudo mount -o bind /sys /mnt/sys
sudo chroot /mnt

# Become the user whose data needs recovery and manually add the necessary mount passphrase to the kernel session keyring
# !!! replace username with your username !!!
su - username
ecryptfs-add-passphrase --fnek

# Mount the encrypted directory and then access the data
ecryptfs-mount-private
cd $HOME

I've used this once successfully, as have at least two other users here. Is this in a format that is usable for you, or do you need more help?
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14891
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Recover files from encrypted Home folder

Postby smssms on Sat May 18, 2013 11:15 am

Thanks for the quick reply Xenopeek.

I'll have a stab with that and see how it goes. Only problem at the minute is that I do not have a Mint Live USB/CD, so have to sort that first...
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Re: Recover files from encrypted Home folder

Postby smssms on Sat May 18, 2013 11:41 am

I can mount the Windows partitions (in terminal and Disk Utility), but not the Linux partitons.

In Disk Utility they just do not have an option to mount and when I try
Code: Select all
sudo mount /dev/sdb5 /mnt
it comes back with
Code: Select all
mount: you must specify the filesystem type
. I tried things like
Code: Select all
mount -t ext4 /dev/sdb5 /mnt
but still get error messages about wrong filesystem or bad superblock etc...
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Re: Recover files from encrypted Home folder

Postby xenopeek on Sat May 18, 2013 12:24 pm

Oh boy. Perhaps something more is wrong? What does this command share:
Code: Select all
sudo parted -l
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14891
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Recover files from encrypted Home folder

Postby smssms on Sat May 18, 2013 12:31 pm

OOh, I got one of the linux partitions to mount after 'repairing' the superblock with Testdisk
Code: Select all
sudo fsck.ext4 -v /dev/sdb5


So now I will try your earlier approach to get at my data....
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Re: Recover files from encrypted Home folder

Postby smssms on Sat May 18, 2013 1:10 pm

Thanks for all your help.

With a bit more work on e2fsck to sort out the superblock I got most of the way through your instructions.

Then I had the opposite of a eureka moment when I realised I had the passphrase for the wrong HDD!!!!!!!

So I'm going to have to hunt down the right passphrase (if I stored it!) or work out how to get in with the system password.
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Re: Recover files from encrypted Home folder

Postby cryptotheslow on Sat Aug 03, 2013 10:32 am

I know this is an old thread, but I thought I would add a useful tidbit of information for those who may look at it in the future.

For a while now ecryptfs provides a utility "ecryptfs-recover-private" that automates the recovery process without having to go through the palaver of chroot etc.

There's a simple walkthrough here:
http://bodhizazen.net/Tutorials/Ecryptfs/#Live
cryptotheslow
Level 1
Level 1
 
Posts: 22
Joined: Thu Mar 14, 2013 6:30 pm

Re: Recover files from encrypted Home folder

Postby smssms on Sun Aug 04, 2013 1:00 pm

cryptotheslow wrote:I know this is an old thread, but I thought I would add a useful tidbit of information for those who may look at it in the future.

For a while now ecryptfs provides a utility "ecryptfs-recover-private" that automates the recovery process without having to go through the palaver of chroot etc.

There's a simple walkthrough here:
http://bodhizazen.net/Tutorials/Ecryptfs/#Live


Thanks, still not got my data back so I will have a look at that :)
smssms
Level 1
Level 1
 
Posts: 18
Joined: Fri Oct 05, 2012 12:00 pm

Linux Mint is funded by ads and donations.
 

Return to Other topics

Who is online

Users browsing this forum: No registered users and 6 guests