I was trying to upgrade to 18.04, and after reboot, I could not log in, even on a virtual terminal (Alt+Ctrl+F1). I don't know the exact reason, but my assumption is there was less space in home that makes it unresponsive.
I tried various ways to recover: fixing the packages, logging in to a root shell, etc. I tried via Live USB, but that shows ecryptfs-*
command not found, and I was not able to install the encypt-utils
.
As the /home
was on a different partition (sda5
), I thought there will not be any trouble and re-installed a fresh Ubuntu from Live USB on sda1
. This time /home
of the new user is kept on sda1 itself.
After installation, I was checking the sda5
files and noticed some symbolic links which were pointing to /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop
.
hari@hari-Vostro-270s:/media/hari/sda5/hari$ ls -la
total 12
dr-x------ 3 hari hari 4096 Mar 6 2016 .
drwxr-xr-x 6 root root 4096 Apr 24 14:04 ..
lrwxrwxrwx 1 hari hari 56 Mar 6 2016 Access-Your-Private-Data.desktop -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop
drwx------ 3 hari hari 4096 Jul 14 00:57 .cache
lrwxrwxrwx 1 hari hari 30 Mar 6 2016 .ecryptfs -> /home/.ecryptfs/hari/.ecryptfs
lrwxrwxrwx 1 hari hari 29 Mar 6 2016 .Private -> /home/.ecryptfs/hari/.Private
So the question is, is there any way I can recover this files?
Currently, these are what I tried: https://help.ubuntu.com/community/EncryptedPrivateDirectory#Recovering_Your_Data_Manually
/media/hari/sda5 sudo ecryptfs-add-passphrase --fnek
Passphrase:
Inserted auth tok with sig [x1] into the user session keyring
Inserted auth tok with sig [x2] into the user session keyring
/media/hari/fs1 ls
hari lost+found
/media/hari/sda5 sudo mount -t ecryptfs hari/.Private /media/hari/sda6/Private
Passphrase:
Select cipher:
1) aes: blocksize = 16; min keysize = 16; max keysize = 32
2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56
3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24
4) twofish: blocksize = 16; min keysize = 16; max keysize = 32
5) cast6: blocksize = 16; min keysize = 16; max keysize = 32
6) cast5: blocksize = 8; min keysize = 5; max keysize = 16
Selection [aes]:
Select key bytes:
1) 16
2) 32
3) 24
Selection [16]:
Enable plaintext passthrough (y/n) [n]:
Enable filename encryption (y/n) [n]: y
Filename Encryption Key (FNEK) Signature [x3]: x2
Attempting to mount with the following options:
ecryptfs_unlink_sigs
ecryptfs_fnek_sig=x2
ecryptfs_key_bytes=16
ecryptfs_cipher=aes
ecryptfs_sig=x3
Mounted eCryptfs
When looking at the folder, I see:
Error when getting information for file “/media/hari/sda6/home/hari/Downloads/ECRYPTFS_FNEK_ENCRYPTED.FaZDpGgT5TPsrkSs1DMefcCqBFbkbc4LjbP7JXvWgIwh8viAPRHdxH9uEQA3BCl6zOy0opxnxxwj9moqSlFooMTLPDqqLrAlt.e-LrMJZLdyssF7ZGlYJMA5cME2-uUuon-Fy.sd-”: File name too long.
From the CLI, when I did ls -la
it looks something like
ls: cannot access 'ECRYPTFS_FNEK_ENCRYPTED.FWZDpGgT5TPsrkSs1DMefcCqBFbkbc4LjbP7HL3q.4olYwLoHZi74seXAE--': No such file or directory
ls: cannot access 'ECRYPTFS_FNEK_ENCRYPTED.FWZDpGgT5TPsrkSs1DMefcCqBFbkbc4LjbP77AGTg1son88qIRwdejeFu---': No such file or directory
ls: cannot access 'ECRYPTFS_FNEK_ENCRYPTED.FXZDpGgT5TPsrkSs1DMefcCqBFbkbc4LjbP7XXb-PophSPyw.c0ewSMEx0pqOWrvDb2XoytnRZLky---': No such file or directory
ls: cannot access 'ECRYPTFS_FNEK_ENCRYPTED.FWZDpGgT5TPsrkSs1DMefcCqBFbkbc4LjbP7HACG14lCkG2p3vKLYqZDhk--': No such file or directory
Is there any way I can get this solved?