Wednesday, June 18, 2008

ASUS 5PQ Deluxe, Fedora 9 and Marvell IDE

My old computer has died a few weeks ago (Mobo), and I decided to wait a little to get a brand new, shiny ASUS P5Q Deluxe motherboard, with Express Gate SSD (which _really_ rocks!)
Among the parts that could have been reused there was the chasis (with power supply), and an IDE hard disk, which - as you may guess - contained valuable data, and a DVD drive. I also wanted to add another hard disk - I decided to buy a 300 GB SATA-II disk.
After initial euphoria of Express Gate, I decided to install Fedora Core 9, to bring my computer back to full usability (so that my wife could check email, play music and films, and such. I connected my old-good PATA (IDE) hard disk, and DVD drive to the IDE port on P5Q Deluxe and hoped everything would be fine. Note that all these modern MoBos have SATA connectors for disks now, and they provide "legacy" support for IDE (aka "PATA") drives using an external chipset: in the case of my P5Q Deluxe, this is Marvell 88SE6121.
Happy and self-confident, I put my "Fedora 9 KDE Live CD" into the DVD drive and tried to boot. After a few moments, I've seen a nice Fedora splash screen, I told it to go on, and ... it failed. It told it cannot find the device, or something... That's not nice... I double-checked cables, jumpers, etc - nothing. So I plugged my USB DVD writer, inserted the Live CD into it and reboot. This time it booted smoothly. I decided to install Fedora on the hard disk - the installer found my new SATA disk with no problem, I partitioned it, and in no time it was ready. The thing that struck me at that moment was that the installer didn't see my "old" IDE disk... In fact I expected this after encountering the problem with installation from my IDE DVD drive.
Hoping for good, I rebooted the machine. It booted to my harddisk-installed Fedora, still it didn't show my old disk! No panic - I thought to myself...
After playing with various settings in BIOS (such as switching the SATA mode from IDE, to RAID, and AHCI), and endless reboots, I still didn't get it working.
So I turned my attention to the Linux kernel modules. What I found out is that there are two potentially interesting ones: the "ahci" and "pata_marvell". After a clean boot, both of them seemed to be loaded. I tried my luck at unloading/reloading them in random order and ... guess what: I managed to get my old hard disk! It turned out that one should REMOVE the "ahci" driver, then load "pata_marvell"... And how to automatize this? You simply edit the /etc/modprobe.d/blacklist file, and add the line with content: "blacklist ahci". And that's it!
Probably there must be some conflict between the two drivers, and "ahci" was preempting the "pata_marvell" during boot. After you `blacklist` the "ahci" you could see the IDE devices again.
This does not probably solve the problem with Fedora installation though (yet, you could try to do "rmmod ahci;rmmod pata_marvell; modprobe pata_marvell" when you get dropped to the emergency shell).
Hope this may help to some of you.

1 comment:

Philippe said...

Everything works fine now with since kernel 2.6.27_rc6

http://www.kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.27-rc6