LinuxCommandLibrary

isosize

Determine the size of an ISO image

TLDR

Display the size of an ISO file

$ isosize [path/to/file.iso]
copy

Display the block count and block size of an ISO file
$ isosize [[-x|--sectors]] [path/to/file.iso]
copy

Display the size of an ISO file divided by a given number (only usable when --sectors is not given)
$ isosize [[-d|--divisor]] [number] [path/to/file.iso]
copy

SYNOPSIS

isosize [options] <iso_image_file>

PARAMETERS

-d <sector_size>
    Specify the sector size. Overrides autodetection.

-i <image_size>
    Specify the number of sectors that are in the image.

-x <sector_size>
    Set the sector size and output the size in sectors (without multiplication).

<iso_image_file>
    The path to the ISO image file.

DESCRIPTION

The isosize command determines the size of an ISO 9660 filesystem image. It analyzes the image file and reports its size in blocks. This is useful for verifying the integrity of ISO images, checking the amount of space they occupy, and confirming if they are correctly formatted. The command is typically used to ascertain the size of CD-ROM images, but it can also be applied to other filesystems adhering to the ISO 9660 standard.

Unlike simply checking the file size via 'ls -l', isosize looks at the ISO 9660 filesystem structure itself. This is important as some ISO images might have trailing garbage data, which affects the file's overall size but is irrelevant to the valid image contents. isosize accurately calculates the data relevant to the ISO filesystem. It reads the Primary Volume Descriptor to get the volume size. It supports a few ways to specify blocksize; using -d to specify the size of sectors or using -x and specify the size of the sectors and use -i and use the provided value. The command is crucial when dealing with CD burning, filesystem integrity checks, and virtual machine image creation.

CAVEATS

The command might not accurately determine the size of corrupted or non-standard ISO images.

EXAMPLES

isosize image.iso
Outputs the size of image.iso in 2048-byte blocks (the default for ISO 9660).

isosize -x image.iso
Outputs the size of image.iso in sectors without multiplying by the standard sector size.

SEE ALSO

mkisofs(8), genisoimage(1), file(1)

Copied to clipboard