Mounting iso file in Linux

ISO file is ditto image of CD or DVD. It is more specifically ISO9660 Format File. If you have any file then it can be mounted using mount command in linux. Below is example.

Suppose you have data.iso is a iso file and you want that file to be mounted in /mycd folder. You can do this by following simple steps.

Check the file format first using file command.

# file data.iso
data.iso: ISO 9660 CD-ROM filesystem data 'CDROM'

Create a folder /mycd using mkdir command.

# mkdir /mycd

Mount the file using mount command.

# mount -o loop data.iso /mycd

After this check using df command as below.

# df -h
Filesystem Size Used Avail Use% Mounted on
/root/data.iso 28M 28M 0 100% /mycd

You can unmount the iso file as below.

# umount /mycd

If you are using Linux 7 or higher then writing “-o loop” is optional. The “-o loop” option simply tells the system that the device is not physical device it is simply loopback device.