Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of mkisofs Command under Linux

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the usage of mkisofs command under Linux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of mkisofs command under Linux".

Mkisofs

The mkisofs directive can create an ISO9660/Joliet/HFS filesystem, which is now replaced with the directive genisoimage. GenisoImage is a pre-master program used to generate iso 9660/joliet/hfs hybrid file systems.

GenisoImage is able to generate system usage protocol records (SUSP) specified by the Rock Ridge exchange protocol, which is used to further describe files in the iso 9660 file system to unix hosts and to provide information such as long file names, UID/GID, POSIX permissions, symbolic links, and block and character device files. If you specify the Joliet or HFS mixed command line option, genisoImage will create additional file system metadata required by Joliet or HFS, otherwise genisoImage will generate a pure ISO 9660 file system.

GenisoImage can generate real (or shared) HFS hybrid file systems. These files are treated as HFS files when accessed from Macintosh and as ISO 9660 files when accessed from other machines. HFS stands for hierarchical file system and is an alternative to the native file system used on Macintosh computers, and genisoImage can generate Apple extensions to ISO 9660 for each file. When accessed from Macintosh, these extensions provide each file with the creator, type, and some Finder flags. See the HFS Macintosh file format section below.

GenisoImage takes a snapshot of a given directory tree and generates a binary image that corresponds to the iso 9660 and / or hfs file system when written to a block device.

Each file written to the iso 9660 file system must have a file name of 8.3 format (up to 8 characters. Up to 3 characters, all uppercase), even if Rock Ridge is in use. This file name is for systems that cannot use the Rock Ridge extension (such as MS-DOS), and each file name in each directory must be different from the file name in each directory. GenisoImage usually attempts to form the correct names by forcing unix file names to be capitalized and truncated as needed, but this usually produces unsatisfactory results when not all truncated names are unique. GenisoImage assigns weights to each file name, and if two other identical names are found, the lower priority name is renamed to contain a three-digit number (guaranteed to be unique). For example, two files "foo.bar" and "foo.bar.~1~" can be rendered as "FOO.BAR;1" and "FOO000.bAR;1"

When used with various HFS options, genisoImage attempts to identify files stored in multiple Apple/Unix file formats and copy data and resource derivations as well as any related Finder information. For more information about genisoImage support, see the HFS Macintosh file format section below.

Note that genisoImage is not designed to communicate directly with the author. Most writers have a proprietary set of commands, and each manufacturer is different, and you need a special tool to actually record the disk. WODIM is one such tool.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Mkisofs [options] [- o file.iso] srcfile

Genisoimage [options] [- o filename] pathspec [pathspec...]

Pathspec is the path to copy to the directory tree in the iso 9660 file system. Multiple paths can be specified, and genisoImage merges files from all the specified path components into a file system image.

If the "- graft-points" option is specified, the path can be grafted outside the root directory, or the file or directory can be migrated to the CDRom image, and the name in the source file system can be different. Let's first assume that there is a local file ". / old.lis" and want to include it in the CDROM image. Statement

Foo/bar/=../old.lis

You can include "old.lis" in the CDROM image of "/ foo/bar/old.lis". While the statement

Foo/bar/xxx=../old.lis

You can include "old.lis" in the CDROM image of "/ foo/bar/xxx". The same syntax can be used with directories. GenisoImage will create any directory to meet the need for grafting points on the CDROM image. By default, any directory created dynamically like this has permission of 0555 and is owned by the operator of genisoimage. If you want additional permissions or the owner of an intermediate directory, see-uid,-gid,-dir-mode,-file-mode and-new-dir-mode.

2. List of options

Option

Description

-abstract file

Set the summary file name, which can be 37 characters

-An AppId

Specifies a text string that describes the CD application Id, which can be 128 characters

-allow-limited-size

When working with files larger than 2GiB that cannot be easily represented in ISO 9660, add them to ISO 9660 with a reduced visible file size and add the correct visible file size to the UDF system. The result is an inconsistent file system, and users need to make sure that they are actually using UDF instead of the ISO 9660 driver to read such disks. Means to enable-UDF.

-allow-leading-dots-ldots

Allows ISO 9660 file names to start with a period. Typically, in order to maintain MS-DOS compatibility, underscores are used to replace the leading points. This violates the ISO 9660 standard, but it happens to apply to many systems. Use it carefully.

-allow-lowercase

Allows lowercase letters in iso9660 file names. This violates the ISO 9660 standard, but it just applies to some systems and is used with caution.

-allow-multidot

Multiple dots are allowed in the iso9660 file name. The boot point is not affected by this option, and you can use "- allow-leading-dots" alone, which violates the ISO 9660 standard, but it just happens to apply to many systems. Use it carefully.

-biblio file

Specify the bibliographic file name. There is a space of 37 characters. Equivalent to BIBL in the ".genisoImagerc" file.

-cache-inodes

-no-cache-inodes

Enables or disables inode caching and looking for hard links to files by device number. If genisoImage finds a hard link (a file with multiple names), the file will also be hard-linked on cd, so the contents of the file are displayed only once. This helps to save space. An operating system similar to Unix, but non-cached inode is used by default on other systems such as Cygwin, where it is not safe to assume that inode numbers are unique. (some versions of Cygwin use a weak hashing algorithm to create fake inode numbers, which may duplicate.) If two files have the same inode number but are not hard links to the same file, "genisoImage-cache-indes" will behave incorrectly. "- no cache-inode" is safe in all cases, but in this case genisoImage cannot detect hard links, so the resulting cd image may be larger than needed.

-alpha-boot alpha _ boot_image

Specifies the path and file name of the boot image to use when making the Alpha/SRM bootable CD. The pathname must be relative to the source path assigned to the genisoimage.

-hppa-bootloader hppa_bootloader_image

Specifies the path and file name of the boot image to use when making the HPPA bootable CD. The pathname must be relative to the source path assigned to the genisoImage. Other options are required, at least a kernel file name and a boot command line.

-hppa-cmdline hppa_boot_command_line

Specifies the command line to pass to the HPPA boot loader when making a bootable CD. Separate parameters with spaces or commas. More options must be passed to genisoImage, at least one kernel file name and boot loader file name.

-hppa-kernel-32 hppa_kernel_32

-hppa-kernel-64 hppa_kernel_64

Specify the paths and filenames of the 32-bit and / or 64-bit kernel images used when making the HPPA bootable CD. The pathname must be relative to the source path assigned to the genisoImage. Other options are required, at least the boot loader file name and the boot command line.

-hppa-ramdisk hppa_ramdisk_image

Specifies the path and file name of the ramdisk image to use when making the HPPA bootable CD. The pathname must be relative to the source path assigned to the genisoImage. This parameter is optional. Other options are required, at least one kernel file name and boot command line.

-mips-boot mips_boot_image

Specifies the path and file name of the boot image to use when generating the SGI/ big-end MIPS bootable CD. The pathname must be relative to the source path assigned to the genisoImage. You can specify this option multiple times to store up to 15 boot images.

-mipsel-boot mipsel_boot_image

Specify the path and file name to make the DEC/ small-end MIPS boot image. The pathname must be relative to the source path assigned to the genisoImage.

-b eltorito_boot_image

Specify the path and file name of the boot image to use when making the EL Torito bootable CD for x86 PC. The pathname must be relative to the source path specified for genisoImage. This option is required for making El Torito bootable CD. The boot image must be exactly 1200 kB, 1440 kB, or 2880 kB, which genisoImage will use when creating an iso 9660 file system. Pc BIOS will use this image to simulate the floppy disk, so the first 512-byte sector should contain the pc boot code.

If the boot image is not a floppy disk image, you need to add "- hard-disk-boot" or "- no-emul-boot." If the system should not boot from the analog disk, use "- no-boot".

If "- sort" is not specified, the boot image is sorted to the beginning of the media with a low priority (2). If you don't like this, you need to specify a sort weight of 0 for the boot image.

-B img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e

-sparc-boot img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e

Set the boot file name, img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e.

Specifies that a comma-separated list of boot images required to boot cd is made for the SPARC system. Partition 0 is used for the iso 9660 image, and the first image file maps to partition 1. A comma-separated list may have up to 7 fields, including empty fields. This option is required to make a bootable cd for Sun. If the-B or-SPARC- boot is specified, the first sector of the generated image will contain a Sun disk label. This disk label specifies slice 0 for the ISO 9660 image and slices 1 to 7 for the boot image specified with this option. The byte offset 512 to 8191 in each additional boot image must contain a master boot appropriate for the appropriate SPARC architecture. The rest of each image usually contains a ufs file system for the boot phase of the main kernel.

