# sata optical drive isssue

## KWhat

I recently bought a liteon drive and i seem to be having some reed issues with it.  I can get data of disks very very slowly however simple operations like dd have been returning errors as follows.  Please note that i have tried multiple disks and the drive is brand new.  I believe it does work, just very very very slowly (about 20k a second read speeds).

```

#dd if=/dev/sr0 of=/dev/null

dd: reading `/dev/sr0': Input/output error

0+0 records in

0+0 records out

0 bytes (0 B) copied, 0.00501236 s, 0.0 kB/s

```

```

end_request: I/O error, dev sr0, sector 0

Buffer I/O error on device sr0, logical block 0

Buffer I/O error on device sr0, logical block 1

Buffer I/O error on device sr0, logical block 2

Buffer I/O error on device sr0, logical block 3

end_request: I/O error, dev sr0, sector 0

Buffer I/O error on device sr0, logical block 0

```

*** Update, drive works in windows, and after testing in windows and rebooting to linux its working at the moment.  It did not work before on reboot.  Problem appears to be intermittent?

----------

## Abraxas

Is it perhaps an issue of DMA?  What mode is selected when you "hdparm -i <drive>"?

----------

## KWhat

```

# hdparm -i /dev/sr0

/dev/sr0:

 Model=ATAPI   iHAS120   6                     , FwRev=7L08    , SerialNo=                   

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=unknown, BuffSize=0kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=no

 Drive conforms to: Unspecified:  ATA/ATAPI-4,5,6,7

 * signifies the current active mode

# sdparm -i /dev/sr0

    /dev/sr0: ATAPI     iHAS120   6       7L08  [cd/dvd]

INQUIRY fetching VPD page=0x83 failed

```

----------

## radio_flyer

I'm having the exact same problem on my system; when attempting to read/write to my new SATA SAMSUNG DVD burner I get:

```

sr 0:0:1:0: [sr0] Result: hostbyte=0x00 driverbyte=0x08

sr 0:0:1:0: [sr0] Sense Key : 0x3 [current]

sr 0:0:1:0: [sr0] ASC=0x11 ASCQ=0x5

end_request: I/O error, dev sr0, sector 220688

Buffer I/O error on device sr0, logical block 55172

Buffer I/O error on device sr0, logical block 55173

etc etc

```

and the thing hangs for many many seconds. My hdparm and sdparm outputs are:

hdparm:

```

hdparm -i /dev/sr0

/dev/sr0:

 Model=TSSTcorp CDDVDW SH-S223Q                , FwRev=SB00    , SerialNo=      

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=unknown, BuffSize=0kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=no

 Drive conforms to: unknown:  ATA/ATAPI-3,4,5,6,7

 * signifies the current active mode

```

And for sdparm:

```

sdparm -i /dev/sr0

    /dev/sr0: TSSTcorp  CDDVDW SH-S223Q   SB00  [cd/dvd]

INQUIRY fetching VPD page=0x83 failed

```

I tried different SATA cables, BIOS options, etc. to no effect. Googling around, I discovered that there seems to be a serious regression in the later kernels and many folks with many different distributions [/code]are having this problem. To test this, I hardmasked back to gentoo-sources-2.6.16, and tried my burner again. It worked flawlessly.

So, at this point, it appears to be a bug in the kernel. There are many conflicting reports online as to whether or not this is really fixed in the latest kernel releases. Some reports say yes, some say no. I can't seem to find a definitive answer on the kernel bug tracker. In any case, this is a really annoying bug because it renders my burner essentially useless. It's also a showstopper for a lot of people because it is causing a number of livecd installs to not boot. Some of the other postings I've seen on this forum about SATA boot failures seem to be related as well. 

So, if anyone has any more information about this problem, or can point me to a definitive link on the linux bugtracker that confirms the existence of this problem, and even better, a workaround, I'd greatly appreciate it.

----------

## KWhat

I am not going to call this solved yet but i did manage to get my drive working.

I moved to the 2.6.27-r7 kernel and disabled CONFIG_BLK_DEV_SR_VENDOR=N and now my drive appears to work.   Give it a shot and let me know if it works

----------

## radio_flyer

I'm now running 2.6.27-gentoo-r7 and still having the same problem. dmesg returns a number of messages like:

```

end_request: I/O error, dev sr0, sector 220688

Buffer I/O error on device sr0, logical block 55172

Buffer I/O error on device sr0, logical block 55173

sr 0:0:1:0: [sr0] Result: hostbyte=0x00 driverbyte=0x08

sr 0:0:1:0: [sr0] Sense Key : 0x3 [current]

sr 0:0:1:0: [sr0] ASC=0x11 ASCQ=0x5

end_request: I/O error, dev sr0, sector 220688

Buffer I/O error on device sr0, logical block 55172

Buffer I/O error on device sr0, logical block 55173

