arch detail

arch detail

Wednesday, April 23, 2008

PCI-SATA/Ubuntu misadventures

So, I finally decided it was time to drop the Windows/Cakewalk life for good and install UbuntuStudio (well, Ubuntu, then later upgrade to UbuntuStudio) on my Athlon XP+ recording machine.

I had this brilliant idea to put / onto a SATA disk, both because I had one laying around and because it would be better for recording and pretty much any other media-centric task. Unfortunately, my motherboard does not support SATA!

So for <$40 I got a PCI-SATA adapter (VIA chipset). Happily, my Ubuntu LiveCD detected the attached SATA disk and was more than happy to install on it.

(correction to the above: I had sporadic freezes, but managed several successful installs. However, I do think faulty SATA or PCI-SATA adapter drivers were responsible. running "tail -f /var/log/messages" I was able to see many odd messages; not positive if updated drivers will fix this or it will become a persistent problem.)

Unfortunately, on attempting to boot into the newly-installed environment, I got an ever-so-helpful numeric error from GRUB, in this case, "Error 21". I tried re-running grub-install and editing my /boot/grub/menu.lst on the newly-created system, suspecting that my BIOS might be renumbering my drives when it tried to boot from the MBR of the SATA disk. No dice. At some point I managed to move from "Error 21" in GRUB to a straight "HARD DRIVE BOOT ERROR" from my BIOS.

I heard quite a few suggestions, but really, the Internet has not been much help on this one. I suspected GRUB itself was the problem.

So I tried using SuperGrub, which is basically just GRUB with lots of fancy features and burnable to CD (or copy-able to floppy, or to USB stick, and so on).

Running in SuperGrub, I was able to discover that though grub-install and the grub shell could happily find my SATA disk when running inside of a GNU/Linux LiveCD environment, GRUB itself had no idea. It was totally unable to see the SATA disk. So apparently what happened was that BIOS boots off the MBR, GRUB gets control of the system, and then, well, nothing. GRUB can't find its own files.

So, as a result, I had to do something ugly: I put /boot on a spare IDE disk I had lying around (one which, admittedly, I don't 100% trust, as it had a CRC error once or twice) and put / on the SATA disk. Ubuntu's installer went very nicely from there. Not particularly elegant, but it is effective.

I'm now happily writing you from Ubuntu. It's much faster than my Gentoo machine, but I don't know why; Firefox (even on Windows) was always faster on my Athlon XP+ 3500 than my Gentoo P4 (1.8 GHz), either because of my inability to intelligently manage libraries/drivers on Gentoo, or because the P4 is held back by its weak floating point unit. The SATA certainly doesn't seem to hurt, either; I boot in record time and applications open with wonderful snappiness.

In conclusion: SATA is great, but don't try to rely on it as a boot disk if you're connected via a PCI-SATA card adapter.