The bootstrap method for implementation is found in SunOS4.x and SunOS5.x. However, it does not depend on SunOS internally, but only on the properties of OpenBootprom, so it should be available for any operating system used on SPARC systems.

If a file name is specified, the actual and all boot partitions below are mapped to the previous partition. If you call genisoImage with-G image-B, all boot partitions are mapped to the partition that contains the iso 9660 file system image, while the generic boot image in the first 16 sectors of the disk is used for all architectures.

-G generic_boot_image

Specifies the path and file name of the boot image to use when making a universal bootable cd. The boot image will be placed on the first 16 sectors of the cd, before the iso 9660 primary volume descriptor. If this option is used with-sparc-boot, the Sun disk label will overwrite the first 512 bytes of the generic boot image.

-eltorito-alt-boot

Start with a new set of El Torito startup parameters. Up to 63 El Torito boot entries can be stored on one CD.

-hard-disk-boot

Specifies that the boot image used to create the El Torito bootable CD is the hard disk image. The image must start with a master boot record that contains a single partition.

-no-emul-boot

Specifies that the boot image used to create the El Torito bootable cd is a No Emulation image. The system loads and executes this image without performing any disk simulation.

-no-boot

Specifies that the created El Torito CD should be marked as unbootable. The system will provide an image of the analog drive, but will start a standard boot device.

-boot-load-seg segment_address

Specify the load segment address of the boot image that is not simulated El Torito cd

-boot-load-size load_sectors

Specifies the number of "virtual" (512-byte) sectors loaded in non-simulation mode. The default is to load the entire boot file. If it is not a multiple of 4, some BIOSes may have problems.

-boot-info-table

Specifies that a 56-byte table containing CD-ROM layout information is patched at offset 8 in the boot file. If this option is provided, the startup file will be modified in the source file system, so if you cannot easily regenerate the file, create a copy of the file! For a description of this table, see the El Torito Startup Information Table section.

-C last_sess_start,next_sess_start

This option requires the creation of an additional CD or an image of a second session or higher level session for the multi-session disk. "- C" requires two numbers, separated by commas. The first is the first sector in the last session of the disk that should be attached. The second is the starting sector number of the new session. The correct number can be obtained by calling "wodin-msinfo". If-"C" is used with "- M", genisoImage will create a file system image that will serve as a continuation of the previous session. If you use "- C" instead of "- M", genisoImage creates a file system image for CD's additional second session. This is a multi-session cd that saves audio data in the first session and the iso 9660 file system in the second session.

-c boot_catalog

Specify the path and file name of the boot directory, which is required for El Torito to boot CD. The pathname must be relative to the source path assigned to the genisoImage. This file will be inserted into the output tree and not created in the source file system, so make sure that the specified file name does not conflict with the existing file, otherwise it will be excluded. You usually choose a name like "boot.Catalog".

If "- sort" is not specified, the boot directory is sorted to the beginning of the media with a low priority (1). If you don't like this, you need to specify a sort weight of 0 for the boot directory.

-check-oldnames

Check that all file names imported from the old session conform to the iso 9660 file naming convention. If this option is not available, only names with more than 31 characters are checked because these files seriously violate the iso 9660 standard.

-check-session file

Check that all old sessions conform to the actual genisoImage iso 9660 file naming convention. This is an advanced option that combines "- M file-C 0J 0-check-oldnames"

-copyright file

Specifies the copyright information, usually the file name on the CD. There is a space of 37 characters. It is equivalent to copying in the ".genisoImagerc" file.

-d

Do not append a period to a file without a period. This violates the ISO 9660 standard, but it happens to apply to many systems. Use it carefully.

-D

Instead of using depth directories to relocate, package them in the way we see them. If iso 9660 1999 is not selected, it violates the iso 9660 standard, but it just happens to apply to many systems.

-dir-mode mode

Rewrite the directory mode used to create the mirror and specify it as the 4 digits of the weight limit in chmod (1).

-dvd-video

Generate a UDF file system that conforms to DVD video. This is achieved by sorting the content order of the appropriate files and adding padding between the files as needed. Note that sorting works only if the DVD video file name contains only uppercase characters.

Note that in order to get a file system image that conforms to dvd video, you need to prepare a directory tree that conforms to dvd video, which requires that the root directory of the generated dvd contains directories VIDEO_TS and AUDIO_TS (all uppercase). VIDEO_TS needs to contain all the required files for the video file system (the file name must be all uppercase).

-f

Follow symbolic links when building a file system. When this option is not used, symbolic links will use Rock Ridge, and if Rock Ridge is not enabled, they will be ignored.

-file-mode mode

Override the pattern used to create regular files for image, using a 4-bit mode

-gid gid

Rewrite the group ID read from the source file to the value of gid. Specifying this option automatically enables the RockRidge extension

-gui

Toggles the behavior of GUI. This makes the output more verbose, but may have other effects in the future.

-graft-points

Allows the use of grafting points for file names. If you use this option, all file names are checked for grafting points. The file name is separated by the first unescaped equal sign. If "- graft-points" is specified, all appearing'\ 'and' = 'characters must be escaped with'\'.

-hide glob

Hide any files that appear in the ISO 9660 or Rock Ridge directory that match the shell wildcard pattern GLOB. The GLOB may match any part of the file name or path. If GLOB matches a directory, the contents of that directory are hidden. To match the directory name, make sure that the path name does not include the trailing "/ 'character. All hidden files will still be written to the output CD image file. See-Hided-Joliet and README.Hide. This option can be used multiple times.

-hide-list file

The file that contains the list of shell wildcards to hide

-hidden glob

Add hidden (existing) ISO 9660 directory attributes to files and directories that match GLOB, which is a shell wildcard pattern. This property will prevent the file from being displayed by some MS-DOS and Windows commands. GLOB may match any part of the file name or path.' / 'character. This option can be used multiple times

-hidden-list file

A file containing a list of shell wildcards that get hidden properties

-hide-joliet glob

Hide the files and directories seen in the Joliet directory that match the shell wildcard pattern GLOB. The GLOB may match any part of the file name or path. If GLOB matches a directory, the contents of that directory are hidden. To match the directory name, make sure that the pathname does not include the trailing "/" character. All hidden files will still be written to the output CD image file. This option is usually used with-Hide. See README.Hide. This option can be used multiple times.

-hide-joliet-list file

A file that contains a list of shell wildcards to hide from the Joliet tree.

-hide-joliet-trans-tbl

Hide the TRANS.TBL file in the Joliet tree. These files are usually meaningless in the Joliet world because they list real names and ISO 9660 names, both of which may be different from Joliet names.

-hide-rr-moved

Change the ".rr _ move" directory of the directory "RR_MOVED" in the RockRidge tree. It seems impossible to completely hide the "RR_MOVED" directory in the Rock Ridge tree. This option will only make it easier for people who do not know the directory to confuse the visible tree. If you don't need the "RR_MOVED" directory, use the "- D" option. Note that if-D is specified, the resulting file system does not conform to ISO 9660 level-1 and cannot be read on MS-DOS.

-input-charset charset

Defines the input character set used in the local file name. To get a list of valid character set names, call "genisoImage-put-charset" for help. To get the 1:1 mapping, you can use the default value as the character set name. The default initial value is cp 437 on DOS systems and iso 8859-1 on all other systems. For more information, see the character set section below.

-output-charset charset

Defines the output character set that will be used in the Rock Ridge file name, which defaults to the input character set. For more information, see the character set section below.

-iso-level level

Sets the ISO 9660 consistency level. The valid numbers are 1 to 4.

1) for level 1, the file can only consist of one part, and the file name is limited to 8.3 types.

2) for level 2, the file can only consist of one part.

3) for the third level, there are no restrictions (except for ISO-9660:1988).

All ISO 9660 levels range from 1 to 3, and all file names are limited to uppercase letters, numbers, and underscores (_). File names are limited to 31 characters, directory nesting is limited to 8 levels, and pathnames are limited to 255 characters.

4) level 4 officially does not exist, but genisoImage maps it to ISO-9660:1999, which is ISO 9660 version 2.

