Linux mkisofs (genisoimage) command usage

Source: Internet
Author: User
Tags save file

Function Description: Establish ISO 9660 image file.
Common commands: Genisoimage-o imagename.iso file

Syntax: mkisofs [-addfhjllnrrtvz][-print-size][-quiet][-a][-abstract][-b][-biblio][-c][-c][-copyright][-hide][- Hide-joliet][-log-file][-m][-m][-o][-p][-p][-sysid][-v][-volset][-volset-size][-volset-seqno][-x [directory or file]

Additional note: Mkisofs can make the specified directory and files into an ISO 9660 format image file for burning discs.

Parameters
-A or –all mkisofs typically do not process backup files. Use this parameter to add the backup file to the image file.
-A or-APPID specifies the application ID of the disc.
-ABSTRACT Specifies the file name of the digest file.
-B or-eltorito-boot specifies the boot image file that is required to make the bootable disc.
-biblio Specifies the file name of the ISBN file, and the ISBN file is located at the root of the disc, recording the CD's ISBN.
-C when making a bootable CD, Mkisofs will make the full-eltorito-catalog of the boot image file into one file.
-C This parameter must be used when compositing a number of sections into an image file.
-copyright Specifies the file name of the copyright information file.
-D or-omit-period the period after the file is omitted.
-D or-disable-deep-relocation ISO 9660 can handle up to 8 levels of catalogs, more than 8 layers, and Rrip automatically set them to ISO 9660 compatible formats. Use the-d parameter to turn off this feature.
-F or-follow-links ignores symbolic connections.
-h displays Help.
-hide causes the specified directory or file to be hidden in the system of ISO 9660 or rock ridgeextensions.
-hide-joliet causes the specified directory or file to be hidden in the Joliet system.
-j or-joliet Use the Joliet format for directories and file names.
-L or-full-iso9660-filenames use a file name of ISO 9660 32 character length.
-L or-allow-leading-dots allows the first character of the file name to be a period.
-log-file If there is an error message during execution, the preset will be displayed on the screen.
-M or-exclude specifies that the directory or file name will not be in the room in the image file.
-M or-prev-session merge with the specified image file.
-N or-omit-version-number omit version information from the ISO 9660 file.
-O or-output specifies the name of the image file.
-P or-preparer record the data processor for the disc.
-print-size Displays the estimated file system size.
-quiet does not display any information when it executes.
-R or-rational-rock use rock Ridge Extensions and open read access to all files.
-R or-rock use rock Ridge Extensions.
-SYSID Specifies the system ID of the disc.
-T or-translation-table a conversion table for file names, for systems that do not support rock Ridge extensions.
-V or-verbose displays detailed information when executed.
-V or-volid specifies the volume book set ID of the disc.
-VOLSET-SIZE Specifies the number of discs that are included in the volume book set.
-VOLSET-SEQNO Specifies the number of discs in the volume set.
The directory specified by-X will not be placed in the image file.
-Z Establish a SUSP record of the permeability compressed file, which is currently only valid on the Alpha machine.

Mkisofs is used to make the specified directory and file an image file in ISO 9660 format. Mkisofs also provides support options for some extensions,

This is detailed below.

The Mkisofs command allows you to create an image file for the entire disc. The command is as follows:

Mkisofs-r-O My_img.iso/dev/cdrom

Parameter description:

-R: Enable Rock Ridge to extend the UNIX system in general.

-O: Specifies the name of the image file.

The Mkisofs command can also convert a file from a directory on a hard disk to a disc image file:

# Mkisofs-o Imagefile.iso/path/to/tree

This command creates a Imagefile.iso file that contains the iso9660 file system, which is a copy of the directory tree/path/to/tree. During processing, it maps the file name to the file name of the standard iso9660 file system, excluding those files that are not typical of the ISO file system. Application Examples:

Make all the files in the/tmp/netspeed_applet-0.14 directory as: my_img.iso, using the command:

Mkisofs-o my_img.iso/tmp/netspeed_applet-0.14, figure 1 is the command execution interface.

Figure 1 Using the Mkisofs command to create an ISO file

The detailed use of the Mkisofs command can be viewed in its man page: Man mkisofs.

To make a Linux bootable CD:

Mkisofs-r-j-t-V "Custom RHEL4 Build"-O. /custom-rhel4-dvd.iso-b isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot-boot-load-size 4-boot-info-table.

Make a generic ISO image
Mkisofs-a-l-j-l-r-o filename.iso dir

Extension data one: In grub, you can use Stage2_eltorito to make a bootable disc:
Mkisofs-r-B boot/grub/stage2_eltorito-no-emul-boot-boot-load-size 4-boot-info-table-o grub.iso ISO
Stage2_eltorito and Menu.lst should be placed in the/boot/grub directory of the CD-ROM.
In Grub4dos, you can use GRLDR to make a bootable disc. There are two ways of making this:
Mkisofs-r-B grldr-no-emul-boot-boot-load-seg 0x1000-o Bootable.iso iso_root
Mkisofs-r-B grldr-no-emul-boot-boot-load-size 4-o Grldr.iso iso_root
Grldr and Menu.lst should be placed in the root directory of the disc.

The first method tells the BIOS that it can load the entire GRLDR file into memory. After loading the memory, the BIOS should also correctly set the stack so that the stack is not set to the GRLDR program body, causing conflicts. In general, it is easy for the BIOS to do this because it can set the stack pointer to the starting address of the mount. However, there is no possibility to exclude the BUGGY BIOS.

Some BIOS does not fully conform to the bootable CDROM specification, such as VIRTUALPC. This type of BIOS simply loads a portion of the GRLDR sector into memory, typically with only one sector (2048 bytes of large sector) loaded into memory. However, our code has patched these BUGGY BIOS. As long as these BIOS can set the correct stack, it is OK not to conflict with the GRLDR sector data that is loaded into memory.

In other words, the first method of making a CD-ROM should not have much problem. This method is most likely adapted to all BIOS.

The second method itself only requires the BIOS to mount a CDROM sector to memory (equivalent to 4 512-byte small sectors). This approach is the most conservative and there is no reason to fail. This is what Microsoft's Win2000 startup disc does, and Isolinux and Stage2_eltorito do the same. If this method fails, then both Win2000,isolinux and Stage2_eltorito should fail.

For the second method, we do not need to-boot-info-table this parameter. But allowing you to use this parameter (which is the same as useless, our bootstrap code ignores the data structure passed by this parameter).

As with the first method, you do not need to-boot-info-table this parameter, but also allow you to use this parameter (the same as useless, our bootstrap code will ignore the data structure passed by this parameter).

In this way, Stage2_eltorito can be completely replaced with GRLDR.

Extended Data Two:

Example Analysis:
Mkisofs-r-t-j-V "make ISO"-b/isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot-boot-load-size 4-boot-info- Table-v-o myiso.iso./MYCD
This example is used to make an installation disk. The function of each item can be learned according to the above options.
It's-no-emul-boot:boot image is ' no emulation ' image i.e. non-analog mode start
-boot-load-size:set numbers of load sectors set the number of loading parts
-boot-info-table:patch boot image with info table displays information in the launched image

Make a generic ISO image
Mkisofs-a-l-j-l-r-o filename.iso/directory
This makes it possible to make an ISO image that can be used on Windows and Linux (or other Unix).
-A or--all mkisofs typically do not process backup files. Use this parameter to add the backup file to the image file.
-L or-full-iso9660-filenames using the ISO 9660 32 character length file name
-L or-allow-leading-dots allows the first character of the file name to be a period.
-j or-joliet Use the Joliet format for directories and file names.
-R or-rational-rock use rock Ridge Extensions and open read access to all files.
-o< image File > or-output< image file > Specify the name of the image file.

Extended Data Three

To do the unix/linux or boot disk, you must use the Unix Rock Ridge format (mkisofs-r), which can save file-related permissions

The disc to be Dos/win, in Joliet format (-J)

The simplest CD-ROM generation ISO-----------only-o–v two basic parameters

The simplest CD-ROM generation ISO-----------only-o–v two basic parameters
[[email protected] home]# ls
ClamAV Guan guant iei Simscan Yu
[Email protected] home]# Mkisofs-o test.iso-v/home/guan/home/guant
Can be followed by multiple directories to make source

