Mounting Partitions *inside* a dd Image

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Jan 27 19:15:08 UTC 2010


On Tue, Jan 26, 2010 at 06:48:44PM -0500, Mike Kallies wrote:
> Hello Everyone,
> 
> I have a disk image which was taken several years ago using "dd".  I
> want to try to recover the data from the image, but I don't want to have
> to copy it back out to a disk.
> 
> If I were smart, I could have done
> 
>   dd if=/dev/sda1 of=sda1.img
>   dd if=/dev/sda2 of=sda2.img
>   dd if=/dev/sda bs=512 count=1 of=sda-bootsector.img
> 
> But instead, I did
> 
>   dd if=/dev/sda of=sda.img
> 
> So now, years later, I've got this blob which I can't quite mount.
> 
> Does anyone know a trick to mount the partitions inside the image?

Load the 'loop' module with the max_part option set to something
reasonable, then use losetup to connect the file to a loop device and
you should get loopXpY for each partition in the image that you can
then mount.

For backwards compatiblity reasons I belive the loop driver by default
doesn't do partitions.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list