0

I recently did a fresh install of Ubuntu (MATE) 16.04 on a new hard drive and used LVM. I created a partition table with separate mount points for /, /home,/boot swap.

While installing, I did not choose to encrypt whole installation. But going forward, when prompted to name the user, I did select the option to encrypt my home directory. On the first boot, I was provided with a long key, for if I ever needed to decrypt the home directory outside of the installation. So I noted it down.

Now, I attached an external HDD with Ubuntu (Unity) 16.04 already installed (my old hard drive), and ran some commands to detect physical volume, volume group, and logical volume. Then ran a command to activate the logical volumes, lvchange -ay <path/>, which started displaying the logical volumes as separate drives in nautilus. Note that I haven't yet been asked for any kind of password to decrypt the drive. I then try to access my logical volume of home directory using nautilus and find a folder <username>. In that folder, there are two links to files, as shown in the photograph below. enter image description here When I click on either, nautilus tells me that they are links which are "broken" and cannot be opened. I am left with nothing accessible, with a passphrase that I can't enter anywhere.

How should I go about doing this? Although not an urgent matter, I must know how to open my encrypted home folder from elsewhere to be able to access it if required.

Thanks.

1 Answer 1

1

Nautilus is not lying to you, and your files should still be accessible. The problem is where your partitions are mounted.

First of all, your encrypted files are not actually in your home directory. They are in a hidden directory, /path/to/home/.ecryptfs/YOUR-USERNAME. Where /path/to/home is where you have mounted your home partition.

Here's one way to get at your files.

  • (LVM only) Mount your home partition: sudo mount /dev/VOL-GROUP/HOME-VOLUME /mnt, substituting the correct path to your home partition.
  • (non-LVM only) Mount your home partition: sudo mount /dev/sdXN /mnt, substituting the correct device to your home partition.
  • Open a terminal and change directory: cd /mnt/.ecryptfs/YOUR-USERNAME
  • Decrypt your home dir: sudo ecryptfs-recover-private .Private
  • Follow the prompts to unlock your directory.
  • If you have a valid password or your master key (the hex string for recovery), your encrypted home directory will be mounted on a (randomly named) folder in the /tmp dir. If you're running a live OS, You won't be able to access this directory without doing so as root.
  • If you want more than read-only access: sudo mount -i -o remount,rw /tmp/ecryptfs.XXXXXXXX/ replacing XXXXXXXX with the random string for your mount point.

You must log in to answer this question.

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