Mkisofs

From LQWiki
Jump to: navigation, search

mkisofs - A utility for creating hybrid ISO9660/Joliet/HFS filesystems, including optional Rock Ridge extensions.

  • ISO9660: A format for storing data about the files on a volume (file system). It's a "lowest common denominator" that most operating systems will understand. This is the format used by CD image files, sometimes called ISO's.
  • Joliet: an extension to the ISO9660 format which allows for long filenames and filenames in unicode.
  • Rock Ridge: an extension to the ISO9660 format, which allows the CD to store long filenames, UNIX permissions, and symbolic links].
  • HFS (Heirarchal File System): a third extension, which supports file information useful to Macintosh computers.

mkisofs is useful for CD and DVD writing, but it cannot perform the write itself. Instead, it takes a directory structure and converts it into a binary file which corresponds to the information which would be on the CD. This file can be used by CD mastering software such as cdrecord.

mkisofs can be used to create bootable CDs.

Typical command-lines

A typical command line for making an iso image from a directory would be:

$ mkisofs -r -o creative_name.iso /home/user/directory

A typical command line for making an iso image that is not ISO9660 compliant but with better filename support would be:

$ mkisofs -r -J -l -d -allow-multidot -allow-leading-dots -no-bak -o creative_name.iso /home/user/directory

Common Options

-allow-leading-dots
-ldots
Allows files to begin with "." (period). Use this option to write Unix/Linux hidden files. CD will not be DOS compatable. (Who cares! Thus use this option.)


-allow-multidot
Allows files to contain multiple "."s (periods). Use this option to write Unix/Linux files which may contain more than one period. CD will not be DOS compatable. (Who cares! Thus use this option.)


-b path-to-boot-image
Specifies the path and filename of the boot image to be used when making an "El Torito" bootable CD. The pathname must be relative to the source path specified to mkisofs. Required to make a bootable CD. The boot image must be exactly the size of either a 1.2, 1.44, or a 2.88 meg floppy.


-c path-to-boot-catalog
Specifies the path and filename of the boot catalog to be used when making a bootable CD. The pathname must be relative to the source path specified to mkisofs.


-d
Don't put a "." (period) on the end of files that don't have them. CD will not be DOS compatable. (Who cares! Thus use this option.)


-graft-points
Translate a directory to the root ("/") of the CD. See examples. (i.e.: -graft-points "/=DirectoryName/")


-l
Allow 31 character file names. CD will not be 8.3 DOS compatable. (Who cares! Thus use this option.)


-no-bak
Do not include backup files (those ending in "~", "#" and ".bak") in the image.


-o image-name
Name of iso9660 output image file, typically ending in ".iso".


-r
Set file permisions on CD to be publicly readable.


-v
Verbose execution.


-x path
Exclude given path from being written to CDROM.


-A string
Text string that will be written into the volume header, max 128 characters. Typically this is used to describe the contents of the disc.


-J
Generate Joliet directory records in addition to regular iso9660 file names. This preserves the case (upper/lower) of file and directory names.


-R
Add Rock Ridge records to further describe the files. If you used -r then Rock Ridge records will already be activated.


-V volume
Specifies the volume ID to be written into the master block, max 32 characters.


-T
Generate a file TRANS.TBL in each directory, which provides information about original file-names in case they were altered to conform to iso9660 standards.