2

My hard disk is damaged. I got a new one and now I'm trying to recover my old home directory (Ubuntu 14.04) from the old HD. I could mount it no problem, but my home was encrypted with ecryptfs and I have trouble mounting it (possibly due to the fact that the drive is damaged).

I'm on a live USB now and I'm trying to use this guide. The "short way" doesn't work, with this error:

user@lubuntu:~$ ecryptfs-mount-private 
Enter your login passphrase:
Inserted auth tok with sig [xxxxxxxxxxx] into the user session keyring
open: Permission denied
Error locking counter

The "long" version doesn't work either:

lubuntu@lubuntu:~$ sudo mount -t ecryptfs /tmp/ecryptfs.CP9YxtzK/.ecryptfs/user/.Private /home/user
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]: aes
Select key bytes: 
 1) 16
 2) 32
 3) 24
Selection [16]: 16
Enable plaintext passthrough (y/n) [n]: n
Enable filename encryption (y/n) [n]: y
Filename Encryption Key (FNEK) Signature [yyyyyyyyyy]: xxxxxxxxxx
Attempting to mount with the following options:
  ecryptfs_unlink_sigs
  ecryptfs_fnek_sig=xxxxxxxxxx
  ecryptfs_key_bytes=16
  ecryptfs_cipher=aes
  ecryptfs_sig=yyyyyyyyyy
WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt],
it looks like you have never mounted with this key 
before. This could mean that you have typed your 
passphrase wrong.

Would you like to proceed with the mount (yes/no)? : yes
Would you like to append sig [yyyyyyyyy] to
[/root/.ecryptfs/sig-cache.txt] 
in order to avoid this warning in the future (yes/no)? : yes
Successfully appended new sig to user sig cache file
mount: wrong fs type, bad option, bad superblock on /tmp/ecryptfs.CP9YxtzK/.ecryptfs/user/.Private,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Error mounting eCryptfs: [-1] Operation not permitted
Check your system logs; visit <http://ecryptfs.org/support.html>

dmesg outputs the following entries:

[  730.561447] Valid eCryptfs headers not found in file header region or xattr region, inode 786440
[  730.561789] Valid eCryptfs headers not found in file header region or xattr region, inode 786439
[  734.636311] Valid eCryptfs headers not found in file header region or xattr region, inode 786439
[  734.748038] Valid eCryptfs headers not found in file header region or xattr region, inode 786889
[  778.327144] Valid eCryptfs headers not found in file header region or xattr region, inode 786439
[  778.435321] Valid eCryptfs headers not found in file header region or xattr region, inode 786889
[  797.091759] Valid eCryptfs headers not found in file header region or xattr region, inode 786439
[  797.192579] Valid eCryptfs headers not found in file header region or xattr region, inode 786889
[ 1462.402354] Mount on filesystem of type eCryptfs explicitly disallowed due to known incompatibilities

And syslog contains this:

Dec 29 08:16:36 lubuntu mount.ecryptfs: Failed to perform eCryptfs mount: [-32]
Dec 29 08:16:36 lubuntu kernel: [ 1462.402354] Mount on filesystem of type eCryptfs explicitly disallowed due to known incompatibilities
Dec 29 08:16:36 lubuntu kernel: [ 1462.402448] Reading sb failed; rc = [-22]

Am I doing something wrong? Or is my ecryptfs home gone due to the disk damages?

Thanks!

P.S.: I do have a backup of the main files, but recovering the whole directory would be much better...

closed as off-topic by TheWanderer, WinEunuuchs2Unix, Jakuje, Fabby, Eric Carvalho Dec 30 '16 at 12:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – TheWanderer, WinEunuuchs2Unix, Jakuje, Fabby, Eric Carvalho
If this question can be reworded to fit the rules in the help center, please edit the question.

1

After a live USB reboot, I managed to retrieve the data using the "short way". It gave me an "Ecryptfs error locking counter", but I solved it with adding a tmpfs entry in /etc/fstab (inside the chrooted environment) as described here. Apparently no hard disk troubles so far. I leave this here in case someone has similar issues.

  • Thanks for posting an actual answer! I recommend editing it to expand it with specific details about how to do (or how you did) this. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on AskUbuntu.) – David Foerster Dec 30 '16 at 8:56

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