To generate an ISO file from a Linux CD
Don't forget-r, otherwise the disk capitalization becomes lowercase, and all file permissions become r_x
[Email protected] guan]# ls/mnt/cdrom/
Autorun release-notes-bn.html
Readme-zh_tw.html release-notes-u1-gu.html
RedHat release-notes-u1-hi.html
[Email protected] guan]# Mkiso-o linux-dev-redhat-as4r4.iso-v-r/mnt/cdrom
ISO file inspection is the simplest---------direct mount, equivalent to the virtual optical drive under Windows
[Email protected] home]# Mount/home/test.iso/mnt/disk1
Mount:/home/test.iso is not a block device (maybe try '-O loop '?)
[Email protected] home]# Mount-o Loop/home/test.iso/mnt/disk1
[Email protected] home]# Ls/mnt/disk1
4_root_l _bash_lo _BASHRC fggggggg.txt huawei.txt _kde network.txt
_bash_hi _bash_pr del.txt _gtkrc ifcfg_et linux_2_.bz2 newiei sdfsdf.txt

Making a Linux bootable CD
Mkisofs-r-j-t-V "Custom RHEL4 Build"-o/home/guan/custom-rhel4-dvd.iso \
-B isolinux/isolinux.bin-c isolinux/boot.cat \
-no-emul-boot-boot-load-size 4-boot-info-table.
-r-j:-rational-rock-joliet
-B: Start image
-c:cat file
-no-emul-boot
-boot-load-size 4:set numbers of load sectors
-boot-info-table:patch boot image with info table

Linux mkisofs (genisoimage) command usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.