Linux : Using loop devices (eg : mounting an ISO file)

If you downloaded an ISO file and you want to mount it into your filesystem, you can proceed as follows :
spaghetti% sudo losetup /dev/loop0 cdrom.iso
spaghetti% sudo mount /dev/loop0 /mnt
spaghetti% ls /mnt
Autorun.inf setup.exe setup.ico
spaghetti%
[...]
spaghetti% sudo umount /mnt
spaghetti% sudo losetup -d /dev/loop0

This will use the feature known as “loop devices”, which lets you use a file as a device, and subsequently mount it as it would be one.

You can of course mount an ISO using loop devices, but there is more to it. You could for example mount a ciphered file containing an EXT2 filesystem.

Check out the man page for more details.