4

today i was installing ubuntu on an external hard drive and in the initial setup i marked the option "encrypt installation" and the clicked the install button, but i didn't notice that my internal hard drive(which has windows 10 into it) was selected.

When i clicked install a pop up showed up saying that 3 partitions were going to be deleted, so at that moment i noticed i choose the wrong drive, i cancelled the installation, went back, choose the right drive and i continued with the installation (This time i left the encrypt option disabled).

So far, so good with ubuntu, but when i failed to boot from windows i realized that i encrypted the whole drive!

I need the files back, i have no idea what to do next! Please help, i read i needed to do a back up, but i dont even know how to access the drive. Any comments or suggestion will we welcome.

1 Answer 1

9

Have you tried something similar to this from for example a live OS or rescue boot menu from a linux installation media (cd dvd usb etc...)

$ sudo cryptsetup luksOpen /dev/sd<yourEncryptedDiskId> <aNameThatwillBeCreatedIn:Dev/mapper> 

Like for exemple :

$ sudo cryptsetup luksOpen /dev/sda tmpData 

and then

$ sudo mount /dev/mapper/<TheNameUsedEarlier> /mnt #wherever you want

so as in the exemple :

$ sudo mount /dev/mapper/tmpData  /mnt #wherever you want

now you can access your data.

Now that what needed to be done is done you can close the device :

$ sudo umount /mnt  
$ sudo cryptsetup luksClose  tmpData
4
  • Hello, @M4rty after entering the pass phrase i get "Cannot use device /dev/sda3 which is in use (already mapped or mounted)." Any Ideas? Commented Oct 22, 2017 at 14:42
  • when you type $ sudo mount , is sda3 listed? Commented Oct 22, 2017 at 15:27
  • I restarted Ubuntu, and it let me see the device in which is created: sda 8:0 0 931,5G 0 disk ├─sda1 8:1 0 512M 0 part ├─sda2 8:2 0 488M 0 part └─sda3 8:3 0 930,5G 0 part └─sda5_crypt 252:0 0 930,5G 0 crypt Now i don't know what to do, if i try to mount it i get "mount: unknown filesystem type 'LVM2_member'" Commented Oct 22, 2017 at 19:36
  • @PauChittaro Do you have LVM installed? sudo apt install lvm2 Commented Feb 23, 2021 at 5:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.