As far as Apple servers go, Xserve G5s are now in a tight spot.
- Good: Reasonably fast CPUs, they are certainly powerful enough for most any internet based web site
- Good: They can take 8/16GB of RAM
- Good: They support SATA disks so at least you can buy modern replacements.
- Bad: Mac OS X Server support halted at Leopard
- Good/Bad: Hardware RAID works, for the most part.
- Good: FireWire 800
- Bad: Only one power supply
- Bad: Only 2 slots for expansion cards. No built-in video.
- Good/Bad: Market value is pretty low right now.
I’m not one to let extra server hardware lay around. I’ll find a use for it. I still have Xserve G4s in production. However, I’d like to see a more up to date, leaner OS run on it and Debian keeps a very good port up to date for PowerPC. With the latest rev, 6.0, just released, I thought I would combine the two and see what results. My main goal is to be able to continue to use these machines for certain specific tasks and not have to rely on Apple to keep the OS up to date, as Leopard support will surely drop pretty soon.
Some uses I can think of immediately:
- Dedicated MySQL replication slave – with enough disk space and RAM, I can create multiple instances of MySQL configured to replicate from our different Master Servers and perform mysqldumps for backup purposes on the slaves instead of the masters.
- Dedicated SpamAssassin, ClamAV scanners.
- Bulk mail relay/mailing list server.
- DNS resolver
- Bulk File Delivery/FTP Server
- Bulk Backup storage.
- iSCSI target for some of the Xen-based virtualization we have been doing. Makes it easy to backup the logical volume for a domU. Just mount the iSCSI target from within dom0 and dd the domU’s LV over to an image file on the Xserve G5.
First goal is to determine how easy it is to install/manage this kind of setup. Second is to define how well the system performs under load.
As for configuration, the main thing I’m curious about is whether the Hardware RAID PCI card works and is manageable from within Debian. I would likely choose to not use that card, as doing so would require more stringent/expensive disk options and would take another PCI slot. In the end, I’ll likely lean towards a small SSD to use for the Boot volume and then software RAID mirror 2 largish SATA drives in the other bays. I don’t expect to use this system for large amounts of transaction work, so something reliable and large is the goal as we want to extend the life of this system another couple of years.
Partitioning and Basic Install
Using just a plain 80GB SATA disk in Bay 1, I was able to install from the NetInstall CD without issue. The critical item appears to be creating a set of partitions correctly to make sure the OpenFirmware will boot the system correctly:
- 32k Apple partition map – created automatically by the partitioner
- 1MB partition for the yaboot boot loader
- 200MB partition for /boot
- 78GB partition for /
- 1.9GB partition for swap
Things installed smoothly and without issue. Worked like a normal Debian install should. System booted fairly quickly; shutdown and cold-boot worked as expected.
This partitioning setup comes from: XserveHowTo
Hardware RAID PCI card compatibility
I dropped in one of these cards and a set of 3 Apple firmware drives I have laying around and booted the system off the CD. Unfortunately, I immediately started getting some spurious failures with the keyboard/video/network. No problem, to keep using that card with bigger drives will require buying expensive Apple-firmware drives. No thanks. This is a simple bulk data server, so I pull the card out and now that leaves me a slot for another NIC or some other card.
Software RAID and the SSD Boot disk
Linux also has a software RAID 5 capability, so the goal will be to use 2TB SATA disks in each of the three drive bays. Then use software RAID5 to create a 4TB array. One important thing to note when putting these newer bigger disks into the Xserve: make sure to put the jumper on the drives pins to force SATA 1 (1.5Gps) mode. Otherwise the SATA bus on the Xserve will not recognize the drive. Your tray will simply have a continuously lit activity LED.
With the 3 drive bays occupied by the 2TB drives, instead of configuring and installing the OS on the RAID5 array, I thought I would be clever and put a simple little 2.5″ SSD into a caddy that replaces the optical drive and that would serve as my boot drive.
The optical drive in the Xserve G5 is an IDE model, but no worry, you can purchase a caddy with an IDE host interface and a SATA disk interface. The caddy has a IDE/SATA bridge built into it.
I happened to have a 32GB IDE 2.5″ SSD, so I got a straight IDE/IDE caddy. Ultimately, you will want to have that drive in place when you run the installer which turns out to not be so easy, but it is doable.
The general outline for this install is: perform a hard drive media install with an HFS formatted SATA disk in Bay 1. Install to the SSD in the optical caddy, then setup the MD RAID5 device comprising of the 3 x 2TB disks AFTER you get the system setup and running on the SSD. Because of the peculiarities of OpenFirmware and the yaboot boot loader, it’s much simpler to get the system installed on a setup that will be the final configuration.
Hard Disk Based Install
Basic outline:
- Format new HFS volume on a SATA disk
- copy the initrd.gz, vmlinux, yaboot and yaboot.conf files onto the disk.
- Place disk into ADM tray and insert into bay 1.
- Have a USB stick with the broadcom firmware deb package on it plugged into the server.
- Boot the machine into OpenFirmware (Cmd-Apple-O-F)
- issue command: boot hd:3,yaboot; If that doesn’t work try: boot hd:4,yaboot
- choose “install” from yaboot screen
- perform standard Debian installation
From this point, on there aren’t really any differences between this system and any other debian install.
RAID and LVM
After installation is complete, shut the system down and insert the three 2TB disks and boot back up.
Install MDADM and LVM packages:
apt-get install mdadm lvm2
Basic steps for creating the RAID 5 array:
- setting up partition table and single linux RAID partition on each 2TB drive
- creating RAID5 array with:Â Â mdadm –level=raid5 –raid-devices=3/dev/sda2/dev/sdb2/dev/sdc2
Logical Volume Manager setup:
The idea here is to grab the entire 4TB logical disk designate it as a “physical volume” upon which we will put a single “Logical Volume Group” for LVM to manage. That way we can create seperate Logical Volumes within the VG for different purposes. iSCSI target support will want to use a LV, so we can easily carve out a 1TBÂ section of the Logical Volume Group and do the same for potentially other purposes.
Basic LVM setup commands:
- pvcreate /dev/md0
- vgcreate vg1 /dev/md0
Here is the resulting disks and volume group:
root@debppc:~# df -h Filesystem           Size Used Avail Use% Mounted on /dev/hda4             26G 722M  24G  3% / tmpfs                492M    0 492M  0% /lib/init/rw udev                 486M 204K 486M  1% /dev tmpfs                492M    0 492M  0% /dev/shm /dev/hda3            185M  31M 146M 18% /boot root@debppc:~# vgs VG  #PV #LV #SN Attr  VSize VFree vg1   1  0  0 wz--n- 3.64t 3.64t
Then:
lvcreate --size=1T --name iSCSIdiskA vg1
So to recap the layers involved here:
- 3 physical 2TB disks, sda, sdb, sdc
- Linux RAID type partition on each, sda2, sdb2, sdc2 (powerpc partitioning likes to put a 32K Apple partition at the start)
- Software RAID5 combining the three RAID partitions into a single multi-disk device: md0
- LVM taking the entire md0 device as a Physical Volume for LVM
- A single Volume Group: vg1 built on that md0 Physical Volume
- A single 1TB Logical Volume carved out of the 4TB Volume Group
- iSCSI could then share that Logical Volume out as a “disk” which is seen as a block-level device to be mounted on another computer which can format/partition as it sees fit. Even a Mac with iSCSI initiator driver, which could be in another country since it’s mounted over an IP network.
Performance
Used to be that running RAID5 in software was “inconceivable!”, but the Linux folks have latched onto the great SIMD engines that the chip manufacturers have put into their products over the years and are using that hardware directly to support RAID xor/parity operations. From dmesg:
[  14.298984] raid6: int64x1  1006 MB/s [  14.370982] raid6: int64x2  1598 MB/s [  14.442974] raid6: int64x4  1769 MB/s [  14.514972] raid6: int64x8  1697 MB/s [  14.586965] raid6: altivecx1 2928 MB/s [  14.658965] raid6: altivecx2 3631 MB/s [  14.730951] raid6: altivecx4 4550 MB/s [  14.802961] raid6: altivecx8 3859 MB/s [  14.807759] raid6: using algorithm altivecx4 (4550 MB/s) [  14.816033] xor: measuring software checksum speed [  14.838951]   8regs    : 5098.000 MB/sec [  14.862951]   8regs_prefetch: 4606.000 MB/sec [  14.886951]   32regs   : 5577.000 MB/sec [  14.910951]   32regs_prefetch: 4828.000 MB/sec [  14.915087] xor: using function: 32regs (5577.000 MB/sec)
So, running software RAID 5 should have minimal effect on the overall performance of this machine.
Summary
I’ve been running the system for a couple of weeks and a couple of observations:
- the software RAID 5 has not been a big deal as far as I can tell.
- after installing the hfsplus debian package I was able to attach and mount a firewire drive with data I wanted to move over quickly from a Mac OS X Server.
- I installed and compiled in the iscsitarget kernel module and started creating iscsi target volumes for use on some other servers. very nice.
- I configured my network interfaces using some clever ip route statements I found to attach and dedicate a different gigabit NIC for iSCSI purposes even though both interfaces are on the same subnet.
- The performance on the system is adequate, but not stupendous. I was copying about 300GB worth of MySQL tables from a database server using an iSCSI target volume and the load on the Xserve stayed around 8 for a couple of hours. Whether that’s good/bad I’m not sure.
Overall, it’s been an interesting exercise and I’m really glad I could repurpose the machine into such a useful item.