domenica 5 giugno 2011

Ubuntu Debian How To Mount a Disk Image

This is how to mount a disk image and access it like a real hard disk drive


To mount a disk image it is suggested to use the loop device.

In my example, the goal is to mount an XFS partition' image.

Because the image is not of an entire disk (that could contain several partitions), but it is just the image of a single partition, I must set the offset to 0.
IF the image would have been of an entire disk with more than one partition, the correct offset must be given.

The image is stored on my Desktop folder and its name is diskimage.dsk

I've created a mount point in the media directory, and I've called this subdirectory imagemount

You must be root or use the sudo command to give the mount command

sudo mount -o loop,offset=0 -t XFS /media/imagemount /home/Desktop/diskimage.dsk

Instead than XFS, you may use auto