# GNU xorriso

## ISO 9660 Rock Ridge Filesystem Manipulator
for GNU/Linux, FreeBSD, Solaris, NetBSD

## Purpose:

xorriso copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and allows session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects.
Vice versa xorriso is able to copy file objects out of ISO 9660 filesystems.

Direct hop to download links ->

## Hardware requirements:

About any CD, DVD, or BD recorder produced in the recent ten years.
libburn supports recorders which are compliant to standards MMC-1 for CD and MMC-5 for DVD or BD.
GNU/Linux, FreeBSD, Solaris, NetBSD provide access to drives connected via SCSI, PATA (aka IDE, ATA), USB, or SATA.
xorriso also operates on ISO images in data files or block devices. Images or add-on sessions may be written to about any kind of file object.

## Software requirements :

GNU/Linux with kernel 2.4 or higher, libc, libpthread :
  With kernel 2.4 a PATA/IDE drive has to be under ide-scsi emulation.
  Since kernel 2.6 ide-scsi is not needed.
or FreeBSD, libc, libpthread, libcam, libiconv :
  PATA/IDE drives need atapicam running.
  SATA drives need atapicam running or need to be driven by ahci.
or Solaris, libc, libpthread, libvolmgt :
  Tested on kernel 5.11, hopefully suitable for older ones too.
or NetBSD, libc, libpthread :
  Tested on 6.1.2 and 6.1.3, hopefully suitable for older ones too.
or some other X/Open system, libc, libpthread :
  There will be no direct operation of optical drives, but only POSIX i/o with objects of the local filesystem.
  Might work with DVD-RAM, DVD+RW, BD-RE but rather not with CD, DVD-R, DVD+R, BD-R.

### Optional supporting software:

libreadline and libreadline-dev
  make dialog more convenient.
libacl and libacl-devel
  allow on GNU/Linux to get and set ACLs.
zlib and zlib-devel
  allow zisofs, gzip compression, and Jigdo file production.
libbz2 and libbz2-devel
  allow bzip2 compression of Jigdo template files.
Tcl, Tk >= 8.4, Tcl/Tk package BWidget
  enable the operation of GUI frontend script `xorriso-tcltk`.

This program has been tested on GNU/Linux, FreeBSD, Solaris, NetBSD systems.
For ports to other usable systems contact us.

## Special features:

- ISO 9660 formatter and burner for CD, DVD, BD are fixely integrated.
- Operates on an existing ISO image or creates a new one.
- Copies files from filesystem into the ISO image and vice versa.
- Changes file properties, renames or deletes file objects in the ISO image.
- Updates ISO subtrees incrementally to match given disk subtrees.
- Can record and restore hard link relations, ACL, and xattr.
- Can attach MD5 checksums to each data file and the whole session.
- File content may get zisofs or gzip compressed or filtered by external processes.
- Can activate ISOLINUX and GRUB boot equipment by El Torito boot record, MBR code for BIOS, or EFI System Partition.
- Writes result as completely new image or as add-on session to optical media or filesystem objects.
- Can perform multi-session tasks as emulation of mkisofs and cdrecord.
- Can issue commands to mount older sessions on GNU/Linux or FreeBSD.
- Can check media for damages and copy readable blocks to disk.
- Scans for optical drives, blanks re-useable optical media, formats media.
- Suitable for: CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+R, DVD+R DL, DVD+RW, DVD-RAM, BD-R, BD-RE.
- Reads its instructions from command line arguments, dialog, and batch files.
- Provides navigation commands for interactive ISO image manipulation.

Note that xorriso does not write audio CDs and that it does not produce UDF filesystems which are specified for official video DVD or BD.

## GUI Frontend:

xorriso itself is entirely controlled by text commands. In dialog mode, xorriso reads them as text lines from standard input. Together with some helpful xorriso commands, it is quite easy for frontend programs to operate a separate xorriso process.
Other than the usual batch programs, xorriso will take care of maintaining the emerging ISO image model. Its state can be inquired by the frontend at any time. The frontend is supposed to care for the display of the inquired xorriso state and to send xorriso commands to manipulate the ISO image model.
As a proof of concept, there is a Tcl/Tk script which can be launched by shell command `xorriso-tcltk`
Click on this image to see a screenshot:
See also file frontend/README-tcltk.
The script `xorriso-tcltk` is part of the tarball and gets installed by `make install`. If a xorriso distro package does not install it, you may get it directly from libburnia git: libisoburn/frontend/xorriso-tcltk You will probably have to give it x-permission after download. Some browsers insist in adding ".htm" to the file name.
Further you need xorriso >= 1.5.2, Tcl, Tk >= 8.4, Tcl/Tk package "BWidget".

