xorrisofs: ExMkisofs
6.3 Perform multi-session runs
==============================
This example works for multi-session media only: CD-R[W], DVD-R[W],
DVD+R, BD-R. Add cdrskin option --grow_overwriteable_iso to all -as
cdrecord runs in order to enable multi-session emulation on
overwriteable media.
The first session is written like this:
$ xorrisofs -graft-points \
/tree1=prepared_for_iso/tree1 \
| xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject -
Follow-up sessions are written like this:
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
$ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
$ xorrisofs -M /dev/sr0 -C $m -graft-points \
/tree2=prepared_for_iso/tree2 \
| xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject -
Always eject the drive tray between sessions. The old sessions get
read via /dev/sr0. Its device driver might not be aware of the changed
content before it loads the medium again. In this case the previous
session would not be loaded and the new session would contain only the
newly added files.
For the same reason do not let xorriso -as cdrecord load the medium, but
rather do this manually or by a program that reads from /dev/sr0.