LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mounting raw disk (https://www.linuxquestions.org/questions/linux-software-2/mounting-raw-disk-4175608211/)

Mark_667 06-19-2017 03:09 PM

Mounting raw disk
 
I accidentally did a quick format of the wrong disk when installing recently so have a disk that contains a lot of files I want but which is missing its partition table. Unfortunately testdisk hasn't been able to find it so I'm looking at carving out files using photorec. There was only one partition on it, an EXT4 but none of he mount commands I'm trying are working.

sudo mount -o loop, offset34, ro, /dev/sdc /media/Dodgy

What am I doing wrong here?

Laserbeak 06-19-2017 03:19 PM

If you accidentally formatted the wrong disk, you're probably SOL unless you have some special recovery software and only then it's only at best 50/50 if you get it back.

AwesomeMachine 06-19-2017 06:30 PM

Foremost just needs the device file. I think it will recover files from an unmounted drive. But it only recovers certain types of files unless you tell it otherwise.

And, even if you reformatted the drive, it should still mount.

syg00 06-19-2017 07:13 PM

Quote:

Originally Posted by Mark_667 (Post 5724498)
What am I doing wrong here?

If you formatted the device (you mention no partition table) why are you attempting to use offset ?. As above, the device itself should mount, but would be empty. mkfs.ext adds backup superblocks throughout the filesystem - these will be written (seemingly ramdomly) throughout your data. Even if you can scrape your files, how will you determine their veracity. Not trying to dissuade you, just answering your query.

If it were me, I'd take an image then create a single partition to cover the entire disk and run "mkfs.ext4 -S ..."
Note that is a capital S. Read the warnings in the manpage - all of them.
I have used this to recover an ext4 f/s I deliberate reformatted as NTFS. This was a small test filesystem I had constructed specifically for this test - only a few files and no fragmentation. The recovery worked fine.
caveat emptor.

jefro 06-19-2017 07:15 PM

Try testdisk on it and see what it might recover.

syg00 06-19-2017 07:23 PM

???? - see first post.


All times are GMT -5. The time now is 10:35 AM.