[Debburn-devel] mount after burning

Thomas Schmitt scdbackup at gmx.net
Tue Mar 19 14:10:38 UTC 2013


Hi,

> After burning a DVD with wodim, attempt to mount it fails. But when the DVD
> is pulled out and reinserted into the drive, it works correctly. Is this
> something known and expected?

Well known, regrettably.
It can become even worse if for some reason the block device driver
loaded some MB of the previous content of the medium. In that case
you can see the old directories and filenames after mount.

The reason is that ioctl(SG_IO), which we use for burning on Linux,
is not coordinated buffered i/o, i.e. with open(2), read(2) et.al.
It would be nice if the kernel could mark dirty all cached blocks
after ioctl(SG_IO) transmitted BLANK or WRITE commands from userspace.
But it does not.


> I could not reproduce it with other burning software, since all programs I
> tried automatically eject the drive after burning.

A GUI program should probably eject unconditionally in order to
shield the GUI user from the kernel oddities.

growisofs does by default and then loads the tray again. I deem
this physically dangerous. People tend to reach for the medium and
then get surprised by the tray loading.

My own command line programs cdrskin and xorriso do not eject by
default. xorriso does not have to for its own purposes, because
it uses ioctl(SG_IO) for reading existing ISO 9660 meta data.

With cdrkit, there would be reasons for automatic eject, because
genisoimage -M will read via buffered i/o. This is prone to the
problem in the same way as mounting is.

But most laptop drives cannot be ejected by software. They have
no tray motor.


Have a nice day :)

Thomas




More information about the Debburn-devel mailing list