[clug] Reading partition tables via loopback

Darren Freeman daz111 at rsphysse.anu.edu.au
Thu Feb 26 22:43:09 GMT 2004


Dear all,

A problem that's been bugging me for ages, and I need to solve fairly
soon, goes as follows:

I have a hard disc image, obtained using dd. It gets burned to CD/DVD
before I reformat a drive and use for my own purposes. The original
owner knows their drive can be returned with its original contents.

I now wish to mount the image via loopback. Ordinarily, if I had an
image of just one partition, this would be easy. However I have an image
of a whole drive, with like 6 partitions.

How do I convince linux to treat a loopback device like a hard disc, and
probe for partitions? As in I have my image mounted as /dev/loop6 and
was hoping to see stuff like /dev/loop61 /dev/loop62 etc. with my
partitions. Unfortunately it didn't happen automagically, is there a way
to force/trick this to happen?

Any other ideas? Hopefully I don't need to parse the DOS partition table
and determine the offset into the partitions. This would work though
since losetup accepts an offset.

Have fun,
Darren



More information about the linux mailing list