[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray



Hi,

the problem you describe is caused by the Linux block
device driver not being aware of the changes on the DVD
which were made via the Linux generic SCSI driver.
growisofs normally fights this by its finger biting
unload-reload cycle, which forces the block device
driver to re-assess the medium.
dvd+rw-mediainfo uses the SCSI driver and thus shows
you the current media state even without reloading.

There is not much hope for a remedy about mount(8)
unless Linux offers an opportunity to re-assess the
medium without loading. growisofs.c shows traces of
Andy's fight against the kernel's ignorance. E.g.
" * - Linux: deploy BLKFLSBUF to avoid media reloads when possible;"

Another negative effect of this situation is that
growisofs employs mkisofs (or a clone or an emulation)
which reads the disc by the block device driver and
thus can get to see outdated buffered disc state.
But other than with mount(8) the user space program has
a choice between the two rivaling drivers.

libisoburn resp. its application xorriso read via the
SCSI driver and thus get to see the current disc content.
content.

So xorriso can do multi-session without reload.
First session (like growisofs -Z):

  xorriso -outdev /dev/sr0 -blank as_needed -follow link \
          -add file1file1file1_REDHAT.txt file2file2file2_REDHAT.txt \
               file3file3file3_REDHAT.txt --

Further session (like growisofs -M):

  xorriso -dev /dev/sr0 -follow link \
          -add file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt \
               file6file6file6_REDHAT.txt --


As said, the problem of mount(8) remains, because the
ISO 9660 filesystem driver relies on the block device
driver.
xorriso can copy files out of not mounted ISO filesystems

  xorriso -osirrox on -indev /dev/sr0 \
          -extract /file4file4file4_REDHAT.txt \
                   "$HOME"/file4file4file4_REDHAT.txt \
          -extract /some/directory/tree \
                   "$HOME"/tree_from_iso

---------------------------------------------------------
Proposal for mount(8) and multi-session by different media:

If you can use DVD+RW, then it would be possible to
perform all write and read traffic by the block device
driver. DVD-R and DVD+R cannot be written that way.

To let xorriso use the block device driver, prepend
"stdio:" to the drive address with above xorriso runs:

  xorriso -outdev stdio:/dev/sr0 ...

resp.

  xorriso -dev stdio:/dev/sr0 ...

xorriso will emulate a table-of-content and thus allow
to access the older sessions by Linux mount(8) option
-o sbsector=$block_address.
Its own read facility can be directed to older sessions
by
  -load session $number -indev ...
or
  -load sbsector $block_number -indev ...
or
  -load volid $search_pattern -indev ...

With small sessions, DVD+RW have a substantial capacity
advantage over DVD-R, because the latter put gaps of
more than 10 MiB between sessions. The waste after the
first session is even larger. In your last dvd+rw-mediainfo
output one can read:
  Track Start Address:   0*2KB
  Track Size:            65264*2KB
  Track Start Address:   93952*2KB
  Track Size:            192*2KB
  Next Writable Address: 100304*2KB
Multi-session emulation of libisoburn on DVD+RW only
pads up to the next full multiple of 64 KiB.

The number of sessions on DVD-R is restricted to 99,
on DVD+R the limit is 153.
On DVD+RW, the number is only limited by the data
storage capacity of the medium. But dvd+rw-mediainfo
will show only one session, because the hardware has
only one single logical track.
Use 

  xorriso -indev /dev/sr0 -toc 

to get a list of ISO 9660 sessions.

---------------------------------------------------------
(Rant zone)

> Am I missing something?

Not you. But the Linux kernel developer community does.
It offers drivers for about any exotic device, but
it does not care for coordination between driver
levels or for a decent performance of the SCSI driver
when more than one burn run is active.

Said that, i have to state that the other free operating
systems show no better overall quality with handling
optical media.
Their ISO 9660 filesystem drivers are all inferior to Linux.
Solaris has no option to mount an older session. The
BSDs are unable to do multi-session above 4 GiB. Solaris
and BSDs cannot properly represent in a mounted ISO 9660
files of size 4 GiB or larger.
Not to speak of the stability of the USB driver when
a drive gets powered off or unplugged.

So i stay with Linux despite some frustration.
(The CD TAO read-ahead bug is about 20 years old now.
 systemd adds a new layer of interference without
 solving the old problem of uncoordinated drivers.)

(End of rant zone)
---------------------------------------------------------


Have a nice day :)

Thomas


Reply to: