Wednesday, 16 July 2008

Ubuntu DVD Writing Lockups

I switched to Ubuntu from Slackware a couple of weeks ago now, and most of my hardware worked off the bat (it is worth noting that it all worked OK in Slackware).

There were two casualties, one was my onboard network card, the other was my DVD Writer. Luckily I don't burn DVDs all the time, but this weekend when I tried (after installing K3B) I found that the computer locked solid part way into the burn. Everything was frozen: mouse, keyboard, network, the lot.

On testing I found that my CD Writer (I've got a CD Writer and a DVD writer installed - don't ask) worked fine, but the DVD burner locked the PC solid every time, even when doing a simulated burn.

So what is going wrong? Windows XP can burn DVDs without problems. Slackware Linux can also burn DVDs without breaking a sweat. Ubuntu 8.04 - nope.

A bit of research courtesy of Google revealed that a lot of people have had this problem - and there is a solution to it.

Chances are if you are having this issue then your motherboard has either a VIA or AMD based chipset (mine is a VIA). Ubuntu have changed the way that IDE drives are accessed, switching to new pata_via and pata_amd modules from the original via82cxxx and amd74xx ones.

There is a problem with these modules, and that is that for some reason if you have a 40-wire IDE cable (the old fashioned black and grey one) attached to your burner it will fail to work reliably. Switching to a new 80-wire one (blue, grey and black) fixes the problem.

I've got to admit, I'm not keen on this as a solution. If the module doesn't detect the hardware configuration properly but other operating systems do then that suggests an inherent problem with the modules.

A bit more research revealed this to be a likely cause.

So, while we look for an 80-wire IDE cable to test this with, can we get the burning working again?

Yes we can.

A forum post here (which also includes the info on the 80-wire cable) gives the following advice (tweaked for the 2.6.24-19 kernel).

BIG FAT WARNING - You are responsible for any changes you make to your system - back up anything important before continuing. . . . .

0. download and unzip

1. sudo cp via82cxxx.ko amd74xx.ko /lib/modules/2.6.24-19-generic/kernel/drivers/ide/pci/

2. sudo depmod -a

3. sudo vi /etc/modprobe.d/blacklist-local

4. add 2 following lines:

blacklist pata_via
blacklist pata_amd

5. sudo update-initramfs -u

6. sudo reboot

You may also want to check your /etc/fstab if you have any custom drive mappings in here - as it will change your /dev/sd?? devices back to /dev/hd?? ones.

A big hint for this is to take advantage of the partition UUID when mapping your partitions.

You should see that Ubuntu has already mapped your root and swap partitions using UUID strings.

To convert your own fstab to UUIDs do the following (don't forget to take a copy of your existing fstab just-in-case):

1 - run the following command against the partition you want to change (change hdd7 to whatever your partition is), eg:

sudo vol_id /dev/hdd7

This will return the UUID of the partition.


2 - Next, open your fstab and amend the parition line to include your UUID

sudo gedit /etc/fstab

Change the line as follows:

/dev/hdd7 /mnt/linstor1 reiserfs defaults,noatime,nodiratime,data=writeback 0 0


UUID=c90cc868-2b06-4f77-9ddc-d0a7e16f200b /mnt/linstor1 reiserfs defaults,noatime,nodiratime,data=writeback 0 0

The UUID is constant regardless of whether the partition is recognised as hd?? or sd??.

Update 1: I've managed to get hold of a spare 80 wire IDE cable, so once I get the chance to strip my PC down I'll put things back so I'm using the pata_via module and test burning again.

Update 2: Strange but true, I've already got an 80 wire IDE cable installed, but just to show willing I swapped it for the new one, removed the replacement modules, basically undid everything I'd done to fix the problem and rebooted.

And. . . . . . . . .

It still freezes when burning DVDs. So at the moment my only choice is to use the replacment modules (and next kernel upgrade I might have to re-compile them myself).

Not fun. Not fun at all.


Anonymous said...

I had exactly the same problem that you describe with a DVD reader. Using an 80-wire cable instead of 40-wire solved my problem.

DanO said...

Yeah, using an 80 wire cable seems to work in most cases - unfortunately it didn't work for me (I was already using an 80 wire one, although just to be sure I did replace the original one with a new one).