Installing Fedora Core 5 x86_64 in a SATA Hard Disk with VIA VT8251 Controller.

Updates
Steps to create the Driver Disk (Dated: July 15, 2006): As promised earlier, I have written the steps, that I took, in creating the driver disk. You can find it here.
Kubuntu Live CD for VT8251: (Dated: July 15, 2006): James Muir has built a new Live CD (Kubuntu 6.06 with 2.6.17.3 kernel) to recognize VT8251 controlled SATA drives. Though I have not tried it, you can check it here.
NOTE: This is an external site. Please contact the author for any info/help/disclaimer regarding this Live CD.
Updated Driver Disk (Dated: June 24, 2006): Some persons have reported that the driver disk is not working in their setup. Hence, I have re-compiled the drivers and made few changes to the driver disk files. Few steps to use the driver disk has changed - please see below. I checked the new driver disk on few PCs with VT8251 SATA Controller & it is working fine. Please mail me your experience if you try it out.

Introduction

Hi there!

We recently received 54 new PCs having VIA® VT8251 SATA controller and AMD® Athlon® 64 CPU and SATA Hard Disk. But when we tried to install Fedora® Core 5 x86_64 to it, we found that the SATA HDD is not detected.

After searching the Net, I found that the existing Linux® kernel does not support this controller. VIA website has a patch for it, but it is for FC4.

Rajahuroman has painstakingly patched the ahci.c and sata_via.c (originally written by Jeff Garzik) source by hand so that it compiles in the latest kernels. I downloaded the two source files from his website and recompiled the FC5 x86_64 kernel with these two files. After inserting libata and the new sata_via modules, the SATA HDD was recognized properly.

Both the above two methods require an additional PATA HDD to first install the OS to it, then recompile the kernel and load the new modules. To install the OS directly, I needed either a Driver Disk or an Installation CD with the new kernel.

Petr Sulla has a very nice howto describing the steps required to build a custom Red Hat® Linux driver disk. Though it is dated 2001, it still worked in the latest Fedora version. After trying for some time, FC5 finally accepted my version as a driver disk ;-). The SATA HDD was detected during installation with this (so called) driver disk and the OS was finally installed without the help of any other HDD.

But the problem did not end there. The freshly installed OS refused to boot from the SATA HDD when I rebooted the PC after installation. Definitely, there is some mistake on my part. But as I had spent quite some time making the driver disk, I looked for some other options to make it work. I booted the PC into rescue mode along with the driver floppy, copied the module to the HDD, issued depmod and recreated the initrd image.

Finally, FC5 came to life using the existing SATA HDD. (Thank God!!!)

Though, this is not a good solution, I am nevertheless giving the driver disk and the steps, hoping that it will be of some use to people like me, until further help arrives.

The Steps

  1. First, download the driver disk file (kernel 2.6.15-1.2054_FC5 x86_64): tgz format or zip format.
  2. Take one full formatted DOS floppy and extract the downloaded archive to the floppy.
  3. Insert CD1 of FC5 installer and boot from it. At the boot: prompt, type linux dd
    boot: linux dd
    
  4. Select Yes when asked if you have a driver floppy.
  5. Select fd0 in the next prompt and then OK.
  6. Now, insert the driver floppy in the floppy drive and select OK to load the driver.
  7. When asked for loading any other driver disk, select No.
  8. Skip media check, if it has been already checked before.
  9. Now, the installer gives a warning message saying no hard disk has been found. Select Yes to load drivers now.
  10. In the Devices prompt, select Add Device. Scroll to VT8251 AHCI Controller (ahci) and select OK.
  11. Select Add Device again, scroll to VT8251 SATA 4-Port Controller (sata_via) and select OK.
  12. The installer should load the drivers and their names should be displayed in the Devices prompt. Select Done to continue.
  13. The SATA HDD should be detected during the partitioning step. Install the OS in the usual way.
  14. When the OS installation is complete, reboot the PC and insert the CD1 and the floppy disk again. At the boot: prompt, type linux rescue dd
    boot: linux rescue dd
    
  15. Load the driver as mentioned in steps 4, 5, 6, 7 above.
  16. Choose the appropriate Language and the Keyboard type in the next prompts.
  17. Select the ahci, sata_via drivers as mentioned in steps 9, 10, 11, 12 above.
  18. When asked for Network Setup, select No.
  19. Select Continue to mount the filesystem in read-write mode in the Rescue prompt.
  20. It should now search the root filesystem and mount it under /mnt/sysimage. Select OK to continue.
  21. Now, in the # prompt, type the following:
    # mkdir /tmp/ramfs/floppy
    # mount /dev/fd0 /tmp/ramfs/floppy/
    # cp /tmp/ramfs/floppy/x86_64/ahci.ko /mnt/sysimage/lib/modules/2.6.15-1.2054_FC5/kernel/drivers/scsi/
    # cp /tmp/ramfs/floppy/x86_64/sata_via.ko /mnt/sysimage/lib/modules/2.6.15-1.2054_FC5/kernel/drivers/scsi/
    # chroot /mnt/sysimage
    # cd boot/
    # depmod -av
    # mv initrd-2.6.15-1.2054_FC5.img initrd-2.6.15-1.2054_FC5.img.old
    # mkinitrd initrd-2.6.15-1.2054_FC5.img 2.6.15-1.2054_FC5
    
  22. Now, remove the floppy and the CD and press Ctrl-D twice to reboot the PC. On the next reboot, the Fedora Core 5 x86_64 should come to life!

Disclaimer

I have given the files and the steps here, so that it may be useful to someone. However, I shall not be responsible for any data loss, hardware loss, any kind of injury, waging of war etc. etc ;-) due to this work. Use entirely at your own risk!


For any comments or suggestions, you can flame me at:
rajib[AT]mail.com