Mounting an iso image from the command line.

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,477
Reaction score
3,209
Credits
31,144

Mounting a Local ISO Image Using mount -o loop in Linux​

Mounting an ISO image in Linux can be done easily using the command line. While many GUI file browsers also offer the ability to mount ISO images with a simple click, this guide focuses on the command line method.

What is an ISO Image?​

An ISO image is a file that contains the complete contents of a CD, DVD, or other disc. It is often used for distributing large software packages or operating systems.

Mounting the ISO Image​

To mount an ISO image using the mount -o loop command, follow these steps:

  1. Open a Terminal: You can open a terminal window from your applications menu or by pressing Ctrl+Alt+T.
  2. Create a Mount Point: A mount point is a directory where the ISO image will be mounted. You can create a mount point using the mkdir command. For example:
    Code:
     sudo mkdir /mnt/iso
  3. Mount the ISO Image: Use the mount command with the -o loop option to mount the ISO image. Replace /path/to/your.iso with the actual path to your ISO file.
    Code:
     sudo mount -o loop /path/to/your.iso /mnt/iso

Understanding Read-Only File Systems​

When you mount an ISO image, it is typically mounted as a read-only file system. This means you can view and copy files from the ISO, but you cannot modify, delete, or add new files to it. This is because ISO images are designed to be exact replicas of the original disc, which is also read-only.

Unmounting the ISO Image​

To unmount the ISO image, you need to ensure that you are not in the mounted directory. If you are, change to a different directory first. Then, use the umount command to unmount the ISO image. For example:
Code:
 cd ~
Code:
sudo umount /mnt/iso

If you try to unmount the ISO while you are still in the mounted directory, you will receive an error message.
 
Top