When using level 4, the version number of the enhanced volume descriptor and the version number of the file structure are set to 2. Directory nesting is not limited to level 8, the file does not need to contain dots, dots have no special meaning, the filename has no version number, and the filename can be up to 207characters long. If you use Rock Ridge, the filename can reach 197characters.

When you create the second version of image, genisoImage issues an enhanced volume descriptor that is similar to but not exactly the same as the primary volume descriptor. Be careful not to use corrupted software to make the ISO 9660 image bootable by assuming a second copy of PVD and patching this hypothetical copy of PVD to El Torito VD.

-J

In addition to the normal ISO 9660 file name, Joliet directory records are also generated. This is useful when using CDs on Windows machines. The Joliet filename is encoded in Unicode, and each path component can have up to 64 Unicode characters. Note that Joliet is not standard-only Microsoft Windows and Linux systems can read Joliet extensions. For better portability, consider using both Joliet and Rock Ridge extensions.

-joliet-long

Joliet file names are allowed to be up to 103 Unicode characters instead of 64 characters. This violates the Joliet specification, but seems to work. Use it with caution.

-jcharset charset

Combination of "- J-input-charset charset".

-l

Allows a full 31-character file name. Typically, iso 9660 filenames will be in the MS-DOS-compatible format, although the iso 9660 standard allows filenames of up to 31 characters. If you use this option, the CD may be difficult to use on MS-DOS systems, but it will be used on most other systems. Please use it with caution.

-L

For outdated options, use "- allow-leading-dots" instead.

-jigdo-jigdo jigdo_file

Generate an jigdo.jigdo metadata file and a file system image.

-jigdo-template template_file

Generate an jigdo.template metadata file and a file system image.

-jigdo-min-file-size size

Specifies the minimum size of the files to be listed in the .jigdo file. The default value (and minimum allowable value) is 1KB.

-jigdo-force-md5 path

Specifies the file mode, where the file must be included in the externally-sup-plied MD5 list provided by "- md5-list".

-jigdo-exclude path

Specify a file mode that is no longer listed in ".jigdo"

-jigdo-map path

Specify a schema mapping for the jigdo file, such as "Debian=/mirror/debian"

-md5-list md5_file

Specify a file that lists the MD5sum, size, and pathname of the files included in the list of ".jigdo" files.

-jigdo-template-compress algorithm

Specifies the compression algorithm currently supported by the templates date.gzip and bzip 2, and the default is gzip.

-log-file log_file

Redirect all errors, warnings, and informational messages to log_file instead of standard error

-m glob

Files that match the shell wildcard pattern glob are excluded from CD-ROM. The blob may match the file name component or the full pathname. This option can be used multiple times. For example, "genisoimage-o rom-m'* .o'- m core-m foobar" excludes all files ending with ".o" or files named core or foobar from image.

-exclude-list file

The file that contains the list of shell wildcards to exclude

-max-iso9660-filenames

ISO 9660 file names are allowed to be up to 37 characters long. This option enables-N because the additional namespaces are extracted from the space reserved for the file version number. This violates the ISO 9660 standard, but it happens to apply to many systems. Although qualified applications need to provide buffer space of at least 37 characters, CDs created with this option may cause buffer overflows in the reading operating system. Use with great care

-M path

-M device

-dev device

Specifies the path to the existing ISO 9660 image to merge. The other form uses the SCSI device specifier, which uses the same syntax as "dev= parameter". The output of genisoImage will be a new session, which should be written to the end of the image specified in-M, which usually requires the multi-session feature for the CD logger. This option can only be used with-C.

-N

Omit the version from the ISO 9660 file name. This violates the iso 9660 standard, but no one really uses the version number.

-new-dir-mode mode

Specifies the mode to use when creating a new directory in the file system image, with a default value of 0555.

-nobak

-no-bak

Exclude backup files on the ISO 9660 file system; that is, contain the characters "~" or "#" or file names ending in .bak. These files are usually backup files for Unix text editors.

-force-rr

Do not automatically identify the Rock Ridge attribute of a previous session. This can solve the problem of image created by Nero Burning ROM

-no-rr

Do not use the RockRidge property from the previous session. This may help avoid problems that occur when genisoImage discovers an illegal RockRidge signature on an old session.

-no-split-symlink-components

