• 05Oct
    Author: ben Categories: Infrastructure Comments: 0

    At Applied Trust one of our servers has a built-in SCSI disk with a single LVM volume group and several logical volumes. It also has an Apple Xserve array attached via an LSI Logic fibre channel card. The Xserve array has a second volume group with only a single logical volume. The filesystems on all the logical volumes need to be mounted at boot for the system to work properly. Unfortunately, there seems to be some bug in RHEL4 that prevents the second volume group from being detected at boot unless the SCSI adapter module (mptscsih in this case) is inserted with initrd. The Red Hat installation did not support this configuration.

    To fix it, I added a second SCSI adapter to /etc/modprobe.conf:

    alias scsi_hostadapter1 mptscsih

    then I rebuilt initrd for the kernel we’re using:

    % sudo /sbin/mkinitrd ./initrd.img 2.6.9-5.ELsmp

    I inspected the new initrd manually to make sure the module would be loaded:

    % mkdir initrd
    % cp initrd.img initrd
    % cd !$
    % cd initrd
    % gunzip -S .img initrd.img
    % cpio -i < initrd
    cpio: dev/ram: Operation not permitted
    cpio: dev/console: Operation not permitted
    cpio: dev/tty3: Operation not permitted
    cpio: dev/null: Operation not permitted
    cpio: dev/tty1: Operation not permitted
    cpio: dev/tty4: Operation not permitted
    cpio: dev/systty: Operation not permitted
    cpio: dev/tty2: Operation not permitted
    4742 blocks
    % cat init
    #!/bin/nash
    
    mount -t proc /proc /proc
    setquiet
    echo Mounted /proc filesystem
    echo Mounting sysfs
    mount -t sysfs none /sys
    echo Creating /dev
    mount -o mode=0755 -t tmpfs none /dev
    mknod /dev/console c 5 1
    mknod /dev/null c 1 3
    mknod /dev/zero c 1 5
    mkdir /dev/pts
    mkdir /dev/shm
    echo Starting udev
    /sbin/udevstart
    echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
    echo "Loading scsi_mod.ko module"
    insmod /lib/scsi_mod.ko
    echo "Loading sd_mod.ko module"
    insmod /lib/sd_mod.ko
    echo "Loading megaraid_mm.ko module"
    insmod /lib/megaraid_mm.ko
    echo "Loading megaraid_mbox.ko module"
    insmod /lib/megaraid_mbox.ko
    echo "Loading mptbase.ko module"
    insmod /lib/mptbase.ko
    echo "Loading mptscsih.ko module"
    insmod /lib/mptscsih.ko 
    echo "Loading dm-mod.ko module"
    insmod /lib/dm-mod.ko
    echo "Loading jbd.ko module"
    insmod /lib/jbd.ko
    echo "Loading ext3.ko module"
    insmod /lib/ext3.ko
    echo "Loading dm-mirror.ko module"
    insmod /lib/dm-mirror.ko
    echo "Loading dm-zero.ko module"
    insmod /lib/dm-zero.ko
    echo "Loading dm-snapshot.ko module"
    insmod /lib/dm-snapshot.ko
    /sbin/udevstart
    echo Making device-mapper control node
    mkdmnod
    echo Scanning logical volumes
    lvm vgscan --ignorelockingfailure
    echo Activating logical volumes
    lvm vgchange -ay --ignorelockingfailure VolGroup00
    echo Creating root device
    mkrootdev /dev/root
    umount /sys
    echo Mounting root filesystem
    mount -o defaults --ro -t ext3 /dev/root /sysroot
    mount -t tmpfs --bind /dev /sysroot/dev
    echo Switching to new root
    switchroot /sysroot
    umount /initrd/dev

    The bold section indicates that the mptscsih (and it’s dependency, mptbase) will be loaded by initrd.

    I moved the updated initrd to /boot:

    % sudo mv initrd.img /boot/initrd-2.6.9-5.ELsmp.atrust.img

    … then modified /boot/grub/grub.conf appropriately:

    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    #          initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Red Hat Enterprise Linux WS Atrust (2.6.9-5.ELsmp)
            root (hd0,0)
            kernel /vmlinuz-2.6.9-5.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.9-5.ELsmp.atrust.img
    title Red Hat Enterprise Linux WS (2.6.9-5.ELsmp)
            root (hd0,0)
            kernel /vmlinuz-2.6.9-5.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.9-5.ELsmp.img
    title Red Hat Enterprise Linux WS-up (2.6.9-5.EL)
            root (hd0,0)
            kernel /vmlinuz-2.6.9-5.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.9-5.EL.img

    Reboot for settings to take effect.

    [Slashdot] [Digg] [Reddit] [del.icio.us] [Technorati] [StumbleUpon]
    Tags:

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.