 {"id":238,"date":"2011-03-31T12:47:39","date_gmt":"2011-03-31T17:47:39","guid":{"rendered":"http:\/\/www.networkjack.info\/blog\/?p=238"},"modified":"2011-03-31T12:47:39","modified_gmt":"2011-03-31T17:47:39","slug":"debian-6-0-squeeze-on-xserve-g5-4tb","status":"publish","type":"post","link":"http:\/\/www.networkjack.info\/blog\/2011\/03\/31\/debian-6-0-squeeze-on-xserve-g5-4tb\/","title":{"rendered":"Debian 6.0 Squeeze on Xserve G5 with 4TB"},"content":{"rendered":"<p>As far as Apple servers go, Xserve G5s are now in a tight spot.<\/p>\n<ol>\n<li>Good: Reasonably fast CPUs, they are certainly powerful enough for most any internet based web site<\/li>\n<li>Good: They can take 8\/16GB of RAM<\/li>\n<li>Good: They support SATA disks so at least you can buy modern replacements.<\/li>\n<li>Bad: Mac OS X Server support halted at Leopard<\/li>\n<li>Good\/Bad: Hardware RAID works, for the <a href=\"\/blog\/2007\/10\/19\/apple-firmware-hard-drives-use-with-xserve-g5-hardware-raid-pci-card\/\">most<\/a> part.<\/li>\n<li>Good: FireWire 800<\/li>\n<li>Bad: Only one power supply<\/li>\n<li>Bad: Only 2 slots for expansion cards. No built-in video.<\/li>\n<li>Good\/Bad: Market value is pretty low right now.<\/li>\n<\/ol>\n<p>I&#8217;m not one to let extra server hardware lay around. I&#8217;ll find a use for it. I still have Xserve G4s in production. However, I&#8217;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.<\/p>\n<p>Some uses I can think of immediately:<\/p>\n<ol>\n<li>Dedicated MySQL replication slave &#8211; 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.<\/li>\n<li>Dedicated SpamAssassin, ClamAV scanners.<\/li>\n<li>Bulk mail relay\/mailing list server.<\/li>\n<li>DNS resolver<\/li>\n<li>Bulk File Delivery\/FTP Server<\/li>\n<li>Bulk Backup storage.<\/li>\n<li>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&#8217;s LV over to an image file on the Xserve G5.<\/li>\n<\/ol>\n<p>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.<\/p>\n<p><img decoding=\"async\" title=\"More...\" src=\"http:\/\/www.networkjack.info\/blog\/wp-includes\/js\/tinymce\/plugins\/wordpress\/img\/trans.gif\" alt=\"\" \/>As for configuration, the main thing I&#8217;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&#8217;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&#8217;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.<\/p>\n<h3>Partitioning and Basic Install<\/h3>\n<p>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:<\/p>\n<ol>\n<li>32k Apple partition map &#8211; created automatically by the partitioner<\/li>\n<li>1MB partition for the yaboot boot loader<\/li>\n<li>200MB partition for \/boot<\/li>\n<li>78GB partition for \/<\/li>\n<li>1.9GB partition for swap<\/li>\n<\/ol>\n<p>Things installed smoothly and without issue. Worked like a normal Debian install should. System booted fairly quickly; shutdown and cold-boot worked as expected.<\/p>\n<p>This partitioning setup comes from: <a title=\"Debian on XServe HOWTO\" href=\"http:\/\/lart.ca\/DebianOnXServeHOWTO.html\">XserveHowTo<\/a><\/p>\n<h3>Hardware RAID PCI card compatibility<\/h3>\n<p>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 <a href=\"\/blog\/2007\/10\/19\/apple-firmware-hard-drives-use-with-xserve-g5-hardware-raid-pci-card\/\">require<\/a> 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.<\/p>\n<h3>Software RAID and the SSD Boot disk<\/h3>\n<p>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.<\/p>\n<p>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&#8243; SSD into a caddy that replaces the optical drive and that would serve as my boot drive.<\/p>\n<p>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.<\/p>\n<p>I happened to have a 32GB IDE 2.5&#8243; 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.<\/p>\n<p>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&#8217;s much simpler to get the system installed on a setup that will be the final configuration.<\/p>\n<h4>Hard Disk Based Install<\/h4>\n<p>Basic outline:<\/p>\n<ol>\n<li>Format new HFS volume on a SATA disk<\/li>\n<li>copy the initrd.gz, vmlinux, yaboot and yaboot.conf files onto the disk.<\/li>\n<li>Place disk into ADM tray and insert into bay 1.<\/li>\n<li>Have a USB stick with the broadcom firmware <a href=\"http:\/\/packages.debian.org\/squeeze\/all\/firmware-bnx2\/download\">deb package<\/a> on it plugged into the server.<\/li>\n<li>Boot the machine into OpenFirmware (Cmd-Apple-O-F)<\/li>\n<li>issue command: boot hd:3,yaboot; If that doesn&#8217;t work try: boot hd:4,yaboot<\/li>\n<li>choose &#8220;install&#8221; from yaboot screen<\/li>\n<li>perform standard Debian installation<\/li>\n<\/ol>\n<p>From this point, on there aren&#8217;t really any differences between this system and any other debian install.<\/p>\n<h4>RAID and LVM<\/h4>\n<p>After installation is complete, shut the system down and insert the three 2TB disks and boot back up.<\/p>\n<p>Install MDADM and LVM packages:<\/p>\n<pre>apt-get install mdadm lvm2<\/pre>\n<p>Basic steps for creating the RAID 5 array:<\/p>\n<ol>\n<li>setting up partition table and single linux RAID partition on each 2TB drive<\/li>\n<li>creating RAID5 array with:\u00c2\u00a0\u00c2\u00a0 mdadm &#8211;level=raid5 &#8211;raid-devices=3\/dev\/sda2\/dev\/sdb2\/dev\/sdc2<\/li>\n<\/ol>\n<p>Logical Volume Manager setup:<\/p>\n<p>The idea here is to grab the entire 4TB logical disk designate it as a &#8220;physical volume&#8221; upon which we will put a single &#8220;Logical Volume Group&#8221; 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\u00c2\u00a0 section of the Logical Volume Group and do the same for potentially other purposes.<\/p>\n<p>Basic LVM setup commands:<\/p>\n<ol>\n<li>pvcreate \/dev\/md0<\/li>\n<li>vgcreate vg1 \/dev\/md0<\/li>\n<\/ol>\n<p>Here is the resulting disks and volume group:<\/p>\n<pre>root@debppc:~# df -h\r\nFilesystem\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 Size\u00c2\u00a0 Used Avail Use% Mounted on\r\n\/dev\/hda4\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 26G\u00c2\u00a0 722M\u00c2\u00a0\u00c2\u00a0 24G\u00c2\u00a0\u00c2\u00a0 3% \/\r\ntmpfs\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 492M\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0 492M\u00c2\u00a0\u00c2\u00a0 0% \/lib\/init\/rw\r\nudev\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 486M\u00c2\u00a0 204K\u00c2\u00a0 486M\u00c2\u00a0\u00c2\u00a0 1% \/dev\r\ntmpfs\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 492M\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0 492M\u00c2\u00a0\u00c2\u00a0 0% \/dev\/shm\r\n\/dev\/hda3\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 185M\u00c2\u00a0\u00c2\u00a0 31M\u00c2\u00a0 146M\u00c2\u00a0 18% \/boot\r\nroot@debppc:~# vgs\r\n VG\u00c2\u00a0\u00c2\u00a0 #PV #LV #SN Attr\u00c2\u00a0\u00c2\u00a0 VSize VFree\r\n vg1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0 0 wz--n- 3.64t 3.64t\r\n<\/pre>\n<p>Then:<\/p>\n<pre>lvcreate --size=1T --name iSCSIdiskA vg1\r\n<\/pre>\n<p>So to recap the layers involved here:<\/p>\n<ol>\n<li>3 physical 2TB disks, sda, sdb, sdc<\/li>\n<li>Linux RAID type partition on each, sda2, sdb2, sdc2 (powerpc partitioning likes to put a 32K Apple partition at the start)<\/li>\n<li>Software RAID5 combining the three RAID partitions into a single multi-disk device: md0<\/li>\n<li>LVM taking the entire md0 device as a Physical Volume for LVM<\/li>\n<li>A single Volume Group: vg1 built on that md0 Physical Volume<\/li>\n<li>A single 1TB Logical Volume carved out of the 4TB Volume Group<\/li>\n<li>iSCSI could then share that Logical Volume out as a &#8220;disk&#8221; 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&#8217;s mounted over an IP network.<\/li>\n<\/ol>\n<h3>Performance<\/h3>\n<p>Used to be that running RAID5 in software was &#8220;inconceivable!&#8221;, 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:<\/p>\n<pre>[\u00c2\u00a0\u00c2\u00a0 14.298984] raid6: int64x1\u00c2\u00a0\u00c2\u00a0 1006 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.370982] raid6: int64x2\u00c2\u00a0\u00c2\u00a0 1598 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.442974] raid6: int64x4\u00c2\u00a0\u00c2\u00a0 1769 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.514972] raid6: int64x8\u00c2\u00a0\u00c2\u00a0 1697 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.586965] raid6: altivecx1\u00c2\u00a0 2928 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.658965] raid6: altivecx2\u00c2\u00a0 3631 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.730951] raid6: altivecx4\u00c2\u00a0 4550 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.802961] raid6: altivecx8\u00c2\u00a0 3859 MB\/s\r\n[\u00c2\u00a0\u00c2\u00a0 14.807759] raid6: using algorithm altivecx4 (4550 MB\/s)\r\n[\u00c2\u00a0\u00c2\u00a0 14.816033] xor: measuring software checksum speed\r\n[\u00c2\u00a0\u00c2\u00a0 14.838951]\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8regs\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 :\u00c2\u00a0 5098.000 MB\/sec\r\n[\u00c2\u00a0\u00c2\u00a0 14.862951]\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 8regs_prefetch:\u00c2\u00a0 4606.000 MB\/sec\r\n[\u00c2\u00a0\u00c2\u00a0 14.886951]\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 32regs\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 :\u00c2\u00a0 5577.000 MB\/sec\r\n[\u00c2\u00a0\u00c2\u00a0 14.910951]\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 32regs_prefetch:\u00c2\u00a0 4828.000 MB\/sec\r\n[\u00c2\u00a0\u00c2\u00a0 14.915087] xor: using function: 32regs (5577.000 MB\/sec)\r\n<\/pre>\n<p>So, running software RAID 5 should have minimal effect on the overall performance of this machine.<\/p>\n<h3>Summary<\/h3>\n<p>I&#8217;ve been running the system for a couple of weeks and a couple of observations:<\/p>\n<ol>\n<li>the software RAID 5 has not been a big deal as far as I can tell.<\/li>\n<li> after installing the <em>hfsplus<\/em> 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.<\/li>\n<li>I installed and compiled in the iscsitarget kernel module and started creating iscsi target volumes for use on some other servers. very nice.<\/li>\n<li>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.<\/li>\n<li>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&#8217;s good\/bad I&#8217;m not sure.<\/li>\n<\/ol>\n<p>Overall, it&#8217;s been an interesting exercise and I&#8217;m really glad I could repurpose the machine into such a useful item.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No more PowerPC, no more Xserve: Debian to the rescue.<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"http:\/\/www.networkjack.info\/blog\/2011\/03\/31\/debian-6-0-squeeze-on-xserve-g5-4tb\/\">Continue reading<span class=\"screen-reader-text\">Debian 6.0 Squeeze on Xserve G5 with 4TB<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,7,8],"tags":[65,30,37],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-hardware","category-linux","category-servers","tag-debian","tag-ssd","tag-xserve","entry"],"_links":{"self":[{"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/posts\/238"}],"collection":[{"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":12,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":250,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions\/250"}],"wp:attachment":[{"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.networkjack.info\/blog\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}