[TriLUG] raw disk images

Jeremy P jeremyp at pobox.com
Thu Dec 20 13:50:49 EST 2001


On Thu, 20 Dec 2001, Mike McLean wrote:

> Are there any tools that would allow you to view/manipulate disk images
> without actually mounting them.  Say, for example, that you wanted to
> write a script to add one file to a disk image. 

Do you mean, tools to manipulate images without mounting them as
loopback?  The easiest way to edit an image is to use the loopback driver,
which uses the kernel's filesystem code to mount the image on the
filesystem:
	mount -o loop,rw /path/to/image.img /mnt/whatever
(add other mount options/fs type as appropriate)

Then you can just add a file with "cp" and unmount.

I don't think there's currently a big impetus to write tools that operate
without the kernel, because the tool would require a full implementation
of filesystem-manipulation code.  Since the kernel already supports
umpteen filesystems with well-maintained code, it makes much more sense to
harness this throught the loopback driver, instead of re-inventing the
wheel.  But I agree it would be nice if mtools would support images too.

--Jeremy




More information about the TriLUG mailing list