Instead of splitting symbolic link components, start a new contiguous area (CE). This may waste some space, but the SunOS 4.1.4 and Solaris 2.5.1 CDROM drivers have errors in reading split symbolic link fields (aplink 'can be deleted).

-no-split-symlink-fields

Instead of splitting the symbolic link field, start a new contiguous area (CE). This may waste some space, but the SunOS 4.1.4 and Solaris 2.5.1 CDROM drivers have an error in reading split symbolic link fields (aplink 'can be deleted).

-o filename

Specifies the output file of the iso 9660 file system image. This can be a disk file, a tape drive, or it directly corresponds to the device name of the CD writer. If not specified, stdout is used. Note that the output can also be a block device for regular disk partitions, in which case iso 9660 can be used. You can install the file system normally to verify that the file system was generated correctly.

-pad

Populate the end of the entire image with 150 sectors (300 KB). This option is enabled by default. If used with-B, insert padding between the ISO 9660 partition and the boot partition so that the first boot partition starts with a sector number of 16. When many operating systems, such as Linux, implement readahead errors in their filesystem IBG O, they need to be populated. These errors can result in read errors for files located near the end of the track, especially if the disk is written on a track in primary mode, or if the CD audio track follows the data track.

-no-pad

Do not populate the end part with 150 sectors (300 KB), and do not cause the boot partition to start in multiples of 16 sectors.

-path-list file

A file that contains the path specification directory and a list of file names to add to the ISO 9660 file system. This list of path specifications is processed after any path specifications that appear on the command line. If the parameter is "-", the list is read from standard input.

-P

For outdated operations, refer to "- publisher"

-publisher publisher_id

Specifies the text string to write to the volume header. This should describe the publisher of the CD-ROM, usually with an email address and phone number. There is a space of 128 characters. Equivalent to PUBL in the ".genisoImagerc" file.

-p preparer_id

Specifies the text string to write to the volume header. This should describe the publisher of the CD-ROM, usually with an email address and phone number. There is a space of 128 characters. Equivalent to PREP in the ".genisoImagerc" file.

-print-size

Prints the estimated file system size in multiples of the sector size (2048 bytes) and exits. This option is required by the disk in primary mode, and in some cd-R drives, you need to know the size of the file system image in advance when the pipe pipe enters the wodim. Older versions of mKisofs write this information (and other information) to stderr. Since this is difficult to parse, there is no other information about the number. If you want to write a simple shell script, redirect stderr and capture numbers from stdout. For example, the following actions

Cdblocks=' genisoimage-print-size-quiet.'

Genisoimage... | wodim... Tsize=$ {cdblocks} s-

-quiet

Silent mode, with only a small amount of output.

-R

Use the Rock Ridge protocol to generate SUSP and RR records to further describe the files on the ISO 9660 file system.

-r

This is similar to the-R option, but the file ownership and mode are set to more useful values. Uid and gid are set to zero because they are usually useful only in the author's system and not on the client. All file read bits are set to true so that files and directories are globally readable on the client. If any execution bits are set for the file, all execution bits are set so that the executable can be executed globally on the client. If any search bits are set for a directory, all search bits are set so that the directory can be searched globally on the client. All write bits will be cleared because in any case the file system will be mounted read-only. If any special mode bits are set, clear them because the file lock is useless on the read-only file system, and uid 0 or gid 0 does not need to set the id bit. When used on Win 32, the execution bit is set for all files. This is the result of a lack of file permissions in the Win 32 and CygwinPOSIX emulation layers.

-relaxed-filenames

Allows ISO 9660 filenames to contain all 7-bit ASCII characters except lowercase letters. This violates the ISO 9660 standard, but it happens to apply to many systems. Use with caution

-root dir

This option is required when writing a multisession image, and the last (or even earlier) session was written in-root dir. Using a directory name that could not be found in the previous session will result in an incorrect termination of genisoImage. Without this option, genisoImage will not be able to find unmodified files and will be forced to write their data to the image again. -root and-old-root will be used together for incremental backups.

-old-root dir

-root and-old-root are used for incremental backups together. The initial session will use "genisoimage-root backup_1 dirs", and the next time you use "genisoimage-root backup_2-old-root backup_1 dirs", you will take another snapshot of these directories. The first snapshot will be found in backup_1 and the second snapshot will be found in backup_2, but only the modified or new files need to be written to the second session. If these options are not available, the new file is added and the old file is retained. But if the file is modified, the old file will be overwritten. Restoring files by copying the entire directory from CD also restores files that are intentionally deleted. Accessing several older versions of a file requires operating system support to choose which sessions to mount.

-sort sort_file

Sort the file locations on the media. Sorting is controlled by a file that contains a weighted pair of file names and sort offsets. If the weight is high, the file will be located closer to the beginning of the media, and if the weight is lower, the file will be located closer to the end of the media. There must be only one space or tab between the file name and the weight, and the weight must be the last character in the line. The file name is considered to contain all the above characters, but does not include the last space or tab. This is to allow the space character to be at the end of the file name. This option does not sort the order of file names in the ISO 9660 directory. It sorts the order in which file data is written to the CD image, which is useful for optimizing the layout of data on CD.

-sparc-boot img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e

Refer to "- B"

-sparc-label label

Sets the Sun disk label signature for the Sun disk label created with "- sparc-boot".

-split-output

Split the output image into several files, each about 1GB. This helps create DVD-sized ISO 9660 images on operating systems that do not support large files. If you are writing to DVD, wodim connects multiple files into a single track. For the "- split-output" output to work, you must specify a-o file name. The resulting output image will be named: filename_00,filename_01,filename_02.

-stream-media-size #

Select the stream operation and set the media size to # sector. This allows you to feed the output of the tar (1) program to genisoImage and create an ISO 9660 file system without the need for an intermediate tar archive file. If this option is specified, genisoImage reads from stdin and creates a file called STREAM.IMG. The maximum size of the file (with padding) is 200 sectors larger than the specified media size. If "- no-pad" is specified, the file size is 50 sectors larger than the specified media size. If the file is small, genisoImage writes the padding. This may take a while. The option streaming size only creates a simple ISO 9660 file system and cannot be used with multi-session or mixed file system options.

-stream-file-name name

Keep

-sunx86-boot UFS_img,AUX1_img

Specifies that a comma-separated list of file system images required to boot CD is made for the Solaris x86 system. Note that partition 1 is for the iso 9660 image, and partition 2 is the entire disk, so partition 1 and partition 2 cannot be used by external partition data. The first image file is mapped to partition 0. There may be empty fields in the comma-separated list, and the list entries for partitions 1 and 2 must be empty. The maximum number of partitions supported is 8 (although the Solaris x 86 partition table can support up to 16 partitions), so it is not possible to specify more than 6 partition images. This option is required to make a bootable CD for Solaris x 86 systems.

If "- sunx86-boot" is specified, the first sector of the resulting image will contain a PC fdisk label with a Solaris type 0x82 fdisk partition, starting at offset 512, covering the entire cd. In addition, for Solaris type 0x82 fdisk partitions, there is a SVR 4 disk label at offset 1024 in the first sector of the CD. Specify slice 0 for the first file system image (usually of type UFS) used to boot PC and slice 1 for the ISO 9660 image. Film 2 spans the whole CD, film 3. Slice 7 can be used for other file system images specified using this option.

The Solaris x86 boot CD uses a 1024-byte master boot, which uses ElTorito to not emulate boot mode, as well as a second generic boot in cd sector 1x15.

-sunx86-label label

Set the svr 4 disk label signature for the svr 4 disk label created with-sunx86-boot.

-sysid ID

Specifies the system ID. There is a space of 32 characters. Equivalent to SYSI in the ".genisoImagerc" file.

-T

Generate a TRANS.TBL file in each directory on CD-ROM, which can be used on non-Rock Ridge systems to help establish the correct file name. There is also information in the file that indicates primary and secondary numbers for blocks and character devices, and each symbolic link has the name of a given linked file.

-table-name table_name

Replace the translation table file name (see above). If you want to create a multi-session image, you must use the same name as the previous session.

-ucs-level level

Set the Unicode conformance level in JolietSVD. The default level is 3. You can use this option to set it to 1: 3.

-udf

UDF file system support is included in the generated file system image. UDF support is currently in the alpha state, so you cannot create an UDF-only image. The UDF data structure is currently coupled to the Joliet structure, so the current implementation has many defects. There is no UID/GID support, no POSIX permission support, and no support for symbolic links. Note that in addition to the space required for the real UDF data structure, UDF wastes space from sectors 20 to 256 at the beginning of the disk.

-uid uid

Rewrite the uid that will be read from the source file. Specifying this option automatically enables the RockRidge extension

-use-fileversion

The-use-fileversion option allows genisoImage to use the file version number in the file system. If this option is not specified, genisoImage creates a version number of 1 for all files. The file version is a string in Fan; 1 string within 32767; this option is the default option on VMS.

-U

Allowing "untranslated" file names is a complete violation of the ISO 9660 standard described above. The following flags are allowed:-d-l-N-allow-leading-dots-relaxed-filenames-allow-lowercase-allow-multidot-no-iso-translate. Allow multiple "." in the file name. Characters, as well as mixed case file names, which are useful on HP-UX because the built-in CDF file system does not recognize any extensions. Be extra careful when using it.

-no-iso-translate

Do not translate invalid characters "#" and "~" in ISO 9660 file names. Although these characters are not valid, they are often used by Microsoft systems. This violates the ISO 9660 standard, but it happens to apply to many systems. Use with caution

-V volid

Specifies the volume ID (volume name or label) to write to the master block. There is a space of 32 characters. Equivalent to VOLI in the ".genisoImagerc" file. The volume ID is used by the Solaris volume manager as the mount point and as the label assigned to the CD.

-volset ID

Specifies the volume set ID. There is a space of 128 characters. Equivalent to VOLS in the ".genisoImagerc" file

-volset-size #

Set the volume set size to #. The volume set size is the number of CD in the CD volume set. A volume set is a collection of one or more volumes in which a set of files is recorded. Volume sets are not intended to be used to create a set of CD numbered CD, such as operating system installation CD sets. Volume sets are used to record large directory trees that are not suitable for a single volume. Each volume of a volume set contains files for all directories and files recorded on a volume whose serial number is less than or equal to the specified volume set size of the current volume.

GenisoImage currently does not support-volset-size greater than 1. The option-volset-size must be specified before-volset-seqno on each command line.

-volset-seqno #

Set the volume set serial number to #. The volume set serial number is the index number of the current cd in the cd set. The option-volset-size must be specified before-volset-seqno on each command line.

-v

Lengthy execution. If given twice on the command line, additional debugging information is printed.

-x glob

Same as-m glob

-z

Generate special RRIP records for transparently compressed files. This is just the purpose and interest of hosts that support transparent decompression, such as Linux 2.4.14 or later. You must specify-R or-r to enable Rock Ridge and use the mkzftree utility to generate compressed files before running genisoImage. Note that transparent compression is a non-standard Rock Ridge extension. The resulting disk can only be read transparently on the Linux. On other operating systems, you need to manually call mkzftree to extract the file.

HFS option

-hfs

Create an ISO 9660/HFS hybrid CD. This option should be used in conjunction with-map,-magic, or the following double dash options.

-apple

Create an ISO 9660 CD with Apple extensions. Similar to-hfs, but with the addition of an Apple extension to ISO 9660 instead of creating a HFS hybrid volume. Previous versions of genisoImage included the Rock Ridge attribute by default, if "- apple" was specified. This version of genisoImage no longer does this. If you want to have the RockRidge property, you need to specify this property separately.

-map mapping_file

Use the mapping file to set the creator of the file based on the extension of the file name and type information about the file. The file name is mapped only if it is not in a known Apple/Unix file format. See the HFS CREATOR/TYPE section below.

-magic magic_file

The creator and type information is set by using the magic number of the file (usually the first few bytes of the file). Magic_file is used only if the file is not in a known Apple/unix file format, or if the file extension has not been used with the-map mapping.

-hfs-creator creator

Sets the default creator for all files. It must be four characters. See HFSCREATOR/TYPE.

-hfs-type type

Sets the default type for all files. Must be exactly 4 characters. See HFSCREATOR/TYPE.

-probe

Search for the contents of all known Apple/Unix file formats. However, the only way to detect MacBinary and AppleSingle files is to open and read them, so this option may increase processing time. If you know the Apple/Unix format you are using, it is best to use the options given below

-no-desktop

Do not create (empty) desktop files. When you use CD on Macintosh, a new hfs desktop file is created. By default, empty desktop files are added to the hfs volume.

-mac-name

Use the HFS file name as the starting point for ISO 9660, Joliet, and Rock Ridge file names. For more information, see the HFS Macintosh filename section below.

-boot-hfs-file driver_file

Install the driver file so that CD can be started on Macintosh.

-part

Generate a HFS partition table. By default, partition tables are not generated, but some older macintosh CD-ROM drivers require hfs partition tables on CD-ROM to recognize mixed CD-ROM.

-auto AutoStart_file

Let HFS CD use the QuickTime2.0 auto-start feature to start the application or document. The given file name must be the name of the document or application at the top of the CD. The file name must be less than 12 characters.

-cluster-size size

Sets the size of the cluster or allocation unit of the PC Exchange file in bytes.

-hide-hfs glob

Hide the shell wildcard mode GLOB in the HFS volume. The file or directory still exists in the iso 9660 and / or Joliet directories. The GLOB may match any part of the file name. Multiple globals can be excluded. For example, commands

Genisoimage-o rom-hfs-hide-hfs'* .o'- hide-hfs foobar

All files ending in ".o" or called foobar will be excluded from the HFS volume. Note that if you have a directory called foobar, it (and, of course, all its descendants) will be excluded. GLOB can also be a pathname relative to a given source directory on the command line, for example

Only files or directories named html are excluded from the src directory. Any other file or directory named html in the tree will not be excluded. Should be used with "- hide" or "- hide-joliet". To match the directory name, make sure that the pattern does not contain trailing "/" characters.

-hide-hfs-list file

Specify a file that contains a list of wildcard patterns to hide, as shown in "- hide-hfs".

-hfs-volid hfs_volid

The volume name of the HFS partition. This is the name assigned to the disk on macintosh and replaces the volid used with-V.

-icon-position

If there is icon location information, use it. The icon appears in the same location as the Macintosh desktop. The location and size of the folder on the screen, the scrolling position, and the folder view (icons, small icons, etc.) are also preserved.

-root-info file

Set the location, on-screen size, scroll position, folder view, and so on, for the root folder of the HFS volume.

-prep-boot file

Prepare the boot image file. Up to 4 times allowed

-chrp-boot

Add CHRP seeker

-input-hfs-charset charset

Enter a character set that defines the characters used in the hfs file name when used with "- mac-name". The default character set is cp 10000

-output-hfs-charset charset

The output character set that defines the characters that will be used in the HFS file name. Default input character set

-hfs-unlock

By default, genisoImage creates a locked hfs volume. This option keeps the volume unlocked so that other applications, such as hfsutils, can modify the volume.

-hfs-bless folder_name

"Bless" specifies the directory (folder). This is usually the system folder used to create a HFS bootable CD. The name of the directory must be the entire pathname seen by genisoImage. For example, if the given path specification is ". / cddata" and the required folder is called the system folder, the entire path name is the "/ cddata/system" folder (remember to use quotation marks if the name contains spaces).

-hfs-parms parameters

Override some of the parameters used to create the HFS file system. It is unlikely to be used under normal circumstances.

-- cap

Find the AUFS CAP Macintosh file. Search only the CAP Apple/Unix file format. Searching for other possible Apple/Unix file formats will be disabled unless other "- -" options are given

-- netatalk

Find the NETATALK Macintosh file

-- double

Find the AppleDouble Macintosh file

-- ethershare

Find the Helios EtherShare Macintosh file

-- ushare

Find the IPT UShare Macintosh file

-- exchange

Find the PC Exchange Macintosh file

-- sgi

Find the SGI Macintosh file

-- xinet

Find the XINET Macintosh file

-- macbin

Find the MacBinary Macintosh file

-- single

Find the AppleSingle Macintosh file

-- dave

Find the Thursby Software Systems DAVE Macintosh file

-- sfm

Find the Microsoft's Services for Macintosh file

-- osx-double

Find the Mac OS X AppleDouble Macintosh file

-- osx-hfs

Find the Mac OS X HFS Macintosh file

3. Character set

GenisoImage processes the file name as an 8-bit character string in a POSIX-compliant manner. To represent all encodings in all languages, 8-bit characters are not enough. Unicode or Iso-10646 defines character encodings that require at least 21 bits to represent all known languages. They can be represented in utf-32, utf-16, or utf-8 coding. Utf-32 uses a normal 32-bit encoding, but it doesn't seem to be common. Microsoft uses utf- 16:00 and win 32, with the disadvantage that 16-bit characters do not conform to the POSIX file system interface.

Modern unix operating systems can use utf-8 encoding for file names. Each 32-bit character is represented by one or more 8-bit characters. If a character is encoded with iso-8859-1 (used in Central Europe and North America), it maps to a utf-32 or utf-16-encoded Unicode character at 1:1. If a character is encoded in 7-bit asci (in the United States and other countries with limited character sets), it will map to UTF-32, UTF-16, or UTF-8-encoded Unicode characters at 1:1. Character codes that cannot be represented by a single byte in UTF-8 (if the value is greater than 0x7F) use escape sequences, which map to multiple 8-bit characters.

If all operating systems use utf-8,genisoImage, there will be no need to re-encode characters in the file name. Unfortunately, Apple uses completely non-standard encoding, while microsoft uses unicode encoding that is not compatible with the POSIX filename interface. For all operating systems that are not utf-8 encoded, the actual characters represented by each byte depend on the character set or code page used by the local operating system (the name used by microsoft). The characters in the character set will reflect the user's regional or natural language set. Usually the character code 0x00-0x1f is a control character, the code 0x20-0x7f is a 7-bit ASCII character, and (on PC and Mac) 0x80-0xff is used for other characters.

Since there are more than 256 characters / symbols in use, only one subset is represented in one character set. Therefore, the same character code can represent different characters in different character sets. As a result, filenames generated in Central Europe may not display the same characters when viewed on machines in Eastern Europe. To make things more complicated, different operating systems use different character sets for regions or languages. For example, the character code for'é'(small e with a sharp accent) can be the character code 0x82 on PC, the code 0x8e on Macintosh, the code 0xe9 on Western European Unix systems, and the code 0x000e9 in Unicode.

As long as not all operating systems and applications use the same character set as the basis for the file name, you may need to specify the character set used in the file name and the character set that the file name should display on the CD. There are four options to specify the character set to use:

1)-input-charset. Define the local character set you use on the host. Any character set conversion that occurs will use this character set as a starting point. The default input character set is cp 437 on MS-DOS-based systems and iso 8859-1 on all other systems. Given-j, the unicode equivalent of the input character set will be used in the joliet directory. The "- jcharset" option is the same as the "- input-charset-J" option.

2)-output-charset. Defines the character set used for Rock Ridge names on CD. The default is the input character set.

