0

I'm using an Ubuntu 17 ISO on a USB drive to recover my Ubuntu 17 install on a laptop that doesn't boot into the GUI any longer. I was wondering about grabbing the files from the local disk, but it seems I can't access them.

How can I access these files?

lrwxrwxrwx 1 1000 1000   56 Nov 29 19:34 Access-Your-Private-Data.desktop -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop
lrwxrwxrwx 1 1000 1000   52 Nov 29 19:34 README.txt -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.txt
root@ubuntu:/media/ubuntu/7c8304ee-16af-4d22-8f48-b291de9e1c43/home/olduser# 

root@ubuntu:/media/ubuntu/7c8304ee-16af-4d22-8f48-b291de9e1c43/home/olduser# ls -la /usr/share/encryptfs-utils/encryptfs-mount-private.desktop
ls: cannot access '/usr/share/encryptfs-utils/encryptfs-mount-private.desktop': No such file or directory
root@ubuntu:/media/ubuntu/7c8304ee-16af-4d22-8f48-b291de9e1c43/home/olduser# ls -la ../../usr/share/encryptfs-utils/encryptfs-mount-private.desktop
ls: cannot access '../../usr/share/encryptfs-utils/encryptfs-mount-private.desktop': No such file or directory

I can cat README.txt and I see this:

THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA.

From the graphical desktop, click on: "Access Your Private Data"

or

From the command line, run: ecryptfs-mount-private

Unfortunately clicking on the file from the GUI does nothing, which I think is because encryptfs-mount-private does not exist in either the USB-drive or the old drive that is mounted.

I tried installing encryptfs-mount-private or encryptfs-utils, but no dice:

E: Unable to locate package encryptfs-utils
E: Unable to locate package encryptfs-mount-private

Also, locate, which, and whereis do not find any files named encryptfs or ecryptfs-mount-private.desktop.

Where are these files located and how is it possible I can output their contents with cat it if the directory they are in does not exist?

0

Symlinks are like text files containing the absolute or relative path they point to as plain text. So, as the partition which used to be mounted at / is currently mounted at /media/ubuntu/YOUR_UUID_HERE, absolute symlinks break, obviously.

I'd recommend to chroot into your disk partition, so that the links work again. Chrooting changes the root directory to any directory you like, so you can get a terminal that behaves like it runs from your system on the disk after having booted from the DVD.

From the live DVD, do run these commands to prepare and enter the chroot environment:

  1. Mount your hard disk Ubuntu partition as /mnt. You might have to unmount it from the Files manager first, as it can't be mounted twice. Replace /dev/sdXY with your partition's real identifier, e.g. /dev/sda1. Use the lsblk command to identify which one it is.

    sudo mount /dev/sdXY /mnt
    
  2. Bind your live system's virtual system folders to their respective locations in the target folder:

    for d in /dev /dev/pts /sys /proc ; do sudo mount --bind $d /mnt$d ; done
    
  3. You say you want to recover some data, so I guess you have some external storage where you want to copy the stuff to. I'll assume that storage is located at /media/ubuntu/my-backup-disk, replace with your respective path. It must be accessible from the chroot environment, so we bind it inside the target directory as well:

    sudo mkdir /mnt/storage
    sudo mount --bind /media/ubuntu/my-backup-disk /mnt/storage
    
  4. Enter the environment.

    sudo chroot /mnt
    
    • Now you are in a root shell, and the / root directory will be what was /mnt in the outer live session. It should behave like a root shell that booted from your hard disk installation.

    • Unlock your encrypted home like you would have done from your installation, I guess using:

      ecryptfs-mount-private
      
    • Copy your important files from your home directory or wherever to your backup disk, which we have bound to /storage (it was /mnt/storage outside the chroot). This could look e.g. like below, replace with your own appropriate paths:

      cp -R /home/bee/Documents /storage/Documents
      
    • Once you are done, you can leave the chrooted environment again by exiting the root shell:

      exit
      
  5. You are back in the normal shell of the live system.

  6. Unmount your disk installation's partition again:

    sudo umount -R /mnt
    
  7. I guess you're done here. You can close the terminal and shut down the live system, or do whatever else you want.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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