ISO image files provide a convenient way to distribute installers, live systems, and archives without relying on physical media like CDs or DVDs. Access to the contents of an .iso file permits browsing documentation, extracting individual packages, or verifying checksums before reuse.
On Linux, ISO images normally contain an ISO 9660 filesystem and are attached through the mount command. When bound to a directory as a loopback device, the image behaves like a read-only optical drive, and its directories and files appear under the chosen mountpoint.
Mounting an ISO image is a privileged operation and typically requires sudo access because it alters the system's view of attached filesystems. Mounting to a dedicated temporary directory and unmounting cleanly after use prevents stale mounts, avoids accidental writes in the wrong location, and keeps filesystem navigation predictable.
Steps to mount an ISO image file in Linux:
- Open a terminal in a working directory where the mountpoint directory will be created.
$ pwd /
- Create a temporary directory to use as the mountpoint for the ISO file.
$ mkdir -p /root/sg-work/iso-demo/mnt
- Switch the current directory to the location that contains the .iso image file.
$ cd /root/sg-work/iso-demo
- Check if the .iso file is recognized as a valid image by the system.
$ file demo.iso demo.iso: ISO 9660 CD-ROM filesystem data 'DEMOISO'
The file command inspects the image header and reports the detected partitioning and filesystem format.
- Mount the .iso image file on the temporary directory using the loopback device and the iso9660 filesystem type.
$ sudo mount -t iso9660 -o loop demo.iso /root/sg-work/iso-demo/mnt mount: /root/sg-work/iso-demo/mnt: WARNING: source write-protected, mounted read-only.
The mounted filesystem is read-only; files can be viewed or copied but not modified in place.
- List the top-level contents of the mounted .iso to confirm that the filesystem attached correctly.
$ ls -l /root/sg-work/iso-demo/mnt total 1 -r-xr-xr-x 1 root root 17 Jan 14 00:17 readme.txt -r-xr-xr-x 1 root root 27 Jan 14 00:17 release
- View or copy specific files from the mounted image to another directory as needed.
$ head /root/sg-work/iso-demo/mnt/release Release: Demo Version: 1.0
Files read from the mountpoint behave like regular files; use standard tools such as cp, less, or tar to inspect or extract content.
- Change back to the home directory or another safe location so the mountpoint directory is not the current working directory.
$ cd
Unmounting a filesystem that is in active use can fail with a target is busy error.
- Unmount the .iso image from the temporary directory once access is no longer required.
$ sudo umount /root/sg-work/iso-demo/mnt
- Remove the now-unused temporary mountpoint directory to keep the home directory tidy.
$ rmdir /root/sg-work/iso-demo/mnt
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
