isosize
Determine the size of an ISO image
TLDR
Display the size of an ISO file
Display the block count and block size of an ISO file
Display the size of an ISO file divided by a given number (only usable when --sectors is not given)
SYNOPSIS
isosize [options] <ISO_image_file>
PARAMETERS
<ISO_image_file>
The path to the ISO 9660 image file whose size is to be determined.
-x
Display the size in sector (block) units. Each sector is typically 2048 bytes for ISO 9660 images.
-d
Display the size in decimal bytes. This is the default output format.
-h
Display the size in a 'human readable' format (e.g., 1.4G, 700M). This option automatically chooses the most appropriate unit (bytes, kilobytes, megabytes, gigabytes, etc.).
DESCRIPTION
isosize is a command-line utility used to determine the exact size of an ISO 9660 image file. Unlike generic file size tools like ls, which report the raw byte size of the file on disk, isosize reads the internal metadata of the ISO image itself, specifically the Primary Volume Descriptor (PVD). This allows it to report the logical size of the data contained within the ISO 9660 filesystem, which is the size that the operating system would recognize when the image is mounted or burned to an optical disc.
This utility is particularly useful for verifying the integrity and correct creation of ISO images generated by tools such as mkisofs or genisoimage. It ensures that the image's internal structure correctly reflects its intended size, which is critical for successful burning to media like CD-ROMs or DVDs, or for proper mounting as a virtual drive. It helps prevent issues that might arise from malformed or incomplete ISO images.
CAVEATS
isosize is specifically designed for ISO 9660 formatted images. It may not correctly parse or report sizes for other disk image formats like UDF, FAT, or NTFS images. Its accuracy relies on the correctness and integrity of the Primary Volume Descriptor (PVD) within the ISO image; a corrupted PVD could lead to incorrect size reporting or failure.
HOW IT WORKS
isosize operates by reading the Primary Volume Descriptor (PVD) within the ISO 9660 image. The PVD contains critical information about the ISO 9660 filesystem, including the 'Volume Space Size' (the total number of logical blocks in the volume) and 'Logical Block Size' (the size of each logical block, typically 2048 bytes). isosize multiplies these two values to calculate the total size of the ISO 9660 volume in bytes.
USAGE EXAMPLE
To get the human-readable size of an ISO file named my_software_image.iso:
isosize -h my_software_image.iso
To get the size in blocks:
isosize -x my_software_image.iso
HISTORY
isosize is part of the widely used util-linux package, a collection of essential Linux utilities. Its development is closely tied to the need for robust handling and verification of optical disc images, a common task in Linux environments since the advent of CD-ROMs and DVDs. The command has remained relatively stable over time, reflecting its focused purpose and the consistent structure of the ISO 9660 standard.
SEE ALSO
mkisofs(8), genisoimage(8), dd(1), mount(8), file(1)