3)-input-hfs-charset. Defines the HFS character set for HFS file names that are decoded from various Apple/Unix file formats. Useful only when used with "- mac-name".

4)-output-hfs-charset. Defines the hfs character set used to create hfs file names from the input character set you are using. In most cases, this will come from the character set specified by the "- input-charset" option. The default is the input hfs character set.

There are many character sets built into genisoImage. For a list, use the input character set help. This list does not include character sets derived from the current locale if genisoImage is built using iconv support. You can read other character sets from files with any character set option by taking the file name as an argument to the option. The given file is read only if the name of the file does not match one of the built-in character sets.

The format of the character set file is the same as the mapping file provided by http://www.unicode.org/Public/MAPPINGS". The format is as follows:

Column # 1 is the input byte code (in hex as 0xXX)

Column # 2 is the Unicode (in hex as 0xXXXX)

The rest of the line is ignored.

Any blank lines, lines without two (or more) columns in the above format, or comment lines (starting with the # character) are ignored without any warning. Any missing input code is mapped to the Unicode character 0x0000.

Note that while UTF-8 is supported, other Unicode encodings, such as UCS-2/UTF-16 and UCS-4/UTF-32, are not supported because the POSIX operating system cannot handle them locally. The 1:1 character set mapping can be defined by using keyword defaults as parameters to any character set option. Iso 9660 file names generated from input file names are not converted from the input character set. The iso 9660 character set is a very limited subset of ASCII characters, so any conversion is meaningless. Any characters that cannot be converted will be replaced by the "_" character.

4. HFS CREATOR/TYPE (creator and type)

Macintosh files have two properties related to them, which define the creator and file type that created the file. Both are (fully) 4-letter strings. Typically, this allows Macintosh users to double-click the file and launch the correct application, and so on. You can find the creator and type of a particular file by using a method such as ResEdit (or similar) on Macintosh.

Creator and type information is stored in all Apple/Unix-encoded files. For other files, you can use the file's mapping file (with-map) or the file's magic number (usually the signature in the first few bytes) as the basis for the creator and input file extension. If both options are given, their order on the command line is valid. If "- map" is given first, try to match the file extension before the magic number match. However, if "- magic" is given first, a magic number match is attempted before the file extension matches.

If no mapping or magic file is used, or no match is found, you can set the default creator and type of all regular files by using an entry in the ".genisoImagerc" file or by using "- hfs-creator" or "- hfs-type," otherwise the default creator and type are Unix and Text.

The format of the mapping file is the same as the afpfile format used by aufs. The file has five columns for extensions, file conversions, creators, types, and comments. Lines that begin with the "#" character are comment lines and are ignored. Here is an example

# Example filename mapping file

#

# EXTN XLate CREATOR TYPE Comment

.tif Raw '8BIM' TIFF' "Photoshop TIFF image"

.hqx Ascii 'BnHq'' TEXT' "BinHex file"

.doc Raw 'MSWD'' WDBN' "Word file"

.mov Raw 'TVOD'' MooV' "QuickTime Movie"

* Ascii 'ttxt'' TEXT' "Text file"

The first column, EXTN, defines the Unix file name extension to map, and the default mapping for any mismatched file name extension is defined as the "*" character. The second column, Xate, which defines the type of text conversion between Unix and Macintosh files, is ignored by genisoImage but is compatible with aufs (1). Although genisoImage does not change the contents of the file, if the type of the binary file is set to text, it may be read incorrectly on the Macintosh. Therefore, a better choice for the default type may be "?" . The CREATOR and TYPE keywords must be 4 characters long and enclosed in single quotation marks. The comment field is enclosed in double quotation marks-it is ignored by genisoImage but is compatible with aufs.

The format of magic files is almost the same as the magic (5) file format used by the file (1) command. The file has offset, type, test, and message columns separated by four-byte tabs. Lines that begin with the'# 'character are comment lines and are ignored. A sample file would look like this:

# Example magic file

#

# off type test message

0 string GIF8 8BIM GIFf GIF image

0 beshort 0xffd8 8BIM JPEG image data

0 string SIT! SIT! SIT! StuffIt Archive

0 string\ 037\ 235 LZIV ZIVU standard Unix compress

0 string\ 037\ 213 GNUz ZIVU gzip compressed data

0 string! ASPS TEXT Postscript

0 string\ 004%! ASPS TEXT PC Postscript with a ^ D to start

4 string moov txtt MooV QuickTime movie file (moov)

4 string mdat txtt MooV QuickTime movie file (mdat)

The format of the file is described in magic (5). The only difference here is that for each entry in the magic file, the initial offset of the message must be a 4-character CREATOR, followed by a 4-character TYPE, with optional spaces. Any other characters on this line will be ignored. The extension line (starting with'>') is also ignored, that is, only the initial offset line is used.

Using "- magic" can significantly increase processing time because each file must be opened and read to find its magic number.

In summary, for all files, the default creator is Unix and the default type is TEXT. These can be changed by using entries in the ".genisoImagerc" file or by using the "- hfs-creator" or "- hfs-type" options. If the file is in one of the known Apple/Unix formats (and that format has been selected), the creator and type are extracted from the values stored in the Apple/Unix file. The creators and types of other files can be set by their file extension (- map) or their magic number (- magic). If a default match is used in the mapping file, these values override the default creator and type.

5. HFS MACINTOSH FILE FORMATS (file format)

The Macintosh file has two parts, called the data and resource forks. Both could be empty. Unix (and many other open source software) can only handle files that are partial (or bifurcated). In addition, macintosh files have many attributes related to them-perhaps the most important are the type and creator. Again, unix has no idea of these types of properties. For example, a Macintosh file can be a JPEG image, where the image is stored in the data fork and the desktop thumbnail is stored in the resource fork. The information in the data bifurcation is usually useful across platforms. Therefore, to store Macintosh files on the Unix file system, you must find a way to handle the two bifurcations and additional attributes (called Finder info). Unfortunately, it seems that every package that stores Macintosh files on Unix chooses a completely different storage method. The Apple/Unix formats supported by genisoImage (part) are as follows:

CAP AUFS format . Data is stored in files and resources are stored in subdirectories. Resources and data have the same file name

AppleDouble/Netatalk . Data is stored in a file. Resources are stored in a file prefixed with'%', and finder information is stored in the same'% 'file

AppleSingle . The data structure is similar to the one above, except that the bifurcation and Finder information are stored in one file.

Helios EtherShare . Where the data is stored in the file, the resource and finder information are stored together in the subdirectory .rsrc, with the same file name as the data.

IPT UShare . Similar to EtherShare format, but Finder information is stored slightly differently

MacBinary . Bifurcation and finder information are stored in a single file.

Apple PC Exchange . Macintoshes stores Apple files on DOS (FAT) disk. The data fork is stored in the file. Resource forks are stored in the subdirectory Resoure.frk (or RESOURCE.FRK). Finder info is used as a record in the file finder.dat (or FINDER.DAT). Separate the finder.dat for each data fork directory. Note: genisoImage needs to know the native fat cluster size of the disk where the pc Exchange file is located (or copied from it). This size is determined by "- cluster-size". Use the DOS utility chkdsk to find the cluster or assign the size.

SGI/XINET . SGI machines are used when installing HFS disks. Bifurcations of data stored in a file. The resource fork in the .hsResources subdirectory with the same file name .finder info as a record in the file.

Thursby Software Systems DAVE . Allow Macintoshes to store Apple files on a SMB server. Bifurcations of data stored in a file. Use AppleDouble format to store resource forks.

GenisoImage will attempt to set the creator, type, date, and other possible flags from the finder information. In addition, if present, set the macintosh file name from finder info, otherwise the macintosh name is based on the unix file name

Services for Macintosh . The file format that the NT server stores on the NTFS file system. The data fork is stored as a file name. The resource fork is stored as a NTFS stream named filename:afp_Resource. The lookup information is stored as a NTFS stream named filename:AFP_AfpInfo. NTFS circulation is often invisible to users. Note: genisoImage only partially supports the SFM format. If an HFS file or folder stored on a NT server contains illegal NT characters in its name, NT converts those characters to private use Unicode characters. These characters are: "* /?\ and spaces or periods (0x01 to 0x1f if it is the last character of the file name). (control characters) and Apple's Apple logo. Unfortunately, these private Unicode characters cannot be read by the genisoImageNT executable. Therefore, any file or directory name that contains these characters will be ignored-including the contents of any such directory.

Mac OS X AppleDouble . When MacOSX copies or saves HFS/HFS files to a non-HFS file system (for example, UFS, NFS, and so on), the files are saved in AppleDouble format. A resource fork stored in a file with the same name starting with ". _". Finder information is also stored in the same ". _" file.

Mac OS X HFS (Alpha). It's actually not Apple/Unix encoding, but the actual HFS/HFS file on the MacOSX system. Bifurcations of data stored in a file. The resource fork is stored in a pseudo file with the same name and suffix / rsrc. It works only if it is used on MacOSX. If a file is found to have zero-length resource bifurcations and empty finderinfo, it is assumed that it does not have any Apple/Unix encoding, so you can use other methods to set the type and creator.

GenisoImage will attempt to set the creator, type, date, and other possible flags from the finder information. In addition, if present, set the macintosh file name from finder info, otherwise the macintosh name is based on the unix file name.

When using "- apple", the type and creator are stored in the optional system use or SUSP field in the ISO 9660 catalog record, much like the Rock Ridge property. In fact, to simplify life, an Apple extension is added at the beginning of the existing Rock Ridge attribute (that is, to get the Apple extension, you can also get the Rock Ridge extension). The Apple extension requires that the resource fork be stored as a file associated with ISO 9660. This is like any ordinary file stored in the ISO 9660 file system, except that the associated file flag is set in the directory record (bit 2). This file has the same name as the data fork (a file seen by a non-Apple computer). Related files are usually ignored by other operating systems.

When using "- hfs", the type and creator and other finder information are stored in separate HFS directories and are not visible in ISO 9660 volumes. The HFS directory references the same data and resource fork files mentioned above. In most cases, it is best to use "- hfs" rather than "- apple", because the latter uses limited ISO 9660 characters in the file name. However, the Apple extension does provide the advantage that files are packaged to disk more efficiently and more files may be installed on CD

6 、 HFS MACINTOSH FILENAMES

Where possible, the HFS file name stored in the Apple/Unix file is used for the HFS part of the CD. However, not all Apple/Unix encodings use finderinfo to store HFS file names. In these cases, use the Unix file name-a special character with escape. Special characters include'/ 'and characters with codes greater than 127. AUFS uses':'to escape these characters, followed by character codes as two hexadecimal digits. Netatalk and EtherShare have a similar scheme, but use'% 'instead of':'. If genisoImage cannot find the HFS file name, use the Unix name to convert any "% xx" or ": xx" characters (xx is two hexadecimal digits) to a single character code. If the xx is not a hexadecimal number ([0-9a-FA-F]), they are retained separately-although the rest of the ":" is converted to "%" because ":" is the hfs directory delimiter. Care must be taken, because ordinary Unix files with "% xx" or ": xx" will also be converted. For example, the following example

This:2fFile converted to This/File

This:File converted to This%File

This:t7File converted to This%t7File

Although HFS filenames seem to support uppercase and lowercase letters, the file system is case-insensitive, that is, the filenames AbC and aBC are the same. If a file is found in a directory with the same HFS name, genisoImage attempts to create a unique name by adding the "_" character to one of the file names. If the file has a HFS filename, genisoImage can use the "- mac-name" option to make this name the starting point for ISO 9660, Joliet, and Rock Ridge filenames. Normal Unix files without HFS names will still use their Unix names.

If on a unix system, the binary storage name of a mac is someimage.gif.bin, but there is also a file named someimage.gif in the system, then that name will appear in the HFS section of the CD. However, because genisoImage uses the Unix name as the starting point for other names, the resulting ISO 9660 name may be SOMEIMAG.BIN,Joliet/Rock Ridge will be so-and-so Image.gif.bin. This option uses the HFS file name as the starting point, ISO 9660 name may be SOMEIMAG.GIF, and Joliet/Rock Ridge may be some Image.gif.

"- mac-name" cannot currently be used with "- T". The Unix name will be used in the TRANS.TBL file instead of the Macintosh name.

The character set used to convert any HFS file name to Joliet/Rock Ridge file name defaults to cp 10000 (Mac Roman). The character set you can use is "- input-hfs-charset." Option is specified. Other built-in character sets in the HFS character set are: cp 10006 (Mac Greek), cp 10007 (MacCyrilic), cp 10029 (MacLatin 2), cp 10079 (Mac Iceland and andic), and cp 10081 (Mac Turkish). Note: character codes used for HFS filenames extracted from various Apple/Unix formats will not be converted because they are assumed to be in the correct Apple character set. Only Joliet/Rock Ridge names derived from HFS file names are converted.

Existing genisoImage code will filter out any illegal characters from ISO 9660 and Joliet file names, but as genisoImage is expected to handle Unix names directly, it will retain the name of Rock Ridge. But "/" is a valid HFS filename character, and the "- mac-name" option converts "/" to "_" in the Rock Ridge filename.

If you use the Apple extension, only the ISO 9660 file name is displayed on Macintosh. However, because MacintoshISO 9660 drivers can use level 2 filenames, you can use options like "- allow-multidot", which is fine on Macintosh. However, you should still pay attention to the name, for example, "this.file.name" will be converted to "THIS.FILE", that is, there is only one'. "you can also think of the file name" abcdefgh "as" ABCDEFGH ", but" abcdefghi "will be regarded as" ABCDEFGHI. " That is to say, there is a "." I don't know if this is a Macintosh problem or a genisoImage/mk mixed problem. When viewing on Macintosh, all file names are capitalized. Of course, the DOS/Win3.X machine will not be able to see the secondary file name.

7 、 HFS CUSTOM VOLUME/FOLDER ICONS

To provide a custom icon for HFS CD, make sure that the root (top-level) folder contains a standard Macintosh volume icon file. To provide a custom icon for a volume on Macintosh, you must paste an icon to the volume icon in the get Information box of the volume. This creates an invisible file named "Icon\ r" ('\ r'is the carriage return character) in the root folder. The custom folder icon is very similar, and the folder itself has an invisible file named "Icon\ r".

Perhaps the easiest way to create a custom icon that genisoImage can use is to format a blank HFS floppy disk on Mac and paste the icon into its GET Info box. If you are using linux with the hfs module installed, mount the floppy disk: "mount-t hfs / dev/fd0 / mnt/floppy". By default, floppy disks are mounted as CAP file systems. Then run genisoImage with the following: "genisoimage-- cap-o output source_dir / mnt/floppy".

If you do not use Linux, you can use hfsutils to copy the icon file from the floppy disk. However, care must be taken because the icon file contains a control character. For example:

Hmount / dev/fd0

Hdir-a

Hcopy-m Icon ^ V ^ M icon_dir/ico

Where'^ V ^ M'is "ctrl+v", followed by the control "ctrl+m". Then run genisoimage as follows: "genisoimage-- macbin-o output source_dir icon_dir"

The process of creating / using a custom folder icon is very similar-paste the icon into the "Get Info" box of the folder and transfer the resulting "Icon\ r" file to the relevant directory in the genisoImage source tree. You may need to hide the icon file in the iso 9660 and Joliet trees.

8 、 HFS BOOT DRIVER

Hybrid CD can be started on Macintosh. Bootable HFS CD requires an AppleCD-ROM (or compatible) driver, a bootable HFS partition, and necessary system, Finder, and other files. Using the Apple_Driver utility, drivers can be obtained from any other Macintosh bootable CD-ROM. This file can then be used with "- boot-hfs-file". The HFS partition (in this case, a hybrid disk) must contain an appropriate system folder, also from another CD or disk.

For a partition to be bootable, its boot block must be set. The boot block is located in the first two blocks of the partition. For non-bootable partitions, the boot block is full of zeros. Typically, when system files are copied to a partition on a Macintosh disk, the boot block is populated with many necessary settings. Therefore, the utility Apple_Driver also extracts the boot block from the first hfs partition it finds on the given cd-ROM, which is used for the hfs partition created by genisoImage.

Please note that by using the driver from Apple CD and copying the Apple software to your CD, you will easily obey Apple Computer,Inc. Software license agreement.

9 、 EL TORITO BOOT INFORMATION TABLE

When "- boot-info-table" is given, genisoImage modifies the boot file specified by-b by inserting a 56-byte boot information table at the offset 8 of the file. This modification is done in the source file system, so if the file is not easy to recreate, be sure to use a copy! This file contains pointers that may not be easily or reliably obtained at startup. The format of this table is as follows; all integers are in 7.3.1 ("Little Endian") format:

Offset Name Size Meaning

8 bi_pvd 4 bytes LBA of primary volume descriptor

12 bi_file 4 bytes LBA of boot file

16 bi_length 4 bytes Boot file length in bytes

20 bi_csum 4 bytes 32-bit checksum

24 bi_reserved 40 bytes Reserved

The 32-bit checksum is the sum of all 32-bit words in the boot file starting with a byte offset of 64. All linear block addresses (LBA) are given in CD sectors (usually 2048 bytes).

10. HPPA description

To make a bootable CD for HPPA, you must at least specify a boot loader file (- hppa-boot-loader), a kernel image file (32-bit, 64-bit, or both, depending on hardware), and a boot command line (- hppa-cmdline). Some systems can boot a 32-bit or 64-bit kernel, and if both exist, the firmware will choose either. You can also choose to use "- hppa-cmdline" to use ramdisk on the root file system.

11. JIGDO description

Jigdo is a tool that helps distribute large files, such as cd and dvd images; see http://atterer.net/jigdo/ for more details. Debian cd and dvd iso images are published on the web in jigdo format so that end users can download them more efficiently. To create jigdo and template files next to the ISO image from genisoImage, you must first generate a list of files that will be used in the following format:

MD5sum File size Path

32 chars 12 chars to end of line

MD5sum should be written in jigdo's pseudo-BASE64 format. The file size should be decimal and the path to the file must be absolute. Once you have this file, invoke genisoImage with all the regular command-line parameters. Use "- jigdo-jigdo" and "- jigdo-Template" to specify the output file names of jigdo and template files, and use "- md5-list" to pass the location of the md5 list.

If you do not want to add some files to the jigdo file (for example, if they may change frequently), use-jigdo- to ignore specifying them. If you want to validate some files when writing them to the mirror, use "- jigdo-force-md5" to specify them. If any files do not match, genisoImage is aborted. Both options take regular expressions as input. Depending on the size, you can use the "- jigdo-min-file-size" option to limit the set of files that will be used further.

Finally, the jigdo code needs to know how to map a given file to a mirror-style configuration. Specifies how to use "- jigdo-map" to map paths. Using "debian=/mirror/debian" will cause all paths that start with "/ mirror/debian" to map to debian: in the output jigdo file.

12. Example code

1) to create a normal ISO 9660 file system image in the cd.iso file, if CD is cd.iso, the directory cd_dir will become the root directory, use the command:

