6

I have a backup of /home from my old system on an external drive. The ~ on my new system has full home encryption from ecryptfs. I want to decrypt the Private on the old home and copy its now-decrypted contents to the new home.

I actually have the ~/.Private and ~/.ecryptfs from the old system on my new system as well. I tried mounting it from there before, but it's not possible. I've confirmed with Dustin Kirkland (ecryptfs developer) that you can't have an encrypted home AND an encrypted private in use at the same time.

I tried mounting the backup drive over /home and running and ecryptfs-mount-private and entering my login password (same on old system and new), but ~/Private wasn't decrypted.

2 Answers 2

3

The best way to recover is by using the ecryptfs-recover-private utility from a LiveISO.

I say that because this will ensure that your recovery happens in a safe, repeatable, read-only environment.

That said, you certainly can run ecryptfs-recover-private on a running system. But I'd strongly recommend that you log out all instances of the user you're trying to recover, and then login as root or some other user.

4
  • Creating a new sudo-able user, mounting the old drive as /home using the new user, logging in as usual user, then using ecrypt-mount-private, then copying the data to /tmp, logging out, unmounting the old drive, and copying from /tmp to the real home... worked.
    – maco
    Mar 17, 2012 at 15:57
  • Apparently no paragraph breaks allowed... What does ecryptfs-recover-private do differently from ecrypt-mount-private? I thought it was a matter of whether you remembered your password or not.
    – maco
    Mar 17, 2012 at 15:58
  • 1
    @maco that should be another question ;) Mar 17, 2012 at 19:49
  • @maco, as noted, that's a different question, which I'm happy to answer :-) Mar 17, 2012 at 20:33
0

I haven't tested it, but I don't see why doing something like:

Log out. Come back in as another user and become root. As root switch out the Private and ecryptfs folders(backing the new ones up).

Switch back to the one that now has your old directory and get it mounted.

(only mention switching back and forth since in a lot of cases you may have the same username/password...you could do this as user number 2)

Copy everything to intermediate storage that is not encrypted with ecryptfs, but could be with dm-crypt or whatever other solution, probably in /opt/dump or something similar.

Back to user 2. Now you switch the two folders back.

Copy your temporary location data back to your home.

Use srm or whatever to remove your intermediate storage location.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .