Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On an Ubuntu 10.04 machine, with an LG model GH22NS40 optical drive connected on an Intel 82801IR/IO/IH (ICH9R/DO/DH) 4-port SATA IDE Controller, with a P5E WS Pro motherboard, burning an ISO file to a standard blank DVD-R DVD by running the command

nice -n 18 ionice -c3 growisofs -dvd-compat -Z /dev/dvd1="video.iso"

causes the computer to freeze (can't type in vim, can't render Firefox screens, etc.), sometimes for several minutes, while the output

Executing 'builtin_dd if=video.iso of=/dev/dvd1 obs=32k seek=0'

is displayed. The commands "top" and "atop" do not show any unusual drain on resources, and I would have expected that including the "ionice" command would prevent this sort of freeze. Can anyone identify the problem and suggest a solution?

share|improve this question

2 Answers 2

I believe I have discovered the solution to this problem, thanks to the insightful observation from Thomas Schmitt, whom I warmly thank!

In the BIOS setup utility of ASUS's P5E WS Pro motherboard, under "SATA Configuration," the "Configure SATA as" option can be set to IDE, RAID, or AHCI. At the time I installed the Ubuntu operating system, I left this option as IDE, which is the default setting (perhaps for the benefit of Windows XP users; see below). From the manual: "If you want to use the Serial ATA hard disk drives as Parallel ATA physical storage devices, keep the default setting (IDE)."

To fix the problem of the computer freezing when writing to media using the optical drive, I went into the BIOS and changed the "Configure SATA as" option to AHCI. From the manual: "The AHCI allows the onboard storage driver to enable advanced Serial ATA features that increases storage performance on random workloads by allowing the drive to internally optimize the order of commands." I warn readers that making this change may not be safe, or may not be safe after the operating system has already been installed. An Internet search reveals that Windows users have encountered problems booting their computers after making such a change. I can only testify that on my computer, running Ubuntu 10.04, I had no such problems. It seems that the AHCI drivers are installed by default in Ubuntu 10.04 (and, I would expect, later Ubuntu versions) but not, for example, in Windows XP.

I did encounter two minor problems after making the change. First, after rebooting, an SCSI disk assigned to /dev/sdc was reassigned to /dev/sdd, and vice versa for an SCSI disk that had been assigned to /dev/sdd. As I had previously added lines to my /etc/fstab file providing mount points for /dev/sdc1 and /dev/sdd1, I was temporarily unable to access these drives until after editing my /etc/fstab file appropriately. (This problem probably would not have occurred if I had used UUIDs to identify the devices in /etc/fstab instead of /dev/sd....)

The second minor problem was that I had to reset my Ethernet eth0 connection information following the first reboot after changing IDE to AHCI. In Ubuntu 10.04 this could be done in System -> Preferences -> Network Connections: under IPv4 settings, the address, netmask, and gateway had to be reset to how I previously had them.

Neither of the two minor problems has recurred after multiple subsequent reboots.

After the change from IDE to AHCI, the command "lspci -k" reports for "SATA controller Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA AHCI Controller (rev 02)" (previously listed as "IDE interface Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 4 port SATA IDE Controller (rev 02)"), "Kernel driver in use" has changed from "ata_piix" to "ahci." The listing for "IDE interface: Marvell Technology Group Ltd. 88SE6145 SATA II PCI-E controller (rev a1)" is unchanged after the switch from IDE to AHCI ("Kernel driver in use" was and is "pata_marvell"). Also, opening System -> Administration -> Disk Utility, I find the hard drives and the optical drive that had been giving me problems are now organized under "SATA Host Adapter" with the 82801IR/IO/IH hardware listing. As I recall, before the change Disk Utility placed them under 82801IR/IO/IH labeled as "PATA Host Adapter."

Since making the change, the command

nice -n 18 ionice -c3 growisofs -dvd-compat -Z /dev/dvd1="video.iso"

does not appear to slow the computer in any perceptible way. I've tried a little bit of benchmarking, such as writing a few megabytes of data to various hard drives after starting the above command and without it with the computer similarly engaged: both wall time and CPU time seem to fall well within the normal range when the command is running (and in particular when it is starting, the problem period before). The problems I had observed immediately after the command when using vim and Firefox do not seem to occur anymore.

share|improve this answer

this behavior would be plausible if the DVD burner and the hard disk would sit as master and slave on the same PATA controller (e.g. as /dev/hda and /dev/hdb). But with SATA this should not happen.

Nevertheless, did you already try to connect the burner to a different SATA socket ? (That's what could help with PATA.)

Have a nice day :)

Thomas

share|improve this answer
    
Thank you. I'd prefer to rewire my hardware only as a last resort. In light of your observation about PATA vs. SATA, I ran "lspci -k" and found that for the IDE interface Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 4 port SATA IDE Controller (rev 02), it reported: "Kernel driver in use: ata_piix." Does this mean the problem is that my computer is in IDE emulation mode? If so, can the problem be fixed in the BIOS by changing the SATA configuration from IDE to AHCI, assuming it's currently set to IDE? (I'm asking before doing it in case you know of a risk in making this change.) –  Maneesh Patel Jul 20 '13 at 3:53
    
Oops, can't edit after 5 min. Perhaps more relevant, for the IDE interface Marvell Technology Group Ltd. 88SE6145 SATA II PCI-E controller (rev a1), it reported: "Kernel driver in use: pata_marvell," "Kernel modules: pata_marvell, ahci." Also, Disk Utility is listing these devices as PATA host adapters. –  Maneesh Patel Jul 20 '13 at 4:08
    
For Windows users reading this, I should point out that changing the SATA configuration from IDE to AHCI in the BIOS after OS installation can cause major boot problems (or so a Web search seems to reveal). As mentioned, I am running Ubuntu 10.04, and it is claimed at techsupportforum.com/forums/f64/… that making this change to an existing system in the BIOS will not cause these boot problems in Ubuntu. Can someone confirm that the change is harmless? (I'm quite averse to wrecking my OS just to expedite disk burning.) –  Maneesh Patel Jul 20 '13 at 4:40
    
As far as i know, SATA hardware is not organized in master/slave pairs. But it might be that the PATA driver modules and the IDE emulation of the hardware produce similar deadlocks as real PATA master/slave concurrency. Have a nice day :) Thomas –  Thomas Schmitt Jul 20 '13 at 7:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.