In Linux,/dev/loop is often used to create the file system image file rootfs. IMG, so that it can be downloaded to the kernel for mounting;
Http://zh.wikipedia.org/wiki//dev/loop
We have daily access to a large number of image files *. ISO, which use data files to store data on actual block devices;
First of all, you must make it clear that you need a specific file system to store files on devices such as CDs, hard disks, and floppy disks.
There is a large amount of specific information in the file system used to manage the above files, the information and file data together constitute a File System
So the image file is the sum of these contents.
After the image file is created, it can be stored on the storage device as a file, so how to access it as a file system
What about all the files contained? This requires the image file to be treated as a block device. At this time,/dev/Loop
The debut is coming soon. Depending on/dev/loop, you can treat the image file on the OS as a block device. The following is an example:
First, use losetup to connect the image file with/dev/loop.
losetup /dev/loop0 example.img
Then, mount the loop device to a directory, so that the contents of the image file are displayed in the directory.
mount /dev/loop0 /home/you/dir
Or directly use mount to implement:
mount -o loop example.img /home/you/dir