TOPIC: Using the Apple Xserve RAID with Yellow Dog Linux...




Introduction

The latest YDL distribution contains the drivers for the Apple Fibre Channel PCI card, but you have to manually add them and recompile the kernel.

This document makes the following assumptions:
  • You have successfully installed Yellow Dog Linux.
  • The primary Yellow Dog Linux drive is an IDE device.
  • The "Everything" option was selected at the "Package Selection" part of the install.
  • You have installed the (2 port - 2 Gbps) copper Fibre Channel card that shipped with your Apple Xserve RAID.
  • You have the Apple Xserve RAID attached to the Fibre Channel card.
  • You don't have any data on your Xserve RAID that you want.

THE INSTRUCTIONS IN THIS DOCUMENT WILL DELETE ALL DATA ON YOUR Xserve RAID! These instructions are intended for use on a new Xserve RAID.


Fibre channel driver
  1. From the /usr/src/linux-2.4 directory, ensure a clean kernel source tree by executing the following command:
    make mrproper [ENTER]
  2. Make it so that the kernel knows that the Apple Fibre Channel PCI card drivers should be part of the config options by editing /usr/src/linux/arch/ppc/config.in.

    First, go to this directory and make a backup of the config file:
    cd /usr/src/linux/arch/ppc [ENTER]
    cp config.in config.bak [ENTER]
    Then edit the config.in file:
    pico config.in [ENTER]
    Find the line that contains "1394" and under it add:
    source drivers/message/fusion/Config.in
    
    Save this file.

  3. Next, backup your old config and launch menuconfig:
    cd /usr/src/linux-2.4 [ENTER]
    cp .config config.bak [ENTER]
    make menuconfig [ENTER]
  4. Now, enable support for the Apple Fibre Channel PCI card driver module:
    • arrow down to the 'Fusion MPT device support' item and hit enter
    • select the 'Fusion MPT (base + ScsiHost) drivers' option (hit the space bar until you see an '*')
    • arrow up to the 'Multi-device support (RAID and LVM) and hit enter
    • select the 'RAID support' option (hit the space bar until you see an '*')
    • select the 'RAID-0 (striping) mode' option (hit the space bar until you see an '*')
    • select the 'RAID-1 (mirroring) mode' option (hit the space bar until you see an '*')
    • select the 'Logical volume manager (LVM) support' option (hit the space bar until you see an '*')
    • save your changes by hitting 'esc' until you are prompted to save changes. Choose 'yes'.
  5. Next, compile the kernel:
    make dep [ENTER]
    make vmlinux [ENTER]
    strip vmlinux [ENTER]
  6. ...and the kernel modules:
    make modules [ENTER]
  7. Copy the newly created vmlinux, and System.map file to the /boot directory and create links to those files. First, copy the new files to the /boot directory with a unique name:
    cp /usr/src/linux/vmlinux /boot/vmlinux-YourIdStringHere [ENTER]
    cp /usr/src/linux/System.map /boot/System.map-YourIdStringHere [ENTER]
    Then re-target the links:
    ln -sf /boot/vmlinux-YourIdStringHere /boot/vmlinux [ENTER]
    ln -sf /boot/System.map-YourIdStringHere /boot/System.map [ENTER]
  8. Next, edit the yaboot.conf file so that you can boot from your new kernel:
    pico /etc/yaboot.conf [ENTER]
    Go to the end of the document and type in the following new boot option [1]:
    image=/boot/vmlinux-YourIdentifierStringHere
    	label=vmlinux-YourIdentifierStringHere
    	root=/dev/hda4
    	append="hdc=idescsi"
    	novideo
    
    Write these changes back to the file and quit.

  9. For these changes to take effect you must update the Open Firmware boot options:
    ybin -v [ENTER]
  10. Reboot using the new kernel:
    shutdown -r now [ENTER]
  11. Wait for the 'boot:' prompt. Hit 'tab' at the 'boot:' prompt. This should give you a list of the available kernels. Choose the kernel that you just made:
    vmlinux-YourIdStringHere [ENTER]
  12. Use dmesg to verify that the fusion driver has loaded and determine which devices it has recognized:
    dmesg | less [ENTER]
    • use the down arrow to scroll down until you see some messages that start with fusion
    • immediately under them there should be one or two messages like "Attached scsi disk sda at scsi1..."
    • make a note of the device names from the above string: (e.g. sda, sdb, sdc, etc...)


