Mounting an Encrypted Drive
Hi there,
I am trying to mount an encrypted drive read-only so that I can try and use Photorec to recover a file that was truncated by a Gedit plug-in. However, I'm obviously doing it wrong. I have a laptop running Ubuntu 13.10. It has two drives: /dev/sda (the boot drive) is a 120 GB SSD, and /dev/sdb (secondary drive, where I store most of my data) is a 500 GB HDD. The secondary drive is encrypted. I'm new to running my own Linux machine, so right now this machine is pretty much running various defaults. During the set-up process I was asked if I wanted to encrypt the secondary drive and I selected yes, and created a pass phrase. I believe this was encrypted using LUKS. Each time I log in I must enter the pass phrase to access the secondary hard drive. This is the way I want it, so everything is good from that perspective. Looking at the properties for the drive shown in the file browser (which I believe is Nautilus) told me that the drive is "ext3/ext4". I found it odd that both are shown, but that's what it shows. So I tried mounting it like this: Code:
sudo mount -t ext4 -o ro,noload /dev/sdb /romount Code:
sudo mount -t ext4 -o ro,noload /dev/sdb1 /romount Code:
sudo mount -r /dev/sdb1 /romount Code:
[133424.725224] EXT3-fs (sdb): error: can't find ext3 filesystem on dev sdb. Code:
leftseat@selous:~/recovered20140605/photorec$ sudo fdisk -l Code:
leftseat@selous:~/recovered20140605/photorec$ sudo parted -l Can anyone tell me what I'm doing wrong in trying to mount the hard drive read-only? Should I be using a different file system type? Thanks very much in advance for your assistance. Craig |
I can't say for read only but I followed something like this recently to open an encrypted volume on the command line and it worked fine:
http://evilshit.wordpress.com/2012/1...ions-manually/ It will give you an idea of what you are looking at if nothing else. |
Hi 273,
Thanks very much. That looks like a good start except: leftseat@selous:~$ sudo blkid|grep crypto /dev/sdb1: UUID="2019e76b-29ac-44c3-8d3f-6b8ff1226359" TYPE="crypto_LUKS" leftseat@selous:~$ sudo cryptsetup -r luksOpen /dev/sdb1/ crypthome Device /dev/sdb1/ doesn't exist or access denied. Hmm. ---------- Post added 06-06-14 at 05:56 PM ---------- Doesn't even prompt for the pass phrase. :( |
What exactly did you do to get into this situation?
It sounds like you may have damaged the encrypted partition not just files which were stored on it. |
Quote:
|
Quote:
Good catch. |
Quote:
Now I will run Phototrec to see what (if anything) I can recover from the file that was truncated/overwritten. To answer your question, 273, no, the whole partition is not damaged. Clearly I was not paying attention when I ran the command at the link you provided. And it was indeed the information at the link you provided that helped me get to where I needed to be. Thanks very much for your help. And thanks, rknichols, for your help too. |
To make it clear for those who might find this thread in the future:
Code:
leftseat@selous:~$ sudo cryptsetup -r luksOpen /dev/sdb1 crypthome |
Thanks for the correction craigh and sorry for not proof-reading the link before pasting it.
You should mark the thread solved by clicking the link at the top also if things are now working for you. :) |
Quote:
Apology not necessary. It's my responsibility to check commands before I run them ... which I always do, but clearly I missed the offending slash. Left Photorec to run all night, but I think it filled the hard drive (not the one on which the file was lost) withut about 8000 file fragments. Now I just have to free up more space, because none of them seem to be the fragment I'm looking for. Will mark the thread solved. Thanks again. Craig |
All times are GMT -5. The time now is 06:03 PM. |