How to Mount an ISO Image File in Linux Using the Terminal

An ISO file is a perfect, byte-for-byte digital replica of an optical disc (like a CD, DVD, or Blu-ray). Decades ago, the only way to access the software inside an ISO file was to physically burn it to a blank CD. Today, modern operating systems allow you to “mount” these files digitally, tricking your computer into believing a physical disc has been inserted into a drive.

While many desktop environments provide a right-click “Mount” option, server administrators often operate without a graphical interface. By learning how to mount an ISO image file in Linux using the terminal, you can extract software packages and examine disc images entirely from the command line.

Step 1: Create a Mount Point Directory

Before you can mount the ISO, you need to provide a destination where its files will be displayed. In Linux, everything is a file, including hardware devices. When you mount a drive, you attach it to an empty directory in your filesystem. This directory is called the “mount point.”

The standard location for temporary mounts is the /mnt directory. You must use `sudo` because creating directories in this root location requires administrative privileges.

Open your terminal and run the following command to create a new folder named `iso`:

sudo mkdir /mnt/iso

Step 2: Mount the ISO Using a Loop Device

Now that you have a destination folder, you can mount the actual ISO file. To do this, Linux uses a special feature called a “loop device,” which allows a standard computer file to be treated like a physical block device (like a hard drive or CD-ROM).

The syntax for the mount command requires the loop option, the path to your downloaded ISO file, and the path to your new mount point.

Assuming your ISO is located in your Downloads folder, run the following command (replacing the filename with your actual file):

sudo mount -o loop ~/Downloads/ubuntu-server.iso /mnt/iso

If the command is successful, the terminal usually returns a warning message stating: “mount: /mnt/iso: WARNING: device write-protected, mounted read-only.”

Do not panic; this is entirely normal. Because ISO files are replicas of CDs (Compact Disc Read-Only Memory), they cannot be modified. You can read the files inside, but you cannot delete them or write new data to the image.

Step 3: Access and Copy the Files

Your ISO is now successfully mounted. To view the files inside, simply navigate to the mount point you created earlier:

cd /mnt/iso
ls -l

You will see the complete folder structure of the installation disc. From here, you can use standard Linux commands like cp (copy) to extract specific setup files or documentation to your home directory.

Step 4: Safely Unmount the ISO

When you are finished extracting the files you need, you must safely unmount the ISO. If you skip this step, you will not be able to delete the original ISO file from your Downloads folder, as the system will claim it is “currently in use.”

First, ensure you navigate your terminal out of the mount directory (you cannot unmount a drive if you are currently standing inside it):

cd ~

Next, use the umount (unmount) command followed by the mount point directory:

sudo umount /mnt/iso

The ISO is now detached. If you wish to clean up your filesystem, you can remove the empty mount point directory with the following command: sudo rmdir /mnt/iso.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.