I just installed Ubuntu 18.04 on a new disk, and trying from 18.04 to access my old Ubuntu files, on the older disk.
Going into /media/new_user/old_disk/old_user
, there is a README file that says: THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA. And then says: From the command line, run: ecryptfs-mount-private
.
Trying:
$ sudo ecryptfs-recover-private
does not do much (basically a few files it can't access, and nothing happens). Reading this old post (linking to this blog), I do instead:
cd /media/new_user/old_disk/.ecryptfs/old_user
sudo ecryptfs-recover-private .Private/
Which gives:
INFO: Found [.Private/].
Try to recover this directory? [Y/n]: Y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] n
INFO: To recover this directory, you MUST have your original MOUNT passphrase.
INFO: When you first setup your encrypted private directory, you were told to record
INFO: your MOUNT passphrase.
INFO: It should be 32 characters long, consisting of [0-9] and [a-f].
Enter your MOUNT passphrase:
mount: /tmp/ecryptfs.lFwWFlD4: mount(2) system call failed: No such file or directory.
ERROR: Failed to mount private data at [/tmp/ecryptfs.lFwWFlD4].
I am not sure what I am doing wrong at that point?
Thanks!!
EDIT 1:
I believe the issue does not come from wrong passphrase: I think I got the right one indeed, entering an obviously wrung one give another error message, Error: Unwrapping passphrase and inserting into the user session keyring failed [-5].
EDIT 2:
I should mention that both my old home and new home have the same user name... Could that be something that creates the problem? Where should actually ecryptfs-recover-private
mount the old disk/system?
If you have problems with the key (see
dmesg
orsyslog
), e.g.then, try adding the passphrase manually: Option "1" in menu of
/usr/bin/ecryptfs-manager
It helped me.
I encountered the same problem after installing 18.04 when I tried to access my old encrypted data using
ecryptfs-recover-private
. I was able to solve the issue by doing the following:Unwrap your old mount passphrase
(You can skip this step if you know this mount passphrase)
You need to find out your mount passphrase so you can add it to the keyring. Assuming your current working directory is your former home partition, you do this by typing
This asks for your old login passphrase and outputs your old mount passphrase.
Add your mount passphrase to the kernel keyring
This is done by
The
--fnek
option may not be necessary, but it worked for me.Mount your encrypted data in /tmp
Finally type
This either asks for your mount passphrase directly or tries to unwrap it with your login passphrase. Although the previous steps appear redundant now, they made this step work, at least for me. Hope you'll have success, as well.
It looks like
ecryptfs-mount-private
is part of Encrypted Home and not full disk encryption, and the man page seems to confirm this. Just noting.It seems that people have better luck by pointing to the encrypted filesystem instead of the directory, or without any parameters. For example:
There is a blog post that describes the process in detail:
I'm having a hard time finding an example where the people use the incorrect passphrase when asked to recover with 'MOUNT passphrase', so it could be choking on that.
Others have reported issues when the new user and old user are different, and instead suggest pointing to the old user's home directory:
To recover, create a user with the old username, login as that user, and attempt to mount the drive.
The idea is you let the system mount it where it is familiar, and prevent this issue. The downfall is that you'll need the space available, but could be easier. After you restore the drive, copy the files to your new user.
Alternatively, change your user's username back to what it was, recover the files, and change your username back. In this case, you'll likely lose your new data, and is a relatively more dangerous operation.