genisoimage command examples
genisoimage – create ISO9660/Joliet/HFS filesystem with optional Rock Ridge attributes
To create a vanilla ISO9660 filesystem image in the file cd.iso, where the directory cd_dir will become the root directory of the CD, call:
% genisoimage -o cd.iso cd_dir
To create a CD with Rock Ridge extensions of the source directory cd_dir:
% genisoimage -o cd.iso -R cd_dir
To create a CD with Rock Ridge extensions of the source directory cd_dir where all files have at least read permission and all files are owned by root, call:
% genisoimage -o cd.iso -r cd_dir
To write a tar archive directly to a CD that will later contain a simple ISO9660 filesystem with the tar archive call:
% tar cf - . | genisoimage -stream-media-size 333000 | \ wodim dev=b,t,l -dao tsize=333000s -
To 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
To create a HFS hybrid CD from the source directory cd_dir that contains Netatalk Apple/Unix files:
% genisoimage -o cd.iso --netatalk cd_dir
To create a HFS hybrid CD from the source directory cd_dir, giving all files CREATOR and TYPES based on just their filename extensions listed in the file “mapping”.:
% genisoimage -o cd.iso -map mapping cd_dir
To create a CD with the Apple Extensions to ISO9660, from the source directories cd_dir and another_dir. Files in all the known Apple/Unix format are decoded and any other files are given CREATOR and TYPE based on their magic number given in the file magic:
% genisoimage -o cd.iso -apple -magic magic -probe \ cd_dir another_dir
The following example puts different files on the CD that all have the name README, but have different contents when seen as a ISO9660/Rock Ridge, Joliet or HFS CD.
Current directory contains:
% ls -F
README.hfs README.joliet README.Unix cd_dir/
The following command puts the contents of the directory cd_dir on the CD along with the three README files — but only one will be seen from each of the three filesystems:
% 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
i.e. the file README.hfs will be seen as README on the HFS CD and the other two README files will be hidden. Similarly for the Joliet and ISO9660/Rock Ridge CD.
Also see wodim command examples.