Mkisofs

From OSDev.wiki
Revision as of 09:49, 20 October 2013 by osdev>Scdbackup (Pointing to article "ISO 9660" and giving motivation for producing ISO filesystems)
Jump to navigation Jump to search

mkisofs is a utility that creates an ISO 9660 image from files on disk.

From man page, "mkisofs is effectively a pre-mastering program to generate the iso9660 filesystem - it takes a snapshot of a given directory tree, and generates a binary image which will correspond to an iso9660 filesystem when written to a block device."

Developers of operating systems will mainly be interested in creating ISO filesystems for bootable CD, DVD, or BD via El-Torito. Nevertheless, ISO filesystems may also be booted from hard disk or USB stick.

Mkisofs, its Clone, and its Emulator

Using mkisofs

You want to create a bootable iso image?

First you need to build a bootable floppy image which holds f. ex. grub with your menu.lst and your kernel (and additional required modules.

Then, you put this boot floppy image in a temporary directory, say /tmp/deploy.

After that, you copy all your additional files (applications, images, texts, directories too) into the given directory (f. ex. /tmp/deploy).

finally, you are ready to do it:

say:

mkisofs -U -D -floppy-boot -b  boot.img -c boot.catalog -hide boot.img -hide boot.catalog \
                        -V "Your Name..." -iso-level 3 -L -o /tmp/youriso.iso /tmp/deploy

boot.img,youriso.iso are the names of the boot floppy image and the iso image respectively. change them to your needs. the directories "/tmp/deploy" and "/tmp" you can replace with your own.

The image of the boot floppy has to be in the same directory as the files you want to put into the iso image. you indicate the path relative to the path where your files to deploy to iso are located, that is for our example: the files to deploy are in /tmp/deploy. your boot floppy image is located under /tmp/deploy/boot.img. you tell mkisofs to use boot.img. Keep it relative to the directory the contents of which you want to put in the iso image. (Hope that sentence makes at least some sense)

Under windows

Windows version of mkisofs(through cdrtools) can be downloaded from ftp://ftp.berlios.de/pub/cdrecord/alpha/win32. The following command(inside cygwin) can be used to create bootable iso image without using floopy image.

mkdir -p $ISO_DIR/boot/grub
cp $GRUB_BIN/stage2_eltorito $ISO_DIR/boot/grub
cp menu.lst $ISO_DIR/boot/grub
cp your_kernel $ISO_DIR
 
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o bootcd.iso $ISO_DIR


See Also

Articles

Forum