I've ran into following problem. I have split my disk into two partitions, one for / and one form /home. I've also encrypted /home.

One beautiful day ubuntu reports upon boot some broken files, attempts to fix them, but still does not let me in - I enter my password, it is accepted, but I stay on the login screen.

I've downloaded the livecd and ran the disk check - it reports two broken files, but does not say which files nor offers any option to repair them.

Via nautilus I can see the contents of the drive, it contains two files:

The README says to access my data I must run "ecryptfs-mount-private" but when I ran it:
ubuntu@ubuntu:~$ ecryptfs-mount-private
ERROR: Encrypted private directory is not setup properly

So I've looked up how to mount encrypted partitions and come to this Mount encrypted volumes from command line? but then I get this:
ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/sda7 home
Device /dev/sda7 is not a valid LUKS device.

I'm not exactly sure what the problem is and I'm not that familiar with ubuntu/linux administration. Can you please help me locate the problem and fix it. I just want to access my data and ssh keys.

Ubuntu version is 14.04.

Many thanks in advance. Cheers

1 Answer 1


An encrypted home (using eCryptFS) is different from an encrypted partition (using cryptsetup / LUKS). The fact that you can mount your /home partition and "see the contents of the drive" also tells you it's not an entirely encrypted device (so not cryptsetup/LUKS).

To view your encrypted home files now, you should be able to run:

ecryptfs-recover-private - find and mount any encrypted private directories

Just running it without any directory specified should cause it to "search the entire system for encrypted private directories", see it's man page for info. (Actually, in a terminal, typing ecryptfs and then TAB a few times should display the list of possible commands, you might've saw the "recover" and thought it could be useful.)

And you're probably not seeing all the files, the actual encrypted files are probably in /home/.ecryptfs/<user>/.Private/, and the eCryptfs config directory /home/.ecryptfs/<user>/.ecryptfs/. If you wanted to back up everything you can see in your /home partition now, you should be able to decrypt it all later too (if you don't forget to copy the important wrapped-passphrase file).

I don't know what the "broken files" are, or how you ran a "disk check" or what errors it gave, but a standard filesystem check in a terminal would be running the fsck program, or if you know the filesystem you can run fsck.<type>, maybe fsck.ext3 (that one's actually a link to the e2fsck program). See the man page for your /home's specific filesystem (mount should tell you, if it's mounted, or if not then parted -l or fdisk -l or the "Disks" or gparted programs)

If your drive were failing, or if the filesystem was just corrupted somehow (power failure?) they could give similar errors, but that's just guesses. If it were a failing drive, it would probably keep getting worse, and if you wanted to mount the partition as read-only (mount -o ro...) you might be able to read all the data you can now, before it gets any worse. But again, that's just being extra cautious and paranoid about your very vague "broken files" error.

You must log in to answer this question.

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