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