Saturday, June 28, 2008

SATA card on Dell Poweredge 600SC for Linux

Koutech PSA150

Would you recommend the product? yes | Price paid?: $13.99 | Rating: 9


Kernel (uname -r): 2.6.17.13-mm-desktop-3mdv
Distribution: Mandriva


PCI v2.2 compliant so I think it works with 3.3V PCI slot.

After plugging it into the sole PCI slot of Dell Poweredge 600SC, the system booted without the need to install any driver and it just worked as shown from lspci -v -nn:

00:03.0 RAID bus controller [0104]: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller [1095:3512] (rev 01)
Subsystem: Silicon Image, Inc. SiI 3512 SATARaid Controller [1095:6512]
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17
I/O ports at ecb8 [size=8]
I/O ports at ecb0 [size=4]
I/O ports at eca0 [size=8]
I/O ports at ec98 [size=4]
I/O ports at ec80 [size=16]
Memory at fe122000 (32-bit, non-prefetchable) [size=512]
Expansion ROM at fe000000 [disabled] [size=512K]
Capabilities: [60] Power Management version 2

The system was installed on a PATA drive and I didn't go into the bios of the card. Linux recognized the two distinct drives as /dev/sda and /dev/sdb. Since it's only fakeraid I configured it using Linux software RAID. And it seems to be working great.

Updates: Kernel upgraded to 2.6.26-server-0.rc8.1mnb
lsmod | grep ata
pata_serverworks 10624 0
sata_sil 11528 2
libata 152096 2 pata_serverworks,sata_sil
scsi_mod 136908 3 sd_mod,sg,libata
dock 11664 1 libata

Tuesday, June 24, 2008

Linux can't complete boot after migrating the root to a raid 1 volume

  • Reinstall Lilo to the MBR of the raid drives
  • I saw the following error after I migrated the / to a raid 1 /dev/md1
    setuproot: moving /dev failed No such file or directory
    setuproot: error mounting /proc: No such file or directory
    setuproot: error mounting /sys: No such file or directory
    switchroot: mount failed: No such file or directory

    It's because the old initrd.img might not invoke the mdadm command or the kernel module for the SATA controller to start the md array before accessing the root file system. This can be verified by
    lsinitrd /boot/initrd.img | grep mdadm
    lsmod | grep sata
    lsinitrd /boot/initrd.img | grep libata

    What I did is to reboot with a repair system, and type the following commands:
    mount /dev/md0 /mnt
    chroot /mnt
    mount /proc
    mount -n -t sysfs /sys /sys
    mv /boot/initrd.img /boot/initrd.backup
    mkinitrd -f --preload=libata --preload=scsi_mod /boot/initrd.img 2.6.26.20
    Then reinstall Lilo if necessary.
  • The content of the initrd.img file may be extracted by the following command
    gunzip < /boot/initrd.img | cpio -i --make-directories
  • Check the content of /dev folder before it's mounted as /dev. If there are any md* entries, delete them. Otherwise it may not boot successfully.
  • The libary package was in compatible with the upgraded e2fsprogs package. But the partition only needed check because the maximum mount count was exceeded. So in the "Repair Filesystem" mode, root can do the following:
    1. disable the fsck on a partition by running the command
      dumpe2fs -h /dev/hda1 | grep 'ount count'
      tune2fs -c 0 -i 0 /dev/hda1

      Reboot and no fsck error whatsoever.

    2. Remount the / to read and write
      mount -o remount,rw /
  • Create the software raid 1 with two sata drives



    1. mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
    2. Run diskdrake to set the mount point for /dev/md0 and mount it
    3. mdadm --examine --scan /dev/sda1 >> /etc/mdadm.conf
    4. Change the partition label with e2label /dev/md0 /home
    5. Manually start the array with mdadm -As /dev/md0
    6. Add auto=yes to the end of every ARRAY clause in /etc/mdadm.conf
    7. Add HOTPLUG_RC_scsi=yes into /etc/sysconfig/hotplug





      References:
    1. Mandriva Initscripts
    2. Choosing a Mandriva Kernel