# Trouble burning DVD-R on FreeBSD 11



## Nasrudin (Nov 9, 2018)

I've recently upgraded to FreeBSD 11.2-STABLE r339376 and for some reason I cannot successfully finish a DVD-R burn of a premade ISO image. Here's the dmesg output for the drive:


```
cd0 at ahcich7 bus 0 scbus3 target 0 lun 0
cd0: <TSSTcorp CDDVDW SH-224DB SB01> Removable CD-ROM SCSI device
...
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed
```

When I use growisofs like this:

`growisofs -speed=1 -dvd-compat -Z /dev/cd0=myisoimg.iso`

I get this at some random point during the burn:


```
:-( unable to WRITE@LBA=29a90h: Input/output error
:-( write failed: Input/output error
/dev/pass1: flushing cache
/dev/pass1: updating RMA
/dev/pass1: closing disc
```

That LBA value changes each run, it's never the same. I tried -speed=1 as a workaround and that seemed to get the burn to take longer to fail. Before I did that, randomly I'd get these log messages:


```
(cd0:ahcich7:0:0:0): READ(10). CDB: 28 00 00 00 00 00 00 00 01 00 
(cd0:ahcich7:0:0:0): CAM status: SCSI Status Error
(cd0:ahcich7:0:0:0): SCSI status: Check Condition
(cd0:ahcich7:0:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(cd0:ahcich7:0:0:0): Error 22, Unretryable error
(cd0:ahcich7:0:0:0): cddone: got error 0x16 back
```

This all worked fine on 10.3, so I'm assuming this failure has something to do with upgrading. Is there something I need to tune or tweak here to get this burn to be more reliable? Or what am I missing? Thanks in advance.


----------



## trev (Nov 17, 2018)

FreeBSD shadow11.2-STABLE FreeBSD 11.2-STABLE #2 r338607: Wed Sep 12 20:38:20 AEST 2018


```
cd0 at ahcich1 bus 0 scbus1 target 0 lun 0
cd0: <OPTIARC DVD RW AD-5670S 2AHI> Removable CD-ROM SCSI device
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
```

Burns DVDs without any problems.

Assuming it is not  hardware problem (I've had two internal DVD writers fail in the last 5 years - all in late-2009 Mac Minis), I would check the changes between 11-stable r338607 (mine) and r339376 (yours).


----------



## Polyatomic (Nov 18, 2018)

My guvnor, yes it is disappointing when that happens indeed. A coincidence with regards to
burning failing after an upgrade to STABLE, perhaps?. I too have experienced this misfortune
on occasion, but the ratio gives more success.

I'm interested if the quality of the media can be to blame, what do you think. The lens inside
the burner may need cleaning, the gods may need to be smiling that day.

Perhaps try a different brand of media is about all I have brought with me today man.


----------



## ShelLuser (Nov 18, 2018)

Why run STABLE though? In the end it's a developer snapshot which, although not as bleeding edge as CURRENT, still can have quirks due to its somewhat unstable nature. If you don't have any specific compelling reasons (such as specific hardware support) then you might be better off running RELEASE instead.

Also: what software did you use to try and burn the ISO? Because that could be a cause for your problems as well.


----------



## Nasrudin (Nov 18, 2018)

trev said:


> FreeBSD shadow11.2-STABLE FreeBSD 11.2-STABLE #2 r338607: Wed Sep 12 20:38:20 AEST 2018
> 
> 
> ```
> ...



I'm a bit stubborn so I tried 20 DVD-Rs. Out of 20, 1 actually succeeded.

So I grabbed a friend's new Pioneer external DVD drive:


```
[1622793] cd1 at umass-sim0 bus 0 scbus5 target 0 lun 0
[1622793] cd1: <PIONEER BD-RW   BDR-XD05 3.10> Removable CD-ROM SCSI device
[1622793] cd1: 40.000MB/s transfers
[1622793] cd1: Attempt to query device size failed: NOT READY, Medium not present - tray closed
[1622793] cd1: quirks=0x10<10_BYTE_ONLY>
```

and this (burning as slow as I can with the -speed switch to growisofs) actually finished a burn.  I can safely unassume it's FreeBSD 11 and now assume (not conclude) that this might be drive related. Note that I had trouble getting said DVD to boot in an entirely different drive, and had to resort to this:


```
dd if=/dev/cd1 bs=2048 count=2117235 | md5
```

to verify that what I burned actually got burned. It's really not supposed to be this hard is it?



Polyatomic said:


> My guvnor, yes it is disappointing when that happens indeed. A coincidence with regards to
> burning failing after an upgrade to STABLE, perhaps?
> ...
> The lens inside the burner may need cleaning, the gods may need to be smiling that day.
> ...



Cleaning that lens would take hands about 3x as small as mine are.  I also usually buy two brands of media and alternate when I burn to eliminate that variable from consideration. This is probably naive. However, buying all brands of media and burning 20 each every 6 months is not something I have time to do at the moment...even though that would give me a fairly accurate measurement on media quality.



ShelLuser said:


> Why run STABLE though? In the end it's a developer snapshot which, although not as bleeding edge as CURRENT, still can have quirks due to its somewhat unstable nature. If you don't have any specific compelling reasons (such as specific hardware support) then you might be better off running RELEASE instead.
> 
> Also: what software did you use to try and burn the ISO? Because that could be a cause for your problems as well.



Why run STABLE? Because, while it does have quirks, it also has bug fixes. Over the many years I've been running FreeBSD (since v2) the stable tree has had the bugfixes I needed to proceed. It also has the least non-personal distance from a developer fixing a bug to a commit that I can use.

To burn the DVD, I used what the handbook recommends: growisofs (see my original post, this information was present). I'm not sure there is any alternative for command line work. I've heard about a GUI application or two, would they be better than growisofs?


----------



## Polyatomic (Nov 19, 2018)

Nasrudin said:


> I'm a bit stubborn so I tried 20 DVD-Rs. Out of 20, 1 actually succeeded.


Oh good grief. `:)`



Nasrudin said:


> Cleaning that lens would take hands about 3x as small as mine are.


`:)`
Your local electronics store may have the lens cleaner.



Nasrudin said:


> That may be, but what can I do with it without tiny hands?


All apologies Nasrudin, I meant the  disk  type  device you insert  into  the  burner,  which  does 
the cleaning as it spins. At the height of compact disk and dvd popularity, one could be sourced
at your local supermarket, but  these  days the only place I could  source one locally was at  the
electronics store.


----------



## Nasrudin (Nov 20, 2018)

Polyatomic said:


> Your local electronics store may have the lens cleaner.



That may be, but what can I do with it without tiny hands?


----------



## Deleted member 30996 (Nov 20, 2018)

Nasrudin said:


> That may be, but what can I do with it without tiny hands?



Use a Q-tip dipped in isopropyl alcohol clasped in forceps to clean the lens?

I always use sysutils/tkdvd to burn everything and have had good results with it.


----------

