mkisofs: Create ISO Images from Directories


mkisofs: Create ISO Images from Directories

A pragmatic guide for beginners and intermediate users on creating ISO images from folders using mkisofs (also aliased as genisoimage).

Quick start

  • Basic ISO from a folder:
mkisofs -o output.iso /path/to/source_directory
  • Set a disc label:
mkisofs -o output.iso -V "My Disc Label" /path/to/source_directory
  • Include Joliet or Rock Ridge for better compatibility:
mkisofs -o output.iso -J -R /path/to/source_directory

Why you might choose mkisofs

  • It’s a straightforward way to build ISO9660 filesystems for CDs/DVDs or for mounting in emulators.
  • Useful when you need precise control over the filesystem layout, labels, and included metadata.

Common options (quick reference)

  • -o FILE: specify the output ISO image name.
  • -V NAME: set the disc label.
  • -J: enable Joliet names for Windows compatibility.
  • -R: enable Rock Ridge extensions for richer Unix metadata.
  • -iso-level LEVEL: control the ISO9660 standard level (1, 2, or 3).
  • -p AUTHOR: publisher string to embed.
  • -graft-points: allow graft points for more flexible directory layouts.

Tip: If you’re on a distro where mkisofs is provided as part of the genisoimage package, you can often invoke it as mkisofs or as genisoimage with the same options.

Common pitfalls

  • Spaces in paths: quote paths or escape spaces. For example: /path/with\ spaces/source.
  • Output file collisions: an existing output.iso will be overwritten without a warning unless you add -no-emul-boot and related boot options; always ensure you’re targeting the right file.
  • Case of source path: mkisofs reads the filesystem tree as given; changing the order of arguments won’t change the source unless you modify the path.
  • Large or mixed-content folders: verify the resulting ISO on a test mount to ensure all files are readable and permissions are preserved as needed.

When to use alternatives

  • For encrypted or feature-rich optical media creation, tools like genisoimage, wodim, or newer utilities in your distro may offer updated defaults.
  • If you’re on a system that emphasizes modern, ongoing ISO creation workflows, consider tools like xorriso, which extends and supersedes mkisofs/genisoimage in many environments.

Quick tips

  • Always test your ISO by mounting it:
mkdir /tmp/iso_test
sudo mount -o loop output.iso /tmp/iso_test
ls /tmp/iso_test
sudo umount /tmp/iso_test
  • If you need cross-platform compatibility (Windows, macOS, Linux), enable Joliet and possibly Rock Ridge:
mkisofs -o output.iso -J -R /path/to/source_directory

TL;DR

  • Create an ISO from a folder with: mkisofs -o output.iso /path/to/source_directory
  • Add a disc label with -V “Label” and enable compatibility features with -J and -R
  • Always test the resulting ISO before burning or distributing

See Also