[Wylug-help] Disk Images and Partitions

Towle, William william.towle at echostar.com
Thu Jul 5 09:19:35 BST 2007


> I might have dreamed this, but I've got a strong feeling that 
> I've been
> able to loopback mount the partitions in an image file, 
> sometime in the
> past.
> 
> Is this just a fantasy, or have I merely forgotten how I did it?

  You may indeed: 'mount' and/or 'losetup' are your friends. `man
mount` covers the various options and caveats thus:

THE LOOP DEVICE
       One further possible type is a mount via the loop device. For example,
       the command

         mount /tmp/fdimage /mnt -t msdos -o loop=/dev/loop3,blocksize=1024

       will set up the loop device  /dev/loop3  to  correspond  to  the  file
       /tmp/fdimage,  and then mount this device on /mnt.  This type of mount
       knows about three options, namely loop, offset  and  encryption,  that
                                               ^^^^^^
       are  really options to losetup(8).  If no explicit loop device is men-
            ^^^^^^^^^^^^^^^^^^^^^^^^^
       tioned (but just an option â-o loopâ is given), then mount will try to
       find  some  unused loop device and use that.  If you are not so unwise
       as to make /etc/mtab a symbolic link to  /proc/mounts  then  any  loop
       device  allocated by mount will be freed by umount.  You can also free
       a loop device by hand, using âlosetup -dâ, see losetup(8).


  Wills.



More information about the Wylug-help mailing list