How can i access my encrypted hard drive on another pc?

10,350

Solution 1

You don't have cryptsetup installed on your second computer, install it via: sudo apt-get install cryptsetup

Once you've installed it, double click on the encrypted volume again and it should mount for you.

[Edit]
The error from your mount command mount: unknown filesystem type 'LVM2_member' tells us that it's an LVM group, and needs to be mounted slightly differently.

Hopefully the following will provide the information you need to get it mounted, based upon my system.

$ sudo pvs
PV         VG     Fmt  Attr PSize  PFree
/dev/sda2  ubuntu lvm2 a--  99.51g    0 

This tells us that the volume, ubuntu is on the physical volume /dev/sda2. We then need to use the lvdisplay command to list the logical volumes in the group.

$ sudo lvdisplay /dev/ubuntu
--- Logical volume ---
  LV Path                /dev/ubuntu/swap
  LV Name                swap
  VG Name                ubuntu

<snip>

  --- Logical volume ---
  LV Path                /dev/ubuntu/home
  LV Name                home
  VG Name                ubuntu

<snip>

  --- Logical volume ---
  LV Path                /dev/ubuntu/root
  LV Name                root
  VG Name                ubuntu

<snip>

From the above we can see that I've got a home, root and swap. To mount the home partition from this group I would run the following command:

$ mount /dev/ubuntu/home /mnt/disk

If you're unsure how to modify this to suit your needs, edit your question again with the output of the pvs and lvdisplay commands. You might want to take a look at Formatting Help as well.

Solution 2

If you've gotten this far

i finally managed to get into my encrypted hard disk drive and inside my home folder there are two icons. One text saying README and a weird purple thingy saying ACCEESS-YOUR-PRIVATE-DATA-DESKTOP.

It means you still have your home folder encrypted, with eCryptFS. Now you need to run the ecryptfs-recover-private script and it should search for any encrypted homes (or you can point it at your encrypted home files) and ask you for your old user passphrase, or the backup copy of the master passphrase you should have made when you set up your home encryption, and then it should mount your encrypted home (probably in /tmp/ecryptfs.XXXXXXXX) so you can read / back them up. May be mounted as another user, so probably will need to read as root.

If it errors out while searching, that's ok since you are already looking at your "dummy" home files "README" & "ACCEESS-YOUR-PRIVATE-DATA.desktop", which are usually in /[mountpoint]/home/[username] so just look in the /[mountpoint]/home/ folder for your encrypted files, which should be in /[mountpoint]/home/.ecryptfs/[username]/.Private and pass that to the ecryptfs-recover-private script.

See man ecryptfs-recover-private for more info.

ProTip: ALWAYS make BACKUPS of important data, and encryption keys/headers, so you'll never have this problem again

Share:
10,350

Related videos on Youtube

George Jesus Dimitropoulos
Author by

George Jesus Dimitropoulos

I am a Physics Tutor and an Early Childhood Studies student. I have ubuntu for almost 3 years now!

Updated on September 18, 2022