sr 0:0:1:0: [sr0] Result: hostbyte=0x00 driverbyte=0x08

sr 0:0:1:0: [sr0] Sense Key : 0x3 [current]

sr 0:0:1:0: [sr0] ASC=0x11 ASCQ=0x5

end_request: I/O error, dev sr0, sector 220688

Buffer I/O error on device sr0, logical block 55172

Buffer I/O error on device sr0, logical block 55173

```

In .config:

```

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

CONFIG_BLK_DEV_SR=y

# CONFIG_BLK_DEV_SR_VENDOR is not set

CONFIG_CHR_DEV_SG=m

# CONFIG_CHR_DEV_SCH is not set

```

After doing some more investigation and google research, I'm beginning to suspect I'm encountering two issues here:

My drive is bad, or at least 'weak'

The kernel handles errors differently now

According to online comments, the quality of DVD drives/burners isn't what it used to be, and my testing seems to bear that out, at least in this case. Comparing different CDs/DVDs on my old Samsung IDE drive and this new Samsung SATA drive show the new SATA drive to be slightly faster but far less tolerant of scratches, various brands of recordable media, etc. The dmesg output above, for example, is from a recorded CD that is read perfectly by my old IDE Samsung drive. I think the kernel has also become less tolerant recently--the drive isn't as happy with the way the kernel is talking to it and the kernel isn't happy with what the drive is reporting back. 

Reads and writes do eventually complete without errors in the resulting files (eg after the dmesg output above, and 10 seconds of hangup, I do eventually get a correct file), so it's hard to ascertain whether this is a real hardware problem, or the kernel being overly sensitive to a transient error/retry condition.

Hate to say it, but the solution here might be to play another round of optical drive roulette, buy another drive, and hope I don't get shot twice.

----------

## KWhat

This is everything I have.  You could be correct in that your drive may be bad.  Do you have a dual boot to windows to test?  or maybe a live cd?  I have the relevant sections from my kernel below.

One more thing, all your errors are at sector 220688, logical block 55172 and 55173.  If thats the same on all disks then your drives probably bad, or your disk maybe bad if it goes away.  The errors I was getting were at sector 0 block 1, 2 ,3 and so on.

```

#

# SCSI Transports

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_SCSI_SAS_LIBSAS is not set

# CONFIG_SCSI_SRP_ATTRS is not set

# CONFIG_SCSI_LOWLEVEL is not set

# CONFIG_SCSI_DH is not set

CONFIG_ATA=y

# CONFIG_ATA_NONSTANDARD is not set

CONFIG_ATA_ACPI=y

CONFIG_SATA_PMP=y

CONFIG_SATA_AHCI=y

# CONFIG_SATA_SIL24 is not set

CONFIG_ATA_SFF=y

# CONFIG_SATA_SVW is not set

# CONFIG_ATA_PIIX is not set

# CONFIG_SATA_MV is not set

CONFIG_SATA_NV=y

# CONFIG_PDC_ADMA is not set

# CONFIG_SATA_QSTOR is not set

# CONFIG_SATA_PROMISE is not set

# CONFIG_SATA_SX4 is not set

# CONFIG_SATA_SIL is not set

# CONFIG_SATA_SIS is not set

# CONFIG_SATA_ULI is not set

# CONFIG_SATA_VIA is not set

# CONFIG_SATA_VITESSE is not set

# CONFIG_SATA_INIC162X is not set

...

#

# SCSI device support

#

# CONFIG_RAID_ATTRS is not set

CONFIG_SCSI=y

CONFIG_SCSI_DMA=y

CONFIG_SCSI_TGT=y

# CONFIG_SCSI_NETLINK is not set

CONFIG_SCSI_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

CONFIG_BLK_DEV_SR=y

# CONFIG_BLK_DEV_SR_VENDOR is not set

CONFIG_CHR_DEV_SG=y

# CONFIG_CHR_DEV_SCH is not set

#

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

#

CONFIG_SCSI_MULTI_LUN=y

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

# CONFIG_SCSI_SCAN_ASYNC is not set

CONFIG_SCSI_WAIT_SCAN=m

#

# SCSI Transports

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_SCSI_SAS_LIBSAS is not set

# CONFIG_SCSI_SRP_ATTRS is not set

# CONFIG_SCSI_LOWLEVEL is not set

# CONFIG_SCSI_DH is not set

CONFIG_ATA=y

# CONFIG_ATA_NONSTANDARD is not set

CONFIG_ATA_ACPI=y

CONFIG_SATA_PMP=y

CONFIG_SATA_AHCI=y

# CONFIG_SATA_SIL24 is not set

CONFIG_ATA_SFF=y

# CONFIG_SATA_SVW is not set

# CONFIG_ATA_PIIX is not set

# CONFIG_SATA_MV is not set

CONFIG_SATA_NV=y

```

----------