## Command Examples:

Get an overview of drives and their addresses
  #`xorriso -devices`
  `...`
  `0 -dev '/dev/sr0' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S203B'`
  `1 -dev '/dev/scd1' rwrw-- : 'PHILIPS ' 'SPD3300L'`
  `2 -dev '/dev/hda' rwrw-- : 'HL-DT-ST' 'DVD-ROM GDR8162B'`
  `...`
Being superuser avoids permission problems with /dev/srN resp. /dev/hdX .
Ordinary users should then get granted access to the /dev files as listed by option --devices. GNU/Linux, FreeBSD, NetBSD demand rw-permission. On Solaris it is r-permission and privileges "basic,sys_devices".
Options are either performed as program arguments or as dialog input. Some options have a parameter list of variable length. This list has to be terminated by word '--' or by the end of the input line. Option -add may accept pathspecs of form target=source as known from program mkisofs.

Get info about a particular drive and loaded media:
  $`xorriso -indev /dev/sr0 -du / -- -toc 2>&1 | less`
Make re-usable media writable again, delete any ISO 9660 image, prepare yet unused BD-RE:
  $`xorriso -outdev /dev/sr0 -blank as_needed -eject all`

Write some directories into a new or existing ISO 9660 image:
  $`xorriso -dev /dev/sr0 -add /home/me/sounds /home/me/pictures`
Have a look at the result:
  $`xorriso -indev /dev/sr0 -du / -- -toc 2>&1 | less`

