Wednesday, November 30, 2016

boot - Recover /home/ after deleting /usr/lib



I accidently deleted my /usr/lib folder. I had the genius idea of rebooting to see if it still boots.
Suprise, it doesn't.
My home directory is encrypted and I don't remember the encryption phrase.



However I can boot into a root terminal and access my files. From there I can even log into my account. So as far as I know you don't need the encryption pw if you are logged into the account that encrypted the files.

But for some Reason I still only see the "Access-Your-Private-Data.desktop" file in the /home/MYUSER/ . And also when I run the command: "ecryptfs-recover-private" I'm asked for a recovery passphrase.



All that, even though I'm logged in to my user that encryped the files. Once my UI was still working I never had to enter the recovery phrase.



Is there any way to get back my data without knowing the encryption key but just my User name?



Ok I found a way to recover it. Unfortunately most commands to restore the encryption key or installing packages didn't work from the machine as there were no packages at all. I also used another machine to try accessing the encryption key at /home/$USER/.ecryptfs but I got an error that the key was corrupted.



At the end I installed the same linux version on a new partition, mounted the old one and copied the whole /usr/lib folder of the new installation to the one I crashed.




After that I was able to boot into my system again and I could decrypt all my files with the user password.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...