Tuesday, December 20, 2011

How to mount ISO filesystem in GNU / Linux

If you want to be sure of your ISO images and you have an operating system GNU / Linux, this article may be right for you. A few simple text commands to verify the ISO file you created with utility like mkisofs. And if you do not like them you can always re-create, starting from the original directory, saving CD or DVD.

How to mount ISO filesystem in GNU / Linux

Introductory note: In order to assemble or disassemble the unit may need to prefix loopback sudo to mount or umount .

By using the mount command is also possible to mount ISO9660 file system just created with applications such as mkisofs. This is done using virtual loopback devices (also called "loop devices").

The loop devices are special nodes that can be used to mount files as if they were real blocks, such as a / dev/sda1 for the first partition on the hard drive. They reside in / dev and are used automatically when mount option is specified loop.

Take for example an ISO file any: feather-0.7.5.iso (Feather Linux).

We can verify that this is an ISO file using the program files .

files

The output should be similar to this figure:

ISO 9660 CD-ROM filesystem data

Followed by the possible identification string and a statement (bootable) if the unit can be used as a boot drive.

How to mount

An ISO image is mounted with the following command line:

mount-t iso9660-o ro, loop

Here is a brief description of the terms used in the assembly:

-t iso9660 is the type of the filesystem -o ro, loop is the list of mount options. ro indicates that the filesystem should be mounted read-only (ISO9660 is read-only by default); loops indicates that the file system resides in a file and not in a real block. Mount is then told to use a loopback device residing in / dev (usually there are 8, loop0 to loop7, with symbolic links in / dev / loop /) is the name of the file to mount loopback is the path to mount the file

If you want you can specify the loop device by slightly changing the line:

mount-t iso9660-o ro, loop = / dev/loop7

With loop = / dev/loop7 specifying that we want to use the device / dev/loop7 to mount the file. Normally the kernel use the first available loop device in ascending numerical order, with this small change can force the kernel to use a particular loop device.

In the event that you specify a loop device already in use mount will come up with error code 32, the mount will not be made to display a message loop stolen , and the mount above will not be changed.

See Pictures and Read more : How to mount ISO filesystem in GNU / Linux

No comments: