LinuxCommandLibrary

mkisofs

Create ISO 9660 filesystem images

TLDR

Create an ISO from a directory

$ mkisofs -o [filename.iso] [path/to/source_directory]
copy

Set the disc label when creating an ISO
$ mkisofs -o [filename.iso] -V "[label_name]" [path/to/source_directory]
copy

SYNOPSIS

mkisofs [options] -o output_file.iso source_directory_or_files [...]

PARAMETERS

-o file
    Specifies the path and name of the output .iso image file.

-r
    Enables Rock Ridge extensions, which preserve UNIX-style file attributes like permissions, ownership, timestamps, and symbolic links. This makes the ISO image more compliant with UNIX/Linux filesystems.

-J
    Enables Joliet extensions, primarily for compatibility with Microsoft Windows. This supports Unicode filenames and longer names (up to 64 characters) than standard ISO9660.

-R
    Synonym for -r (Rock Ridge).

-V id
    Sets the Volume ID (or volume label) for the ISO image, which is displayed when the disc is mounted.

-b boot_image
    Specifies the path to a boot image file (e.g., an El Torito boot image) for creating bootable CDs/DVDs. The path is relative to the source directory.

-c boot_catalog
    Specifies the path for the boot catalog file, used in conjunction with -b for El Torito bootable images. The path is relative to the source directory.

-U
    Allows all filenames to be used without strict ISO9660 compliance checking. Often used with -r to allow full UNIX filenames.

-udf
    Creates a UDF (Universal Disk Format) filesystem alongside the ISO9660 filesystem, providing broader compatibility and support for larger files/volumes, typically for DVDs/BDs.

-m pattern
    Excludes files and directories matching the specified pattern from being added to the ISO image. Multiple -m options can be used.

DESCRIPTION

mkisofs is a command-line utility used to generate ISO9660 filesystem images, commonly referred to as ISO files. These images are standard formats for storing data destined for optical media like CDs, DVDs, and Blu-ray discs. The command takes a specified directory tree or set of files as input and constructs a single, self-contained .iso file that preserves the directory structure, file content, and various metadata.

It supports various extensions to the basic ISO9660 standard, such as Rock Ridge (for UNIX-like systems, preserving permissions, symlinks, and longer filenames), Joliet (for Windows, supporting Unicode filenames and longer names), and UDF (Universal Disk Format). This flexibility makes mkisofs an essential tool for creating bootable media, distributing software, or archiving data in a widely compatible format.

CAVEATS

While widely used, mkisofs adheres to strict filename rules if not explicitly told to use extensions like Rock Ridge or Joliet. Filesystem permissions and ownership are preserved with Rock Ridge but may not be recognized by all operating systems. For creating bootable media, careful preparation of the boot image is required. Note that on many modern Linux distributions, mkisofs is often a symbolic link to genisoimage, which is a fork of the original mkisofs project.

CREATING BOOTABLE IMAGES

To create a bootable ISO image, you typically need a specially prepared boot image file (e.g., a GRUB or SYSLINUX image) and specify it using the -b option. For El Torito bootable CDs, a boot catalog file is also created using the -c option. The boot image path is relative to the source directory provided to mkisofs.

ISO 9660 LEVELS AND EXTENSIONS

mkisofs supports various ISO 9660 levels, which dictate filename length and character sets. By default, it tries to use the highest compatible level. Crucially, extensions like Rock Ridge (-r) for UNIX-like systems and Joliet (-J) for Windows are vital for preserving modern filenames, permissions, and other attributes that the base ISO 9660 standard lacks. For DVDs and Blu-rays, the -udf option provides UDF filesystem support for better compatibility and handling of larger files.

HISTORY

The original mkisofs program was part of the cdrtools suite, developed by Eric Youngdale and later by Joerg Schilling. Over time, licensing changes and community disagreements led to a fork, resulting in genisoimage, which became the widely adopted open-source alternative. Many Linux distributions now provide genisoimage under the mkisofs command name (via a symbolic link). The functionality largely remains the same, but genisoimage is independently maintained. More recently, xorriso has emerged as a powerful, feature-rich tool that can also create and manipulate ISO/UDF images, often serving as a modern replacement for both mkisofs and burning tools.

SEE ALSO

genisoimage(1), xorriso(1), cdrecord(1), wodim(1), growisofs(1), mount(8)

Copied to clipboard