Read more articles
Compose a new article

What is a .iso file (disk image) and how to use it?

Composed by: that-ben
On: 2019-02-20 08:48:21
Updated by: ssokolow
On: 2023-01-11 04:52:04

What is a .iso file?

A .iso file is a disk image, meaning it's an exact copy (sector by sector) of a disk, e.g.: CD, DVD, USB stick, hard drive, etc... ISO images have been the most used file format for cloning or duplicating disks for a very long time, namely since the late 1980's along with the first consumer CD-ROM products. 

 

How to use or extract ISO images contents?

ISO images are mountable and burnable/clonable onto real media universally (on any OS).  You can also browse and extract specific files from ISO images using small shareware utilities such as PowerISO.  Mounting a .iso file makes a new drive appear on your OS, effectively letting you use it as if you had the original media inserted.

ISO images can also be attached to almost all emulators since it's universal.  Namely, SheepShaver, QEMU and Basilisk II all support you attach a .iso disk image to them.  It will mount as it were a hard drive on the emulated desktop.

-- How to burn/clone disk images onto USB sticks super easily under Windows and under Mac OS X

 

Under Classic Mac OS (before Mac OS X)

Mac OS 8.5 to Mac OS 9.2.2: Toast 5 Titanium

Mac OS 7.0 to Mac OS 9.2.2: Virtual DVD-ROM/CD Utility

 

Under Mac OS X

Use Disk Utility bundled with every Mac OS X environment: Launch Disk Utility > FILE menu > Open disk image...

 

Under Windows

Open it using PowerISO

 

Under Linux

The most comfortable choice will depend on whether you prefer to work with a GUI or at the command line, which desktop environment you chose, and whether you want to burn the image, mount it, or just copy files out without mounting it.

For GUI users who want to burn a disc, there should be an option to do so in your desktop's standard CD/DVD mastering tool. (eg. Tools > Burn Image in KDE's K3b.)

Mounting ISO images in the GUI varies from file manager to file manager. With PCManFM for LXDE and LXQt offering disk mounting in the Open With... section of the context menu while Dolphin for KDE relies on its integration with the Ark archival GUI.

However, comprehensive support for the myriad things that can be packed into a .iso container is lacking in all such cases and you are advised to rely on the kernel's support for ISO9660, UDF, HFS, and HFS+ filesystems via either CDEmu (a low-level image mounter intended to be equivalent to Daemon Tools for Windows) if you want GUI support for inserting and removing virtual discs or the kernel's loopback device support via the command-line mount tool.

To burn a disc from the command-line (eg. for use in scripts), you can find advice in places like the Debian wiki.

The most important caution when using the tools you may see your GUI delegating to is to use wodim (short for "write optical disk media") for burning CDs as it was designed to address the quirks of CD-burning that were ironed out when DVD-burning was specified, but to use growisofs for burning DVDs as wodim was more or less in maintenance mode by the time DVD support was added to it.

  • wodim -v dev=/dev/sr0 /path/to/cd.iso
  • growisofs -dvd-compat -Z /dev/sr0=/path/to/dvd.iso

Additional options to control things like the burning speed (speed=1 for wodim, -speed=1 for growisofs) as well as usage examples are documented in the man pages for both commands.

In the event that your optical device is not /dev/sr0, the device node for your optical drive can be determined by inserting a disc, making sure it's visible in your file manager, typing mount in a terminal, and finding the line that corresponds to the path in the file manager.

/dev/sr0 on /media/ssokolow/Kubuntu 22.04.1 LTS amd64 type iso9660 (...)

(the name sr0 indicates the first Removable storage device on the system implemented using the SCSI driver framework, counting from zero. This includes PATA, SATA, and USB devices these days but only when the medium itself is removable, not the entire drive, so USB flash drives will not appear as /dev/srX entries.)

Mounting an image at the command-line is achieved via the -o loop option.

You will also likely need to manually specify the filesystem as, in my experience, the mount command's autodetection doesn't always pick up hfs or hfsplus partition types. Use of the mount command requires root permissions for devices without a line in /etc/fstab that includes user in the options section.

sudo mount -t hfs -o loop mac_disc.iso /path/to/mount/point
# do stuff
sudo umount /path/to/mount/point

You may also be able to copy files into and out of such images without mounting them using the tools from the hfsutils package. This does not require root permissions but may not be as robust.

hmount /path/to/image.iso
hls
hcd Folder
hls
hcd 'Folder 2'
hls
hcopy 'File Name' .
humount