Ubuntu – Recover encrypted data after reinstall


I couldn't remember the password that I've used for so many weeks, and changed it in recovery mode but for many reasons I decided to reinstall Ubuntu 12.10 with my seperate /home folder intact and passphrase at hand so I can decrypt my old /home when reinstalled.

Now I that all is going well and ubuntu 12.10 is reinstalled I want to access my old data which during the installation process I have mounted at /backups.

I'm following this guide; http://hackerpublicradio.org/eps.php?id=1101.
All seems fine until step 7 where it will be mounted at /tmp/ecryptfs.45LC2WiF. When I go to this folder I can see several files and one folder, and in it a subfolder (my username).

Main /tmp/ecryptfs.45LC2WiF$ folder

  • Lost+Found (folder)
  • empec (folder, my username)
  • .ecryptfs (folder)
  • .directory (link (broken))

empec folder

  • .cache (folder)
  • Access-Your-Private-Data.desktop (Link to desktop configuration file)
  • README.txt (Link to plain text document)
  • .ecryptfs (link (broken))
  • .private (link (broken))

The readme.txt notes


From the graphical desktop, click on: "Access Your Private Data"


From the command line, run: ecryptfs-mount-private

When trying to open Access-Your-Private-Data.desktop, terminal opens and closes instantly. So nothing happens.
And when executing ecryptfs-mount-private I get the following;

$ cd /tmp/ecryptfs.45LC2WiF/
$ ecryptfs-mount-private
ERROR: Encrypted private directory is not setup properly

How do I access the encrypted files and move, delete or alter them?
Thanks in advance!

  • I do not have the old password (Or atleast I think so).
  • I have the old passphrase used to encrypt the /backups formerly /home

[updated] Changed Step 5.3 into Step 7. Problem remains the same.

Best Answer

There is a few things you can try. The error message you get is itself helpful: the directory is not mounted.

If you get this type of files CRYPTFS_FNEK_ENCRYPTED.[some code here] in fact the decryption was not succesful. That means something went wrong in the decryption process (usually the problem is related to the settings you provide in the prompt). Make sure to type the full passphrase in gedit and copy it from there. I once already spend two days figuring out what went wrong decrypting and for some reason I had a tiny mistake (O as 0) in the passphrase.

You can also give this command a try:

mount -t ecryptfs [SRC DIR] [DST DIR] -o [OPTIONS]

This will do the mounting and decrypting for you. Read more here and don't stick too close to that tutorial you mention.

BTW: Is your username the same as on the old system?

Related Question