Post

Mount an ISO

Mount an ISO

Mounting ISO Files in Linux

ISO files are disk image files that contain the contents of an optical disc. You can mount these files in Linux to access their contents without burning them to physical media.

Basic ISO Mounting

The standard command to mount an ISO file:

1
sudo mount -t iso9660 -o loop file.iso /home/user/mountpoint

Command Breakdown

  • sudo: Execute the command with root privileges
  • mount: The Linux command to attach a filesystem
  • -t iso9660: Specify the filesystem type (ISO 9660 is the standard for optical discs)
  • -o loop: Use a loop device, which allows mounting a file as a block device
  • file.iso: The path to your ISO file
  • /home/user/mountpoint: The directory where you want to mount the ISO

Prerequisites

Ensure your mount point directory exists before mounting:

1
2
# Create the mount point if it doesn't exist
mkdir -p /home/user/mountpoint

Unmounting an ISO

When you’re done with the ISO, unmount it:

1
sudo umount /home/user/mountpoint

Additional Options

1
2
3
4
5
6
7
8
# Mount as read-write (if the filesystem supports it)
sudo mount -t iso9660 -o loop,rw file.iso /home/user/mountpoint

# Mount with specific character encoding
sudo mount -t iso9660 -o loop,iocharset=utf8 file.iso /home/user/mountpoint

# Mount with specific user permissions
sudo mount -t iso9660 -o loop,uid=1000,gid=1000 file.iso /home/user/mountpoint
This post is licensed under CC BY 4.0 by the author.