# [SOLVED] How do I mount a raw image clone?



## Nofew (May 2, 2009)

My laptop's hard drive has failed. Luckily, before it did, I created a bit-for-bit copy of it using the following command:

dd if=/dev/hda conv=sync,noerror of=/mnt/sda1/rescue.raw

Unfortunately, I can't mount the image since I can't define the filesystem type. The disc has four partitions, and I need to get to the 2nd and 3rd. The first is a recovery partition that shipped with the computer, and the 4th is swap space. The 2nd (ntfs) and 3rd (ext3) contain important data that I'd rather not lose. All of them are primary.

I've already tried reading the manual, Googleing and searching the forums. I'm not sure if this is even possible at this point without copying it back to a physical disc, but I need to make sure that the copy went through properly before I swap out the hard drive. Could anyone tell me how I'd be able to mount the image?


----------



## Done_Fishin (Oct 10, 2006)

*Re: How do I mount a raw image clone?*

I'd say that the best thing you could do is boot from a live CD, restore your backup to a NEW hard Drive ( I can't help you with that since I have never used that method you show) that is at least the same size as the drive that has failed.
Once you have written your raw file to your disk you can try to boot it or at least swap it out for the faulty disk. Booting again from Live CD should allow you top check things out before trying to boot.


----------



## Nofew (May 2, 2009)

*Re: How do I mount a raw image clone?*

Thanks for your effort, but I can't get a physical disc to test it on. I needed to do it directly from the .raw file somehow so I couldn't use your solution, but I've found the answer I needed! I had to set the offset, so I used..

sfdisk -l -uS /mnt/sda1/rescuw.raw

..to print the start/end sectors of every partition in the image. I took the start number of the partition I needed to access and multiplied it by 512 (I typed 24578048 x 512 in Google since xcalc can't handle calculations that big) to get it in bytes, then just mounted it with the offset, well, set.

mount -o loop,offset=BYTES -r /mnt/sda1/rescue.raw /mnt/rescue

Now I can relax..


----------



## Done_Fishin (Oct 10, 2006)

Glad you found a solution. I usually use GHOST in IMAGE ALL MODE


----------