% genisoimage-o cd.iso cd_dir

2) create a CD using the Rock Ridge extension of the directory cd_dir

% genisoimage-o cd.iso-R cd_dir

3) to create a CD of the RockRidge extension of the source directory cd_dir, where all files have at least read permissions, and all files are owned by root, use the command:

% genisoimage-o cd.iso-r cd_dir

4) write the tar archive directly to the CD, and the CD will contain a simple iso 9660 file system with the tar archive. Use the command:

% tar cf -. | | genisoimage-stream-media-size 333000 | wodim dev=b,t,l-dao tsize=333000s-|

5) create a HFS hybrid CD with the Joliet and Rock Ridge extensions of the source directory cd_dir

% genisoimage-o cd.iso-R-J-hfs cd_dir

6) create a HFS mixed CD from the source directory cd_dir that contains Netatalk Apple/Unix files

% genisoimage-o cd.iso-- netatalk cd_dir

7) to create a HFS mixed CD from the source directory cd_dir, simply provide all file creators and types based on the file extension listed in the file "mapping"

% genisoimage-o cd.iso-map mapping cd_dir

8) to create a CD with Apple extension to ISO 9660, you can cd_dir and another_di from the source directory. . Decode all known files in Apple/Unix format and give the creator and type of any other file according to the magic number given in the file magic.