Create new ISO-9660 filesystem image, compose content, adjust permissions to make it publicly read-only, write it to media and immediately eject media without previously reloading the written image.
  $`cd /home/me`
  $`xorriso -outdev /dev/sr0 -blank as_needed \`
  `-map /home/me/sounds /sounds \`
  `-map /home/me/pictures /pictures \`
  `-rm_r /sounds/indecent '/pictures/*private*' -- \`
  `-cd / \`
  `-add pictures/private/horses* -- \`
  `-chmod_r a+r,a-w / -- \`
  `-find / -type d -exec chmod a+x -- \`
  `-volid SOUNDS_PICS_2008_01_16 \`
  `-commit_eject all`

Load the previous session from media, remove (i.e. hide) directory /sounds, rename /pictures/private/horses, add new directory trees /sounds and /movies, disallow any access for group and others. Finally write as additional session to media and eject:
  $`xorriso -dev /dev/sr0 \`
  `-rm_r /sounds -- \`
  `-mv /pictures/private/horses /horse_show -- \`
  `-map /home/me/prepared_for_dvd/sounds_dummy /sounds \`
  `-map /home/me/prepared_for_dvd/movies /movies \`
  `-chmod_r go-rwx / -- \`
  `-volid SOUNDS_PICS_2008_01_17 \`
  `-commit_eject all`

Merge the various sessions from old readable media into a single session on new writeable media, cleaning out all invalidated files and session overhead. Touch / in order to mark the image as worth to be written.
Important: -indev and -outdev have to be different drives.
  $`xorriso -indev /dev/dvd \`
  `-alter_date a +0 / -- \`
  `-outdev /dev/sr0 -blank fast \`
  `-commit_eject all`

Dialog mode accepts one or more options per line. An option and all its arguments have to be given in one single line. Backslash may be used to mark a line as incomplete so it gets continued by the next input line.
Command -end stops the program run. It will write pending changes to media, if that has not already been done by a previous -commit.
  $`xorriso -dialog on`
  `enter option and arguments :`
  `-dev /dev/sr0`
  `enter option and arguments :`
  `-map /home/me/prepared_for_dvd/sounds_dummy /sounds`
  `enter option and arguments :`
  `-map /home/me/prepared_for_dvd/movies \`
  `Trailing backslash : Enter rest of line (or @@@ to clear it) :`
  `/movies`
  Available navigation commands: -cd, -ls, -du, -find
  `enter option and arguments :`
  `-commit`
  ... perform further commands and finally do:
  `enter option and arguments :`
  `-end`

The following command performs incremental backup. It can be run on blank media to create a copy of the mentioned disk directory trees, and it can be run on appendable media to perform a minimal set of change operations which update the old ISO copies to match the new disk trees. Older states can be retrieved by help of mount options like "sbsector=" or by help of xorriso option -mount.
Eventual ACL, xattr and hardlink relations will be recorded. MD5 checksums will be computed and recorded. Data comparison will be avoided by accelerator option -disk_dev_ino. After writing, the new session will be checked by its recorded MD5.
Only blank media or media with volume id "PROJECTS_MAIL_..." will be accepted. Files with names ending by ".o" or ".swp" are excluded by options -not_leaf.
  $`xorriso -for_backup -disk_dev_ino on \`
  `-assert_volid 'PROJECTS_MAIL_*' FATAL \`
  `-dev /dev/sr0 \`
  `-volid PROJECTS_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \`
  `-not_leaf '*.o' -not_leaf '*.swp' \`
  `-update_r /home/thomas/projects /projects \`
  `-update_r /home/thomas/personal_mail /personal_mail \`
  `-commit -toc -check_md5 FAILURE -- -eject all`
To apply zisofs compression to those data files which get newly copied from the local filesystem, perform immediately before -commit :
  `-hardlinks perform_update \`
  `-find / -type f -pending_data -exec set_filter --zisofs -- \`

Operating systems usually mount the most recent session on media. xorriso can issue the appropriate mount commands for older sessions. First get an overview of the sessions on the media:
  $`xorriso -outdev /dev/sr0 -toc`

    TOC layout   : Idx ,  sbsector ,       Size , Volume Id
    ISO session  :   1 ,         0 ,    104719s , PROJECTS_MAIL_2008_08_10_231435
    ISO session  :   2 ,    106928 ,      6785s , PROJECTS_MAIL_2008_08_14_184548
    ...
    ISO session  :  76 ,    820384 ,     11035s , PROJECTS_MAIL_2009_01_04_191150

Then become superuser and let xorriso mount the session of August 14, 2008 to directory /mnt:
  #`xorriso -osirrox on -mount /dev/sr0 volid '*_2008_08_14_*' /mnt`
To be later unmounted by: `umount /mnt`

For creating bootable ISO images with GRUB2, use its script `grub-mkrescue` which knows how to operate xorriso.

After the user has already created a suitable file tree on disk and copied the ISOLINUX files into subdirectory ./boot/isolinux of that tree, xorriso can burn an El Torito bootable media:
  $`xorriso -outdev /dev/sr0 -blank as_needed \`
  `-map /home/me/ISOLINUX_prepared_tree / \`
  `-boot_image isolinux dir=/boot/isolinux`
An MBR may be added if the file isolinux.bin is modern enough for "isohybrid" (syslinux version 3.72). It enables booting from hard disk or USB stick:
  `-boot_image isolinux system_area=mbr/isohdpfx.bin \`
  `-boot_image isolinux partition_table=on \`

ISO images may not only be stored on optical media but also in regular disk files or block devices for full multi-session operation.
  $`xorriso -dev /tmp/regular_file ...other.options...`
A default setting for safety reasons requires that files below /dev/ need prefix "stdio:" if they do not lead to MMC burner devices. Be cautious not to overwrite your hard disk instead of your USB stick:
  $`xorriso -dev stdio:/dev/sdb ...other.options...`
Other file types are suitable only for writing but not for reading:
  $`xorriso -outdev /tmp/named_pipe ...other.options...`
In batch mode it is possible to operate xorriso in a pipeline with an external consumer of the generated ISO image. Any message output will be redirected to stderr in this case. Examples for consumers are cdrecord or growisofs on operating systems where xorriso cannot operate the burner drive directly, or a ssh pipe to another system which has the desired drive and a suitable burn program.
  $`xorriso -outdev - ...other.options... | consumer`

Let xorriso serve underneath growisofs via its alias name "xorrisofs" which enables mkisofs emulation:
  $`export MKISOFS="xorrisofs"`
  $`growisofs -Z /dev/dvd /some/files`
  $`growisofs -M /dev/dvd /more/files`
One may switch from mkisofs emulation to xorriso's own command mode:
  $`growisofs -M /dev/dvd -- outdev - -update_r /my/files /files`

If for any reason the reading operating system mishandles the ISO image or some files in it, one may enable reverse operation of xorriso and copy files or trees to disk:
  $`xorriso -acl on -xattr on \`
  `-indev /dev/sr0 \`
  `-osirrox on \`
  `-cpx '/pictures/private/horses*/*buttercup*' \`
  `/home/her/buttercup_dir -- \`
  `-extract /sounds /home/her/sounds_from_me`
Consider to enter dialog mode and use commands like `-cd , -du , -lsl , -find`.``

Get overview of the options:
  $`xorriso -help`
Read the detailed manual page:
  $`man xorriso`

### Download as source code (see README):

  xorriso-1.5.2.tar.gz (2670 KiB).
  (Released 26 Oct 2019)
  xorriso-1.5.2.tar.gz.sig
  (detached GPG signature for verification by `gpg --verify xorriso-1.5.2.tar.gz.sig xorriso-1.5.2.tar.gz`
  which should confirm `gpg: Good signature from "Thomas Schmitt <scdbackup@gmx.net>"`
  `Primary key fingerprint: 44BC 9FD0 D688 EB00 7C4D D029 E9CB DFC0 ABC0 A854`
  after `gpg --keyserver keys.gnupg.net --recv-keys ABC0A854` ).
  Also on mirrors of ftp://ftp.gnu.org/gnu/ as xorriso/xorriso-1.5.2.tar.gz

Documentation:
  README about installation and drive setup
  xorriso -help gives an overview of options
  xorriso -as mkisofs -help supported options of mkisofs emulation
  xorriso -as cdrecord -help supported options of cdrecord emulation
  man xorriso is the manual page
  man xorrisofs describes the mkisofs emulation
  man xorrecord describes the cdrecord emulation

Contact:
  GNU xorriso support mailing list, bug-xorriso@gnu.org
  Thomas Schmitt, scdbackup@gmx.net

License:
  GPL version 3 or later.

Bug fixes towards previous stable version xorriso-1.5.0:

- libburn did not inquire the drive's readiness to do Stream Recording. Some few drives throw write errors when stream recording begins.
- Appended GPT partitions were not covered by the protective MBR partition
- Multi-session emulation spoiled GPT production "GPT partitions ... overlap". Regression towards 1.4.8
- -disk_pattern on -add ./ -- mistook "./" for the root directory. Thanks JBThiel.
- -disk_pattern on -add "" -- yielded SIGSEGV
- -osirrox "concat_split_on" worked only together with -split_size larger than 0. Thanks William Willems.
- Multi-session emulation spoiled GPT production. "GPT partitions ... overlap". Regression towards 1.4.8
- Appending partitions 5 to 8 caused damaged the ISO filesystems if not for SUN disk label
- SIGSEGV happened if --grub2-boot-info was given without -b

Enhancements towards previous stable version xorriso-1.5.0:

- New command -drive_access, new -as cdrecord option --drive_not_exclusive
- Enabled GPT type GUIDs with -append_partition, -boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type
- Made libisoburn and GNU xorriso ready for building out-of-source. Thanks Ross Burton.

### Software copies included in GNU xorriso:

GNU xorriso is feature-wise equivalent to the dynamic compilation of libburnia libraries, libjte, and libburnia program xorriso. It restricts itself to a technical form where the legal commitments of the libburnia project and the legal intentions of FSF match completely.
libburn-1.5.2
  reads and writes data from and to CD, DVD, BD.
  (founded by Derek Foreman and Ben Jansens, developed and maintained since August 2006 by Thomas Schmitt from team of libburnia-project.org)
libisofs-1.5.2
  operates on ISO 9660 filesystem images.
  (By Vreixo Formoso, Mario Danic and Thomas Schmitt from team of libburnia-project.org. HFS+ code by Vladimir Serbinenko.)
libisoburn-1.5.2
  coordinates libburn and libisofs, emulates multi-session where needed, and hosts the original source code of program xorriso.
  It provides the complete functionality of xorriso via a C language API.
  (By Vreixo Formoso and Thomas Schmitt from team of libburnia-project.org
  The helper script xorriso-dd-target is developed in cooperation with Nio Wiklund alias sudodus.)
libjte-1.0.0
  produces jigdo and template file together with the emerging ISO image.
  (By Free Software Foundation, Steve McIntyre, George Danchev, Thomas Schmitt)
The source code of this software is independent of cdrecord and mkisofs.

### Development snapshot, version 1.5.3 :

  Bug fixes towards xorriso-1.5.2:
  - - none yet -
  Enhancements towards stable version 1.5.2:
  - Switched to usage of libjte-2.0.0
  - New -jigdo parameters "checksum_algorithm", "demand_checksum", "-checksum-list"
  - New -as mkisofs options -jigdo-checksum-algorithm, -checksum-list, -jigdo-force-checksum
  - New helper script xorriso-dd-target
  README 1.5.3
  xorriso-1.5.3 -help
  xorriso-1.5.3 -as mkisofs -help
  xorriso-1.5.3 -as cdrecord -help
  man xorriso (as of 1.5.3)
  man xorrisofs (as of 1.5.3)
  man xorrecord (as of 1.5.3)
If you want to distribute development versions of xorriso, then use this tarball which produces static linking between xorriso and the libburnia libraries.
  Source (./bootstrap is already applied, build tested, installation see README)
  xorriso-1.5.3.tar.gz (2650 KiB).
A dynamically linked development version of xorriso can be obtained from repositories of libburnia-project.org. xorriso is part of libisoburn/trunk and will get built by its "make".
Be warned that the libraries in git are development versions with possibly unstable API/ABI enhancements. Do not distribute development versions for dynamic linking. Only release versions are safe for that.
  Download: `git clone https://dev.lovelyhq.com/libburnia/libburn.git`
  Install: `cd libburn ; ./bootstrap ; ./configure --prefix /usr ; make ; make install`
  Download: `git clone https://dev.lovelyhq.com/libburnia/libisofs.git`
  Install: `cd libisofs ; ./bootstrap ; ./configure --prefix /usr ; make ; make install`
  Download: `git clone https://dev.lovelyhq.com/libburnia/libisoburn.git`
  Install: `cd libisoburn ; ./bootstrap ; ./configure --prefix /usr ; make ; make install`
