程式扎記: [Linux 常見問題] How to: Mount an ISO image under Linux

標籤

2015年12月15日 星期二

[Linux 常見問題] How to: Mount an ISO image under Linux

Source From Here 
Introduction 
An ISO image is an archive file (disk image) of an optical disc using a conventional ISO (International Organization for Standardization) format. ISO image files typically have a file extension of .ISO. The name "ISO" is taken from theISO 9660 file system used with CD-ROM media, but an ISO image can also contain UDF file system because UDF is backward-compatible to ISO 9660. 

You can mount an ISO images via the loop device under Linux. It is possible to specify transfer functions (for encryption/decryption or other purposes) using loop device. But, how do you mount an ISO image under Linux? You need to use mount command. Below is the description of loop device: 
A "loop" device in Linux is an abstraction that lets you treat a file like a block device. It's specifically meant for a use like your example, where you can mount a file containing a CD image and interact with the filesystem in it as if it were burned to a CD and placed in your drive. You can find more information on Wikipedia.

Procedure to mount ISO images under Linux 
1) You must login as a root user, if not root user then switch to root user using following command: 
$ su -

2) Create the directory i.e. mount point: 
# mkdir -p /mnt/disk

3) Use mount command as follows to mount iso file called disk1.iso
# mount -o loop disk1.iso /mnt/disk

4) Change directory to list files stored inside an ISO image: 
# cd /mnt/disk
# ls -l

More about loop device 
A loop device is a pseudo-device that makes a file accessible as a block device. Loop devices are often used for CD ISO images and floppy disc images. Mounting a file containing a filesystem via such a loop mount makes the files within that filesystem accessible. They appear in the mount point directory using above commands. 

Supplement 
Allow normal user to mount linux partitions, usb stick/pen device 
Allow non-root user to write CDs

沒有留言:

張貼留言

網誌存檔