% genisoimage-o cd.iso-apple-magic magic-probe cd_dir another_dir

9) the following example places different files on CD, all with README names, but their contents are different when they are considered ISO 9660/Rock Ridge, Joliet, or HFS CD. The current directory contains "README.hfs README.joliet README.Unix cd_dir/". The following command puts the contents of the cd_dir directory along with three README files on CD, but only one of the three file systems can be seen

% genisoimage-o cd.iso-hfs-J-r-graft-points\

-hide README.hfs-hide README.joliet\

-hide-joliet README.hfs-hide-joliet README.Unix\

-hide-hfs README.joliet-hide-hfs README.Unix\

README=README.hfs README=README.joliet\

README=README.Unix cd_dir

The file README.hfs will be treated as a README file on HFS CD, and the other two README files will be hidden. The same applies to Joliet and ISO 9660/Rock Ridge CD. Combinations of hidden options can produce a variety of strange results.

13. Description

GenisoImage can be securely installed in suid root. This may be to allow genisoImage to read the last session when creating a multisession image. If genisoImage is creating a file system image with the Rock Ridge attribute, and the directory nesting level of the source directory tree is too high for ISO 9660, genisoImage performs a deep directory relocation. This will result in a directory called RR_Move in the CD root directory. You cannot avoid this directory. Many boot code options for different platforms are mutually exclusive because boot blocks cannot coexist, that is, different platforms share the same data location in the image.

