How to mount ISO image on Linux

This guide shows how to mount an ISO image on RHEL / CentOS 8 Linux.
I’ll show you two manners. The first is temporary mount, and the other is automatic and persistent.

Temporary mount

This is the way to mount temporarily. If you follow this procedures, a mounted ISO image is unmounted after OS reboot.

(1) Create a mount point directory.

mkdir /media/dvdiso

(2) To mount an ISO image, run the following command.

Note: Assume that an ISO image is on /home/infraya

mount -o loop -t iso9660 /home/infraya/sample.iso /media/dvdiso

To unmount a mounted ISO image, run the following command.

umount /media/dvdiso

The procedures for temporary mount is completed.
If you follow that, a mounted ISO image is unmounted after OS reboot.
The following is for automatic and persistent mount.

Automatic and persistent mount

The following guide shows the procedures for automatic and persistent mount.

(1) Create a mount point directory.

mkdir /media/dvdiso

(2) Edit fstab.

vi /etc/fstab

Add the following to the last line of the fstab.
Note: Assume that an ISO image is on /home/infraya

/home/infraya/sample.iso /media/dvdiso iso9660 loop,ro,auto,nofail 0 0

(2) Refrect the fstab.

mount -a

That’s about it.