How to fix slow boot with ATA errors

If you happen to own a weird TSSTcorp CDDVDW SH-S223C DVDRW device then your Linux probably takes a long time to boot, and if you boot without a splash screen you see a couple of errors like if your drive is faulty (which is not true since it’s a disc drive, not a hard drive):

ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata4.00: failed command: IDENTIFY PACKET DEVICE
ata4.00: cmd a1/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 in
ata4.00: status: { DRDY }
ata4: hard resetting link
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata4.00: configured for PIO4

On the Internet I read a suggestion to mess with udev rules in order to fix the issue. I found that you need to comment-out the following rule:

# ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode"

Here’s the code to make it quick and painless:

$ sudo sed -i '/ATAPI/,+1s/^/#/' /lib/udev/rules.d/60-persistent-storage.rules
$ sudo update-initramfs -u
$ sudo reboot now

Published on July 29, 2011 (over 6 years ago)

Article tags: libata, linux, udev

Comments (18)

Ed about 6 years ago

Can't thank you enough, I have spent almost a year putting up with this problem, for me it was stopping me booting 4 times out of 5. A couple of hours of google search I found this, Bingo all my dodgy booting gone!

Brilliant!

Thanks

Thanks! over 5 years ago

It worked for me too - never had a problem with the DVD drive but after changing it to HDD in a caddy this error was killing me. Now it works like a charm :)

Menno over 5 years ago

It worked for me too. Thanks.

Rob over 5 years ago

Cheers mate, you saved me a ton of messing around!

Evgeniy about 5 years ago

Thank you a lot.
You've saved my weekend!
Got new motherboard for my Gentoo desktop, thought it is a kernel driver problem. Apparently it is, but still fixable, thanks to you.

Grunt about 4 years ago

Changing SATA port on motherboard can fix that, also. You just have to plug your DVD reader to another port.

Randy almost 4 years ago

Awesome, Changed a 60 second boot time to about 5 seconds. Much appreciated

Ype almost 4 years ago

This works here too, thanks.

The rule appears to be extended over three lines, so I commented the three lines after ATAPI.

Fidel over 3 years ago

Great! Thank you for your solution.

Jesse over 3 years ago

You are a scholar and a gentleman! This problem still plagues Ubuntu up to and including version 14.04

I suppose it's probably my fault for buying the cheap DVDR at Microcenter, but you have made my Linux dual-boot system a lot less dependent on the dark side. Thank you.

James about 3 years ago

Thanks so much was about to give up on my Linux box but this really made a huge difference! I've added this script as an upstart script to execute on boot - that way the changes to UDev are manually rewritten by this clever patch. :)

Markus almost 3 years ago

I too have a TSSTcorp optical drive and the same symptoms. For me the reason actually was not in the drive. MSI motherboard I have has additional (crappy) sata-controller by Marvell which I use for the optical drive since all "real" ports are in use.

Modifying udev rules did not make any difference and in the end solution was to blacklist pata_marvell module in modprobe.conf and update initrd (to include that modprobe.conf). Apparently the marvell controller has both sata and pata though there is only physical connectors for sata, and the wrong module gets loaded which causes these errors and slow boot.

Jort over 1 year ago

Hi, thanks for this great workaround. While trying to get to a permanent solution, I've managed to update the drives firmware to SB07 (original SB04) which seems to have permanently fixed the whole problem for me. I would recommend trying it (and comment here if it does or doesnt work).

Mahmud about 1 year ago

Although it is an old post, can't thank you more for this.

french guy about 1 year ago

A huge thanks for this post ! It saved my parent's computer !

BrightOne 10 months ago

Worked like a charm for me! 60s => 6s! Thanks!

Roy 4 months ago

Thanks. These DVD drives live on and so does the cure! Nearly dumped the drive.

macronom 23 days ago

Very helpful, thanks.
I used this hit when I installed an Ubuntu system on my new computer some months ago. Now I needed it again, after a kernel update set back the old rule. Very annoying, but now this page is in my bookmarks. ;)