Comments

  • George Jesus Dimitropoulos
    George Jesus Dimitropoulos almost 2 years

    My ubuntu pc collapsed and i turned my internal hard drive to an external usb hard drive. After a lot of trying i ended up with a live usb on my laptop and after i enabled universe repositories and installed synaptics and gksu nautilus i finally managed to get into my encrypted hard disk drive and inside my home folder there are two icons. One text saying README and a weird purple thingy saying ACCEESS-YOUR-PRIVATE-DATA-DESKTOP. I open the readme text and it is says that i need to open the access-your-private-data-desktop. When i do that something like a terminal opens for a nanosecond and then suddenly disappears! So i try the second method that the README text says, which is running the ecryptfs-mount-private on terminal. After i do that i get a message saying ERROR: Encrypted private directory is not setup properly. Any ideas? ( i have already tried lots of things and i feel that i am so close on getting my files from the disk drive... Please! I need the files so bad. I also tried this sudo ecryptfs-recover-private INFO: Searching for encrypted private directories (this might take a while)... find: File system loop detected; /sys/kernel/debug/pinctrl' is part of the same file system loop as/sys/kernel/debug'.

    • AJefferiss
      AJefferiss over 8 years
      Whats the output of cryptsetup luksOpen /dev/sdc test? Have you tried manually mounting /dev/mapper/luks-98199aea-ee9a-4909-a2a1-1ede01fb9f91? For example: sudo mkdir /media/my_device && sudo mount /dev/mapper/luks-98199aea-ee9a-4909-a2a1-1ede01fb9f91 /media/my_device
    • George Jesus Dimitropoulos
      George Jesus Dimitropoulos over 8 years
      When i try manually mounting it says mount: unknown filesystem type 'LVM2_member' As for the cryptsetup luksopen it says Device /dev/sdc doesn't exist or access denied.
    • AJefferiss
      AJefferiss over 8 years
      Because it's a LVM volume you need to mount it slightly differently, see my updated answer.
    • George Jesus Dimitropoulos
      George Jesus Dimitropoulos over 8 years
      When i right-click and choose properties it says that all the files take up 4.8 GB of the hard drive, but on the chart it says 216 GB used! How is that possible. Where are my files?
  • George Jesus Dimitropoulos
    George Jesus Dimitropoulos over 8 years
    I did what you suggested and after i submitted my passphrase this message appeared "The unlocked device does not have a recognizable file system on it"
  • AJefferiss
    AJefferiss over 8 years
    What file system did it have on it before your PC had issues? Can you edit your question with some more information about the filesystem, and log output
  • George Jesus Dimitropoulos
    George Jesus Dimitropoulos over 8 years
    I tried the first one, but there is no .private and the second one says that the disk drive is already unlocked. That is not my problem. The problem is that after i unlock it it disappears and i can't access my files. I had ubuntu 15.10 on my pc and the laptop has 14.04 LTS. Does it matter?
  • George Jesus Dimitropoulos
    George Jesus Dimitropoulos over 8 years
    I can now access it. I can see all the folders (bin, usr, dev, root, etc.) but i can't find my files. The only folder that i didn't search was root, because i can't enter it. It says You do not have the permissions necessary to view the contents of “root”. Maybe my files are in there? How can i access it?
  • AJefferiss
    AJefferiss over 8 years
    Can you add the output of ls -l /mnt/disk to your question so we can see what's been mounted.
  • AJefferiss
    AJefferiss over 8 years
    Replace /mnt/disk with the location you manually mounted the LVM volume too...
  • Xen2050
    Xen2050 over 8 years
    The Mount passphrase is the "real" key that encrypts the data. It's usually "wrapped" (encrypted) with your login passphrase and stored in the wrapped-passphrase file, so if you've got that file you just need your old login passphrase. Maybe it couldn't find the wrapped-passphrase file... are there any files in /[mountpoint]/home/.ecryptfs ?
  • George Jesus Dimitropoulos
    George Jesus Dimitropoulos over 8 years
    This directory does not exist. Inside /home there is only a folder with my username on it.
  • Xen2050
    Xen2050 over 8 years
    But you've got the eCryptfs readme & shortcut in your home folder right? Were you using eCryptfs? Are you seeing all files, normally dot-files are hidden - if your file manager is hiding them, you won't see them. In a terminal running ls -la in the folder should show all files; or if it's a permissions problem try sudo ls -la
  • Ivan
    Ivan over 6 years
    You saved me a lot of distress tonight. Thanks so much!
  • Pysis
    Pysis almost 3 years
    This was also a nice reference for me using Fedora that has LVM storage set-up by default, so not encrypted, just nested by another layer of software that I have to boot that same OS to access, but works well enough at that point. Have not found any easier methods or particular programs without just virtualizing or installing that same OS like access from Windows or Mac.