Loopback devices

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Loopback devices in the Linux hardware system allow for the "emulation" of a block device (a CD/DVD-ROM drive, a hard drive, etc).

Loopback devices are most commonly used for two things:

An example of mounting an .iso image via loopback:

# mount /tmp/linux.iso /mnt/cdimage -o loop

In Windows, you are forced to run a program to read the .iso file. In Linux, the code has already been written in the kernel to read the ISO-9660 format of CDs, so why write an extra program? Instead, developers created the loopback device that does the work for you.

Note: You will need Loopback support compiled into your kernel or built as a module (called loop). If the module is not loaded, mount will attempt to load it for you.

Personal tools