Connecting a XServe RAID to a (virtual) Linux host

The (now discontinued) Apple XServe RAID is a Fibre Channel connected array for those looking for cheap and fast storage without too much hardware redundancy. It’s use as a local storage source on an XServe is excellent bus when you want to share your data across the world over NFS or CIFS you can run into problems as the Mac OS X 10.5 Server is not yet very mature. I therefore decided to move the storage off to a PC and offer the storage with a NFS export to my entire network. This would keep my absolute file paths consistent across all connected systems and would be a lot cheaper than buying a dedicated NAS appliance from any vendor out there.

In my setup I would buy a server, install Xen (as a part of RHEL5) and dedicate one host to exporting an ext3 volume over NFS. The volume would reside on the XServe RAID and would connect over Fibre Channel to the server my means of a Fibre Channel HBA.

First of all it was tempting to figure out if it was possible to reuse the Fibre Channel PCI-X card in a PC. I ordered a HP DL160 with a PCI-X riser kit and gave it a try. Upon installing Red Hat Enterprise Linux 5.2 the Raid array showed up immediately as a valid drive to install RHEL on so the card was working. Success! After some research I found out that the card is in fact a LSI 7202XP PCI-X card that is still very well supported. You can find drivers, manuals and firmware here. I updated the firmware to version 1.02.23 (the Apple supplied firmware was from 2005). You can also update the BIOS on the card so it will be bootable as well but since this wasn’t my goal I skipped this step.
(I then configured my REHL setup to use persistent device names, this will help to prevent the /dev/sdX from changing but you might not need/want to do this. The instructions to do this are listed in Chapter 7 of part III in the virtualization manual from RH which can be found here.)
The next challenge is to deal with partitioning. This website came in handy to explain me some basics around Linux partitioning. Apparently using any drive larger than 2 TB as a boot volume would be difficult as this would require a MS-DOS based partioning scheme (a.k.a. disk label). The newer GPT scheme handles volumes over 2 TB quite well and I was not surprised to find that the XServe RAID was already set up as a GPT disk. In my case the XServe RAID could be found under /dev/sdc, the last letter can change depending how many drives are in your system (in my case 2 x HD and 1 XServe RAID). If you use the following command you’ll see that there are in fact 2 partitions already on the drive. On /dev/sdc2 was the data partition formatted as HFS+ and on /dev/sdc was… an EFI partition! as it was only 200 megabytes and it was hard to determine if it was required for booting up the XServe RAID I decided to let it sit around and to just repartition the 2nd partition with the following command:
mkfs.ext3 -m0 /dev/sdc2
This formats the data partition as an ext3 volume, the -m0 indicates that there will be no free swap space left. Since we do not use the volume to boot form there’s no point in wasting this space. If you want to see if it works you can mount the volume like this:
mount -t /dev/sdc2 /
And there you go, your XServe RAID as an ext3 volume on RH Linux!
If this all works it’s time to pipe our ext3 volume to Xen. This is something you *can* do in the GUI of the Virtual Manager. Add a new Disk, assign it to your partition and don’t forget to select in the somewhat oddly formed pop-up menu that you want to use it as a virtual disk.
Now because I have no clue how to use umount (you’ll have to unmount the volume before Xen can take it over) I rebooted the whole setup and launched Xen. The first thing you’ll notice is that there is no volume to be seen. That’s because you’ll have to configure it manually in /etc/fstab before it’ll work. This is the line I created for my XServe RAID:
/dev/xvdb               /mnt/data               ext3    defaults        0 0
Reboot your host and you can finally use your XServe RAID in your Xen host! You can now use it as an NFS host or infinite logging, have fun!
Advertisements

Comments are closed.

%d bloggers like this: