Is an ISO image file a filesystem in its own right?
An ISO file isn't a file system. It contains a file system. From a usage point of view, it functions the same way as a hard disk or USB device or DVD - you need to have a mount point, i.e. a place in your file system where you can mount it in order to get at the contents.
There are three separate concepts here:
- A block device, which is a physical or virtual device that represents a series of equal sized data blocks. HDDs are block devices. So are data CDs.
- A filesystem, which defines a way of storing data in a block device that represents a series of files and directories and other filesystem information. ext3 is a file system, as is ISO9660.
- An image file is a copy of the data on a block device, in the form of a file (on another filesystem). Image files can have any extension;
.img
is common.
A .iso
file is usually an image file of a block device containing an ISO9660 filesystem. It contains an exact representation of the data stored on a CD. Analogously, you could have a .img
file (call it .ext3
if you prefer) that is an image file of a block device containing an ext3 filesystem. This is a common way of distributing bootable USB or floppy images. The name is arbitrary, .iso
is just what we call image files containing an ISO9660 filesystem (or, sometimes, a UDF filesystem, which is more modern).
You cannot directly mount image files, as they are not block devices, but merely a copy of the data in a block device. However, Linux and other OSes have a feature called loop devices which allows an image file to be accessed as a block device. To mount an ISO file, you first create a loop device that represents a virtual block device with the same contents as the ISO file. Then you can mount it just like you would a physical CD, or like you would a USB drive containing an ext3 filesystem, or anything else. The mount
command may do this for you automatically, but under the hood they are separate steps.
Partitions are a way of breaking up a block device into multiple, smaller, logical block devices. Partitions are optional. A CD is analogous to an unpartitioned USB drive or a floppy disk in this respect, one where the filesystem is stored on the entire device with no partition table. ISO files therefore do not contain a partition table. Nothing stops you from, say, creating an ISO9660 filesystem on an HDD partition, though. When you do have partitions, an image file may be of a single partition or of the entire physical device including the partition table, but CDs aren't partitioned, so the distinction is irrelevant for ISO images.
You do not have to mount a device - or an image file - in order to access the files contained within. Some applications and libraries have the ability to access the data directly, without involving the operating system. They simply understand the filesystem directly, and have code that mimics what the OS does when it accesses files in a filesystem. This is why tools exist that can show you the contents of an ISO file, without actually mounting it via the OS. Mounting is an operating system concept, but it's not the only way of accessing data on a block device. Some people might consider the mere action of doing this "mounting" in a way.
What you mount a device (or an ISO file through a loopback device) onto is irrelevant. That's just where in the path hierarchy you ask the OS to show the contents of a device. On Linux, you usually would pick a directory on some already mounted file system. But nothing stops you from, say, booting from a CD and asking the kernel to mount it as the root filesystem. Of course, since an ISO file is, well, a file, it probably exists on some file system to begin with, which you need to have mounted somewhere in order to access the ISO at all.
No, the ISO image file is not a file system in its own right. Just like a partition can contain a file system, but isn't a file system, does an ISO image file contain a file system, but it isn't a file system.
But you need a file system for two things:
- a place to store the .iso file (assuming if it doesn't come as a shiny silver disc)
- a directory where to mount e.g.
/mnt/isotmp
After that, if a path resolves to something under /mnt/isotmp
, the code for the ISO image filesystem will do the resolving, opening, etc.