I needed to reinstall ubuntu on my hard drive because I think I corrupted some files and it wasn't booting up (I know, it was very stupid). I tried to reinstall from a LiveCD by checking the "keep the files" option. Unfortunately, I did this kind of carelessly, where when it asked me for the username and password for the reinstallation, I chose something different than what was already there, which I realize was very stupid. Now I have a new user directory /home/newusername along with /home/oldusername where /home/oldusername contains README.txt, Access-Your-Private-Data.desktop and .Private. I think .Private has all the original data encrypted and I am trying to recover it. oldusername does not actually exist as a user, by the way.

I've been reading a whole bunch of answers about how to recover my encrypted files with people that seem to have very similar problems as me, but none of the solutions provided to them seem to work for me and I don't really understand why.

I tried this: https://help.ubuntu.com/community/EncryptedPrivateDirectory#Recovering_Your_Data_Manually And it seems like my data is still encrypted after I am done. I think one thing that I am doing differently is that I am not using a LiveCD here. I'm just running the commands on the disk.

I feel so stupid for getting to this stage, because I did so many dumb things to get to this point and it feels very hopeless. Please help if you possibly can.

  • 1
    Did you check the command ecryptfs-recover-private? – rom1v Jan 27 '17 at 11:03
  • @rom1v Yes, to no avail. – user3217013 Jan 27 '17 at 19:00
  • You can find here a more complete answer. – Hilder Vitor Lima Pereira Jun 27 '19 at 8:23

Using a Live CD was the only thing I hadn't tried and turned out that worked. I'm not sure why it was necessary though. It was only a directory that was encrypted, so it feels like it should have been able to decrypt it. Anyway, if you are stuck like I was, then that should probably do it.


I had problems with file recovery - I would like to share how I managed to recover files:

  1. Command showing encrypted file directory:

    sudo find /media -type d -name .Private
  2. Command to unlock private directory plus directory shown from command above:

    sudo ecryptfs-recover-private

(example: sudo ecryptfs-recover-private /media/ubuntu/1efe72f6-86-41e9-9d46 c7b2bb9a1b61/username/.Private)

I used not an encrypted pass phrase, but password of Ubuntu login and it worked (strangely encryption pass phrase didn't work for me – try both).

  1. After successful attempt directory will be created in /tmp/created folder name by systen

  2. to access those files I had to be root:

    sudo se
  3. and to open directory from terminal:

    nautilus /tmp/created folder name by system
  4. to copy desired folders, files had to select them, mouse right click "Copy To..."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.