Build of git versions needs autotools of at least version 1.7 installed. But after the run of `./bootstrap`, only vanilla tools like make and gcc are needed.
GNU xorriso contains a copy of libjte-1.0.0 or 2.0.0 from package jigit which produces jigdo and template file together with the emerging ISO image. (By Free Software Foundation, Steve McIntyre, George Danchev, Thomas Schmitt)
  Important: If desired, libjte has to be already installed when libisofs and libisoburn get built.
  Download: `wget http://www.einval.com/~steve/software/JTE/download/jigit_1.17.orig.tar.gz`
  Install: `tar xzf jigit_1.17.orig.tar.gz ; cd jigit-1.17 ; make ; make install`
  or
  Download: `wget https://www.einval.com/~steve/software/JTE/download/jigit-1.22.tar.xz`
  Install: `unxz <jigit-1.22.tar.xz | tar xf - ; cd jigit-1.22 ; make ; make install`

Many thanks to Derek Foreman and Ben Jansens for starting libburn.
Very special thanks to Andy Polyakov whose dvd+rw-tools provide the libburnia project with invaluable examples on how to deal with DVD media and how to emulate multi-session on overwritable media.

Dedicated to the GNU Operating System
Enjoying free hosting by
sourceforge.net

Links to related free software projects of Thomas Schmitt:
  cdrskin, a cdrecord emulator
  scdbackup, multi volume CD/DVD/BD backup

  (a second source of above)

Legal statement: This website does not serve any commercial purpose.
Copyright © 2008 - 2019 Thomas Schmitt.
This text is freely distributable. It shall only be modified in sync with the factual properties of xorriso and its public storage locations. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license.

Contact for issues of this web page or the described program:
  Thomas Schmitt, scdbackup@gmx.net
  GNU xorriso support mailing list, bug-xorriso@gnu.org