Apple RAID utility
  1. Make sure that the Apple RAID box has an ethernet link to the host system.

  2. Verify that you are running a dhcp server on the host system. The Apple RAID box will expect to be given an address via dhcp.
    ps aux | grep dhcpd [ENTER]
  3. Confirm that you have a Java2 JRE installed. If you do not have a Java2 JRE installed you can install one with:
    yum install IBM-Java2-JRE [ENTER]
  4. Next, mount the CD that came with the Apple RAID box:
    mount /mnt/cdrom [ENTER]
    cd /mnt/cdrom [ENTER]
    cd "raid admin"/"raid adminapp"/contents/resources/java [ENTER]
  5. To run this utility you must have a running X server. Start raid admin with:
    /opt/bin/java -jar raid_admin.jar [ENTER]
  6. Once you have passed the license screen, click on "Add System".


    Apple RAID main window


  7. You will be prompted for the IP address of the Apple RAID box.


    Apple RAID add system window


    To find out what address your dhcp server has assigned the Apple RAID box:
    cat /var/log/messages | grep DHCPACK [ENTER]
    The most recent line should contain your Apple RAID box's IP address.

  8. The default passwords are 'private' for the management password and 'public' for the monitoring password. When you are done, click on "Add".

  9. The Apple RAID box will now start setting up its RAID volumes. This process will take a day or so. The RAID type defaults to RAID 5. To use a different RAID level you must select "Delete Array" to free up some drives. Then choose "Create Array".


    Apple RAID add array window


    Apple provides further instructions on using this application.

  10. To install the Apple RAID application locally:
    mkdir ~/apple_raid [ENTER]
    cp *.jnilib *.dylib raid_admin.jar ~/apple_raid [ENTER]


Individual Volumes

NOTE: For individual volumes the same way they were set up in OS X conduct steps 1B-5B for for all of the devices exposed by step 11 in the first section.

  1. Use pdisk to initialize the disk and create the partitions, (this example uses the device sda):
    pdisk /dev/sda [ENTER]
    'p' (prints the partition table)
    'd' (deletes partitions, you should delete all but the Apple_partition_map)
    'w' (writes the partition table)
    'c' (creates a new linux partition, use the value '2p' for the starting sector and length)
    'w' (writes the partition table)
    'q' (quits pdisk)
  2. Create a file system:
    mkfs /dev/sda2 [ENTER]
  3. Create a mount point for the new file system:
    mkdir RAID1 [ENTER]
  4. Mount the volume:
    mount /dev/sda2 /mnt/RAID1 [ENTER]
  5. Check to make sure the volumes are recognised by the OS:
    df [ENTER]
    This should show the mounted volumes, their paths, sizes, and free/used space.



Single RAID 0 Volume
To create a single RAID 0 volume of the 2 Xserve RAID volumes (assuming that you have 1 volume per controller), conduct steps 1C-2C for for both of the devices exposed by step 10. You will only have to do steps 3C-7C once.

  1. Use pdisk to initialize the disk and create the partitions, (this example uses the device sda):
    pdisk /dev/sda [ENTER]
    'p' (prints the partition table)
    'd' (deletes partitions, you should delete all but the Apple_partition_map)
    'w' (writes the partition table)
    'c' (creates a new linux partition, use the value '2p' for the starting sector and length)
    'w' (writes the partition table)
    'q' (quits pdisk)
    Do this for both volumes.

  2. Create a /etc/raidtab file, (this example uses the devices sda and sdb):
    pico raidtab [ENTER]
    Type the following (use tabs for the indenting):
    raiddev /dev/md0
    	raid-level			0
    	nr-raid-disks			2
    	persistent-superblock		0
    	chunk-size			128
    
    	device			/dev/sda2
    	raid-disk			0
    	device			/dev/sdb2
    	raid-disk			1
    
    Exit from editing mode and save the file.

  3. Use the mkraid utility to establish the links between the disks that will be utilized by the RAID services:
    mkraid /dev/md0 [ENTER]
  4. Create a file system:
    mkfs /dev/md0 [ENTER]
  5. From the /mnt directory, create a mount point:
    mkdir RAID [ENTER]
  6. Mount the volume:
    mount /dev/md0 /mnt/RAID [ENTER]
  7. Check to make sure the volumes have been recognized:
    df [ENTER]
    This should show the mounted volumes, their paths, sizes, and free/used space.



Notes
[1] You will need to use the device your system is currently booting from here, (e.g. hda3, hda4, hda5, etc...). Just look at the entries that are already in the yaboot.conf file to determine your current boot device.

This HOWTO was written by Andrew James, Terra Soft Solutions



 
          Copyright ® 1999-2010. Fixstars Corporation. All rights reserved.
YDL.net Fixstars Corporation