[sclug] Mount whole-disk image?

Alex Butcher lug at assursys.co.uk
Sun Jan 27 08:00:00 UTC 2008


On Sat, 26 Jan 2008, John Stumbles wrote:

> I know if I make an image of a filesystem with
> 	dd if=/dev/sda1
> (say) I can then mount it loopback and access it as a filesystem. Can I do 
> something similar with an image of an entire disk, e.g. made with
> 	dd if=/dev/sda

Yup, but it's a bit of a pain. IIRC, you need to manually set up the loop
device, using losetup and its -o (offset) parameter. If you run 'sfdisk -d
/path/to/dd_file', the start parameter should give you the appropriate
offset.

Once you've set up the loop device, you should be able to just mount it in
the normal (i.e. non loopfs) way (mount -t ext2 -o ro /dev/loop0
/mnt/mountpoint).

HTH,
Alex.
-- 
Alex Butcher, Bristol UK.                           PGP/GnuPG ID:0x5010dbff

"[T]he whole point about the reason why I think it is important we go for
identity cards and an identity database today is that identity fraud and
abuse is a major, major problem. Now the civil liberties aspect of it, look
it is a view, I don't personally think it matters very much."
  - Tony Blair, 6 June 2006 <http://www.number-10.gov.uk/output/Page9566.asp>



More information about the Sclug mailing list