14 、 bug

Any file that does not have a hard link to a file in the tree copied to the iso 9660 file system will have an incorrect file reference count. Do not check the "." of the root directory The SUSP record in the entry to verify the existence of RockRidge enhancements. This problem occurs when reading old sessions when adding data in multi-session mode. When adding data, the relocated directory is not read correctly in multi-session mode. If the new session does not include a depth directory, any relocated depth directories will be lost. Do not reuse RR_MOVE when performing multiple sessions from TRANS.TBL. Do not create a full name entry for RR_MOVE in multi-session mode.

15 、 HFS PROBLEMS/LIMITATION

Although HFS filenames seem to support uppercase and lowercase letters, the file system is case-insensitive, that is, the filenames ABC and ABC are the same. If a file is found in a directory with the same HFS name, genisoImage attempts to create a unique name by adding the "_" character to one of the file names.

Share the first 31 characters of the HFS file / directory name with'_ N' (decimal number) instead of the last few characters to generate a unique name. Care must be taken when "grafting" Apple/Unix files or directories (see above for the methods and syntax involved). You cannot use a new name for Apple/Unix-encoded files / directories. For example, if you want to add an Apple/Unix-encoded file named oldname to CD, you cannot use the following command line:

"genisoimage-o output.raw-hfs-graft-points newname=oldname cd_dir"

GenisoImage will not be able to decode the old name. However, you can migrate Apple/unix-encoded files or directories as long as you don't try to name them as above.

When you create a HFS volume with the multi-session options-M and-C, only the files from the previous session will be on the HFS volume. That is, genisoImage cannot add existing files from previous sessions to hfs volumes. However, if each session is created with "- part", each session will appear as a separate volume when mounted on the Mac. In this case, it is worth using "- v" or-"hfs-volid" to provide a unique volume name for each session, otherwise each "volume" will appear on the desktop with the same name. Symbolic links (like all other unconventional files) are not added to the hfs directory.

Mixed volumes may be larger than pure ISO 9660 volumes that contain the same data. In some cases, such as DVD-sized volumes, the differences can be significant. As the HFS volume grows, so does the size of the allocation block (the minimum space that the file can occupy). For 650 MB CD, the allocation block is 10 kb, and for 4.7GB DVD, it is about 70 kB. The maximum number of files in a hfs volume is about 65500, but the actual limit will be slightly less.

The resulting mixed volumes can be accessed on the Unix machine using the hfsutils routine. However, when a volume is set to be locked, no changes can be made to it. This option "- hfs-unlock" will create an unlocked output image-but you shouldn't make any changes to the contents of the volume (unless you really know what you're doing), because it's not a "real" hfs volume.

"- mac-name" cannot currently be used with "- T", and the-Unix name will be used in the TRANS.TBL file instead of the Macintosh name.

Although genisoImage does not change the contents of the file, if the type of the binary file is set to "TEXT", it may be read incorrectly on the Macintosh. Therefore, a better choice for the default type may be "?" .

The "- mac-boot-file" option may not work at all. PC Exchangev2.2 or later files may not be available (MacOS8.1 is available). When using Linux, the DoS media containing PC Exchange files should be mounted as MSDOS (not vFAT). The SFM format is only partially supported. The geniso image should be able to create a hfs mixed image that exceeds 4GB, although this has not been fully tested.

16. Examples

Create an iso file

[root@localhost weijie] # mkisofs-v-o my.iso / weijie/

I:-input-charset not specified, using utf-8 (detected in locale settings)

Genisoimage 1.1.9 (Linux)

Scanning / weijie/

Scanning / weijie/wjtpflR

Writing: Initial Padblock Start Block 0

Done with: Initial Padblock Block (s) 16

Writing: Primary Volume Descriptor Start Block 16

Done with: Primary Volume Descriptor Block (s) 1

Writing: End Volume Descriptor Start Block 17

Done with: End Volume Descriptor Block (s) 1

Writing: Version block Start Block 18

Done with: Version block Block (s) 1

Writing: Path table Start Block 19

Done with: Path table Block (s) 4

Writing: Directory tree Start Block 23

Done with: Directory tree Block (s) 2

Writing: Directory tree cleanup Start Block 25

Done with: Directory tree cleanup Block (s) 0

Writing: The File (s) Start Block 25

Total translation table size: 0

Total rockridge attributes bytes: 0

Total directory bytes: 2048

Path table size (bytes): 26

Done with: The File (s) Block (s) 0

Writing: Ending Padblock Start Block 25

Done with: Ending Padblock Block (s) 150

Max brk space used 0

175 extents written (0 MB)

You have new mail in / var/spool/mail/root

[root@localhost weijie] # ls

1.c my.iso wj123.kpET wj123.oH2o4P wj234.q1C wjtpflR

[root@localhost weijie] #

Thank you for reading, the above is the content of "the usage of mkisofs command under Linux". After the study of this article, I believe you have a deeper understanding of the usage of mkisofs command under Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report