The loop
device is primarily controlled with the losteup
command. So losetup -a
gives you overview about the used loop devices and attached files. The mount
command can mount the block device only. The loop device can create the virtual block device from a file (character device).
In fact there is a great difference between those commands because on older Linux systems the mount
could not recognise the file as the correct device to be mounted, but during the time the mount command was completed with lot of feature, hence it can now self decide to try to call the losetup command and mount the result. But if you got a whole disk image not iso format but e.g. with MBR at the beginning, the mount command could not recognise it and you have to find the usable partition (e.g. with the parted disk_image.raw unit B print
command) yoursef and than mount it with full option mount comman as :
mount disk_image.raw /mntpoint/ -o loop,offset=${OFFSET_of_PARTITION}
In this syntax the loop device was not specified and it is assumed the system choose the first free (/dev/loop0
, /dev/loop1
etc)
Among the other new features of mount command is that you need not specify the filesystem type of the mounted block device (in your case -t iso9660
) if the filesystem support was installed.
mount ubuntu.iso /mnt
it do not setup a read-only loopback device,andmount /image.squashfs /mnt
it do not setup aDIO
(losetup --direct-io=on
)loopback device.