Overview
If you have ever downloaded a new Linux distribution ISO image, you may have wondered how to access the contents inside the image prior to repartitioning your disk and installing the operating system onto your local disk. This can be done via a loop mount in Linux.
In Linux and other UNIX-like systems, it is possible to use a regular file as a block device. A loop device is a virtual or pseudo-device which enables a regular file to be accessed as a block device. Say you want to create a Linux file system but do not have a free disk partition available. In such a case, you can create a regular file on the disk and create a loop device using this file. The device node listing for the new pseudo-device can be seen under/dev. This loop device can then be used to create a new file system. The file system can be mounted, and its contents can be accessed using normal file system APIs.