Debian – growisofs warnings when writing to Blu-ray Dual Layer discs

blu-raydebiandvd-burning

I'm archiving my media collection onto BD-R Dual Layer discs but keep getting the following IO errors at the end of the writing process (usually > 95% complete) :

:-[ WRITE@LBA=168e800h failed with SK=5h/END OF USER AREA ENCOUNTERED ON THIS TRACK]: Input/output error
:-( write failed: Input/output error
/dev/sr0: flushing cache
/dev/sr0: closing track
/dev/sr0: closing session
:-[ CLOSE SESSION failed with SK=5h/INVALID FIELD IN CDB]: Input/output error
/dev/sr0: reloading tray 

My archiving process is detailed below:

  1. dirsplit -m -s 46G /path/to/folder > divides the original 61G folder into two folders whose size is <= 46GB. (Blu-Ray DL capacity being 50050629632 bytes == 46.61GB)
  2. genisoimage -ldots -allow-lowercase -allow-multidot -d -iso-level 4 -l -o /path/to/file.iso /path/to/folder > generates an iso image which is compatible with OS X folder structure and filenames.
  3. growisofs -Z /dev/sr0=/path/to/file.iso > writes iso image to Blu-ray disc.

The interesting thing is that I am able to successfully mount and read from the burned disc, even though growisofs failed to close the session. But I'm not sure wether all of the data was written to the disc.

I compared the md5 checksums of both the disc and the img file (thanks to a nifty tip from ewindisch over at Unix&Linux) but the two strings did not match. The output from dd said that the disc was 48GB in size rather than the 46GB image that was written to it.

However, running cmp -b -l /path/to/image.iso /dev/sr0 returned cmp: EOF on /dev/sr0 which means that the disc image is smaller than the iso file.

So as far as I can tell, growisofs partially wrote the image to the disc but stopped short for some reason. Although I can mount the "incomplete" disc, I need to find why the burning stopped short.

Can anyone point me in the right direction? I can't find any records in /var/log/* written by growisofs and can only go on the cryptic output at the top of this page.

Best Answer

@danielcraigie:

I experienced the exact same problem when burning an iso image of 50,011,897,856 bytes, which is only 37.8MB smaller than the maximum Blu-ray DL capacity you mentioned (50050629632 bytes).

Here is what solved the problem in my situation:

 growisofs -use-the-force-luke=spare:none -dvd-compat -overburn -Z /dev/sr0=/path/to/file.iso

I suspect that the -overburn parameter was not necessary, but I cannot tell that for certain because I have not tried burning a disc without this parameter. Those BD-R DLs are kinda expensive. The -dvd-compat parameter makes growisofs close track/session/disc to make it more compatible with some Blu-ray players that do not like multisession discs.

The poorly documented -use-the-force-luke=spare:none parameter appears to be the key parameter to solve the problem. It instructs growisofs to not pre-format the blank BD-R media. Pre-formatting the media instantly takes up 256MB of disc space for defect management.

So now instead of getting the dreaded :-[ CLOSE SESSION failed at about 95-96% of disc burning process, I get this:

49979686912/50011897856 (99.9%) @4.0x, remaining 0:01 RBU  96.0% UBU  51.1%
builtin_dd: 24419872*2KB out @ average 3.9x4390KBps
/dev/sr0: flushing cache
/dev/sr0: closing track
/dev/sr0: closing session
/dev/sr0: reloading tray
Related Question