Linux/dev/Loop

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.