Mounting and un mounting an ISO Image

Mount and un-mount an ISO image. An ISO image is an archive file of an optical disc, a type of disk image composed of the data contents of every written sector of an optical disc, including the optical disc file system. ISO image files usually have a file extension of .iso

Most Linux distros are in an iso form when you download them.

NOTE: This will work on any linux distro.


In order to mount an ISO you must have root privileges type su and switch to root user.

[jhealy@Jadelinux ~]$ su
Password:
[root@Jadelinux jhealy]#

Now we need to create a mount point to mount our ISO on.

[root@Jadelinux jhealy]# mkdir /mnt/iso

Once you have created a mount point, use the “mount” command with options to mount the iso file. I have an ISO file in my downloads folder witch is located in my home directory so I am going to mount it from that folder.

[root@Jadelinux jhealy]# mount -t iso9660 -o loop /home/jhealy/downloads/Fedora-20-i386-DVD.iso /mnt/iso/

Mount Options Explained

  • -t: This argument is used to indicate the given filesystem type.
  • ISO 9660: It describes standard and default filesystem structure to be used on CD/DVD ROMs.
  • -o: Options are necessary with a -o argument followed by a separated comma string of options.
  • loop: The loop device is a pseudo-device that often used for mounting CD/DVD ISO image and makes those files accessible as a block device.

NOTE: These Options are needed in order to mount the ISO correctly.

After the ISO image mounted successfully, go the mounted directory at /mnt/iso using the cd command.

[root@Jadelinux jhealy]# cd /mnt/iso

As you can see the prompt has changed to the iso directory.

[root@Jadelinux iso]#

Now run the ls -l command to list the content of the directory

[root@Jadelinux iso]# ls -l

And you should get an output something like this.

[root@Jadelinux iso]# ls -l
total 16
drwxrwsr-x 3 root 101737 2048 Nov 14 01:00 images
drwxrwsr-x 2 root 101737 2048 Nov 14 01:00 isolinux
drwxrwsr-x 2 root 101737 2048 Nov 14 01:00 LiveOS
drwxrwsr-x 28 root 101737 4096 Nov 14 00:38 Packages
drwxrwsr-x 2 root 101737 4096 Nov 14 00:43 repodata
-r--r--r-- 1 root root 1538 Nov 14 01:00 TRANS.TBL

Now to Un-mount the ISO

Simply run the following command

[root@Jadelinux iso]# umount /mnt/iso

That's it you have successfully mounted and un-mounted your ISO file. Thank you for reading.