<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pixelchaos.net &#187; Debian</title>
	<atom:link href="http://www.pixelchaos.net/category/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelchaos.net</link>
	<description>random bits for your terminal</description>
	<lastBuildDate>Tue, 29 Sep 2009 11:38:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>install debian directly onto an AoE root filesystem</title>
		<link>http://www.pixelchaos.net/2009/05/25/install-debian-directly-onto-an-aoe-root-filesystem/</link>
		<comments>http://www.pixelchaos.net/2009/05/25/install-debian-directly-onto-an-aoe-root-filesystem/#comments</comments>
		<pubDate>Tue, 26 May 2009 02:23:16 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=131</guid>
		<description><![CDATA[Something that just about no one out there seems to be doing (yet) is trying to install Debian directly onto network block devices. The Debian installer doesnt support it (yet), grub doesnt support it (usually), and its just generally not an easy thing to do.
Now, there are quite a few ways around this problem. You [...]]]></description>
			<content:encoded><![CDATA[<p>Something that just about no one out there seems to be doing (yet) is trying to install Debian directly onto network block devices. The Debian installer doesnt support it (yet), grub doesnt support it (usually), and its just generally not an easy thing to do.</p>
<p>Now, there are quite a few ways around this problem. You can install to a &#8216;real&#8217; computer and migrate the installation to a network block device. You can use debootstrap in place of the actual Debian installation system. You can use a combination of these two methods, NFS root filesystems, TFTP hacks, etc. All of these solutions are lacking in my opinion. I want to run the &#8216;real&#8217; debian installer against a network block device and boot my physical hardware using only the built in PXE booting capability of the BIOS.</p>
<p>Taking all these issues as a personal challenge, I&#8217;ve outlined below how to go about using the regular old Debian Lenny installer directly against an AoE block device.<br />
<span id="more-131"></span></p>
<p>First of all, youll need the full installer disc 1 for Lenny. We need one of the .deb&#8217;s thats on that CD. The netinst or businesscard installers will not work with the steps below. (NOTE: If you want to be really creative, I suppose you could download the .deb from within the installer system via wget or even get it before hand and put it on a thumb drive or something&#8230;)</p>
<p>1. Boot the lenny install cd just to the point that /cdrom is mounted. For me, that was the &#8220;Configure the network&#8221; prompt.</p>
<p>2. Switch to a virtual terminal by hitting alt-f2.</p>
<p>3. Unpack the .deb that contains the aoe kernel module</p>
<pre class="brush: plain;">udpkg --unpack /cdrom/pool/main/l/linux-2.6/linux-image-2.6.26-2-486_2.6.26-15_i386.deb</pre>
<p>4. Now load the kernel module we just unpacked</p>
<pre class="brush: plain;">insmod /lib/modules/2.6.26-2-486/kernel/drivers/block/aoe/aoe.ko</pre>
<p>5. Now we create a symlink to the AoE block device. Its important that we use a symlink at this point in the process since it will cause the installer to set up a lot of paths in the correct fashion.</p>
<pre class="brush: plain;">ln -s /dev/etherd/eX.X /dev/sda</pre>
<p>6. Hit alt-f1 and continue with installation until the point that grub fails to install, then switch back to terminal 2.</p>
<p>7. Now chroot into the mostly installed system</p>
<pre class="brush: plain;">chroot /target</pre>
<p>8. Install the aoetools package</p>
<pre class="brush: plain;">apt-get -y install aoetools</pre>
<p>9. Listed below are two scripts that youll need to get into your chroot environment. They are used to build a new custom initrd image. I find it easiest to put them on a webserver somewhere and wget them.</p>
<pre class="brush: plain;">wget http://www.pixelchaos.net/aoe/hooks/aoetools -O /etc/initramfs-tools/hooks/aoetools
chmod 755 /etc/initramfs-tools/hooks/aoetools
wget http://www.pixelchaos.net/aoe/scripts/local-top/aoetools -O /etc/initramfs-tools/scripts/local-top/aoetools
chmod 755 /etc/initramfs-tools/scripts/local-top/aoetools</pre>
<p>10. Now we regenerate the initrd image</p>
<pre class="brush: plain;">update-initramfs -u -k all</pre>
<p>11. Now that all the above is done, we can manually install grub &#8211; which the debian installer was unable to do.</p>
<pre class="brush: plain;">apt-get -y install grub
mkdir /boot/grub
cp -r /usr/lib/grub/i386-pc/. /boot/grub</pre>
<p>12. Now we can remove our old symlink and create some hard links instead. This is required to allow grub to modify the MBR of our block device.</p>
<pre class="brush: plain;">rm /dev/sda
ln /dev/etherd/eX.X /dev/sda
ln /dev/etherd/eX.Xp1 /dev/sda1
ln /dev/etherd/eX.Xp5 /dev/sda5</pre>
<p>13. Now update grubs device.map</p>
<pre class="brush: plain;">echo &quot;(hd0) /dev/sda&quot; &gt; /boot/grub/device.map</pre>
<p>14. Now run &#8220;grub&#8221; and issue the following commands</p>
<pre class="brush: plain;">device (hd0) /dev/sda
root (hd0,0)
setup (hd0)</pre>
<p>15. Now issue the &#8220;update-grub&#8221; command which will generate /boot/grub/menu.lst for the first time</p>
<p>16. Remember that grub has been using the hard link to /dev/sda this whole time. Change the root=/dev/sda1 line in /boot/grub/menu.lst to root=/dev/etherd/eX.Xp1, then issue the &#8220;update-grub&#8221; command again to commit the change to the boot stanzas.</p>
<p>17. For the sake of completeness, lets change grubs device.map back to its original contents.</p>
<pre class="brush: plain;">echo &quot;(hd0) /dev/etherd/eX.X&quot; &gt; /boot/grub/device.map</pre>
<p>18. Get out of the chroot environment by issuing the &#8220;exit&#8221; command.</p>
<p>19. Go back to installer and choose &#8220;Continue without boot loader&#8221; to finish the installation and reboot the computer.</p>
<p>Thats it! Assuming you have properly set up a gPXE boot environment everything should &#8220;just work&#8221;. Setting up gPXE is outside the scope of this document but some good notes are available on the etherboot web site (see the links below).</p>
<p>Please note that there is one caveat to this whole process. Grub does not support installation onto AoE block devices. There very well may be some issues the next time you try to upgrade your kernel if some post-inst script calls grub-install against your root device. Keep that in mind.</p>
<p><strong>aoe-hooks script</strong></p>
<pre class="brush: bash;">
#!/bin/sh

set  -e

PREREQ=&quot;&quot;

prereqs()
{
echo &quot;$PREREQ&quot;
}

case $1 in
prereqs)
prereqs
exit 0
;;
esac

. /usr/share/initramfs-tools/hook-functions

[ -x /sbin/aoe-discover ] &amp;&amp; copy_exec /sbin/aoe-discover /sbin
manual_add_modules aoe
</pre>
<p><strong>aoe-local-top script</strong></p>
<pre class="brush: bash;">
#!/bin/sh

set -e

PREREQ=&quot;udev&quot;

prereqs()
{
echo &quot;$PREREQ&quot;
}

case $1 in
prereqs)
prereqs
exit 0
;;
esac

case $ROOT in
/dev/etherd/e*)
INTERFACES=`sed -ne '/eth.*:/{s/:.*$//;p;}' &lt; /proc/net/dev`
for i in $INTERFACES; do
echo Bringing up interface $i for AoE
ifconfig $i up
done
# Make sure udev has processed all events from adding the NIC
# modules before loading aoe
[ -x /sbin/udevsettle ] &amp;&amp; /sbin/udevsettle --timeout=30
modprobe aoe
# Wait until aoe device files have been generated.
[ -x /sbin/udevsettle ] &amp;&amp; /sbin/udevsettle --timeout=30
aoe-discover
;;
esac
</pre>
<p><strong>references</strong><br />
<a href="http://maht0x0r.blogspot.com/2009/03/installing-debian-5-for-migration-to.html" target="_blank">http://maht0&#215;0r.blogspot.com/2009/03/installing-debian-5-for-migration-to.html</a><br />
<a href="http://www.etherboot.org/wiki/sanboot/debian_and_ubuntu" target="_blank">http://www.etherboot.org/wiki/sanboot/debian_and_ubuntu</a><br />
<a href="http://mike.neir.org/wiki/articles/AoE_Root_Fedora" target="_blank">http://mike.neir.org/wiki/articles/AoE_Root_Fedora</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/05/25/install-debian-directly-onto-an-aoe-root-filesystem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>openais: an alternative to clvm with cman</title>
		<link>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/</link>
		<comments>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 17:24:29 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=106</guid>
		<description><![CDATA[I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon this mailing list post. The promise there is that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon <a href="http://xen.markmail.org/message/xrrvmcl7bq6p4pvk?q=clvm+openais">this</a> mailing list post. The promise there is that you could take clvm and compile it against openais and get a cluster aware LVM which doesnt require the rest of Red Hat Cluster Suite (and its crappy documentation, crappy fencing, and general all around crappiness). A little more searching turned up <a href="http://h2o.glou.fr/post/2009/04/20/clvm-openais-on-Debian/Lenny">this</a> web site from Olivier Le Cam which pretty much did 90% of the work for me.</p>
<p>After some testing I&#8217;m happy to say it appears to work smashingly. What follows is a somewhat more complete version of how to achieve the same results on Debian Lenny. Enjoy :)</p>
<p><span id="more-106"></span><br />
The first thing that needs to be done is to get the debian sources for clvm and modify then to use openais. After that we will recompile new packages from that source, then set up openais on our cluster nodes.</p>
<p>Install all the dependencies we need to compile clvm</p>
<pre class="brush: plain;">
root@host:~# apt-get build-dep clvm
root@host:~# apt-get install libopenais-dev
</pre>
<p>Now download the source files and cd into our working directory</p>
<pre class="brush: plain;">
root@host:~# cd /usr/src/
root@host:/usr/src# apt-get source clvm
root@host:/usr/src# cd lvm2-2.02.39
</pre>
<p>Now we&#8217;ll modify a few files in the source:</p>
<ul>
<li> The first is debian/clvm.init. You&#8217;ll need to remove any references to cman or cluster.conf. You can download an already edited version <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/clvm.init'>here</a>.</li>
<li>The next is debian/control. Modify the dependies (lvm2 without the version number, openais in place of cman) and modify the comments accordingly. A pre-edited version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/control'>here</a>.</li>
<li> The last file is debian/rules. Replace cman by openais in the configure options, and add the PATH where to find the openais libs. Again, a pre-made version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/rules'>here</a>.</li>
</ul>
<p>For clarities sake, here is the actual code block from debian/rules:</p>
<pre class="brush: plain;">
$(STAMPS_DIR)/setup-deb: SOURCE_DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/setup-deb: DIR = $(BUILD_DIR)/build-deb
$(STAMPS_DIR)/setup-deb: $(STAMPS_DIR)/source
        rm -rf $(DIR)
        cp -al $(SOURCE_DIR) $(DIR)
        cd $(DIR); \
        ./configure CFLAGS=&quot;$(CFLAGS)&quot; \
		LDFLAGS=&quot;-L/usr/lib/openais&quot; \
                $(CONFIGURE_FLAGS) \
                --with-optimisation=&quot;&quot; \
                --with-clvmd=openais \
                --enable-readline
        touch $@
</pre>
<p>The last thing to do is update the internal version number of the clvm package and add some comments to the changelog:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dch -i
</pre>
<p>Now go ahead and compile the package:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dpkg-buildpackage -rfakeroot -uc -b
</pre>
<p>After the compliation completes you should have some shiny new .deb files in /usr/src. The one we are interested in is clvm_2.02.39-7.1_i386.deb (the actual version of yours may vary depending on what you put in the debian changelog in the previous step).</p>
<p>So now that weve got our custom version of clvm compiled, its time to move on the cluster nodes. On each node in the cluster, do the following&#8230;</p>
<p>Install openais and add a user for it:</p>
<pre class="brush: plain;">
root@node:~# apt-get install openais
root@node:~# mkdir -p /etc/ais
root@node:~# adduser --no-create-home --disabled-password --disabled-login --gecos openAIS ais
</pre>
<p>Now create the following config in /etc/ais/openais.conf. This is the most basic config you can have. All you need to do is set 192.168.1.0 to be your actual network address.</p>
<pre class="brush: plain;">
totem {
        version: 2
        secauth: off
        threads: 0
        interface {
                ringnumber: 0
                bindnetaddr: 192.168.1.0
                mcastaddr: 226.94.1.1
                mcastport: 5405
        }
}
</pre>
<p>openais does not include a proper debian init sript so you can download one <a href="http://www.pixelchaos.net/wp-content/uploads/2009/04/openais.init">here</a> and save it as /etc/init.d/openais. After that is done, add it to the proper runlevels by issuing:</p>
<pre class="brush: plain;">
root@node:~# update-rc.d openais start 62 S . start 50 0 6 .
</pre>
<p>Now we can install our custom deb and turn on LVM clustering</p>
<pre class="brush: plain;">
root@node:~# dpkg -i clvm_2.02.39-7.1_i386.deb
root@node:~# sed -i 's/^    locking_type = 1$/    locking_type = 3/' /etc/lvm/lvm.conf
</pre>
<p>Thats it! Reboot your cluster nodes and they should all be cluster aware now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Set up a bluetooth keyboard in Debian Etch</title>
		<link>http://www.pixelchaos.net/2008/09/26/set-up-a-bluetooth-keyboard-in-debian-etch/</link>
		<comments>http://www.pixelchaos.net/2008/09/26/set-up-a-bluetooth-keyboard-in-debian-etch/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 11:29:55 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MythTV]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=71</guid>
		<description><![CDATA[I recently purchased a new Apple Wireless Bluetooth Keyboard for use with MythTV. The choice of input device for MythTV is a very subjective thing to be sure, but I love this device because its as small as it can be without feeling cramped, its thin, light weight, and stylish.
Setting the device up to work [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a new Apple Wireless Bluetooth Keyboard for use with MythTV. The choice of input device for MythTV is a very subjective thing to be sure, but I love this device because its as small as it can be without feeling cramped, its thin, light weight, and stylish.</p>
<p>Setting the device up to work with Debian Etch is fairly straightforward once you know what to do</p>
<p><span id="more-71"></span></p>
<p>Obviously, you need a motherboard with built-in Bluetooth or a USB Bluetooth receiver. Once you have that, lets install the software you&#8217;ll need:</p>
<pre class="brush: plain;">apt-get install bluez-utils bluez-gnome</pre>
<p>Now we need to figure out the Bluetooth address of the keyboard:</p>
<pre class="brush: plain;">
user@host:~$ hcitool scan
Scanning ...
        00:23:41:D4:42:78       laptop
        00:27:E2:A1:3F:E5       Apple Wireless Keyboard
</pre>
<p>Now that you have the Bluetooth address of the keyboard, lets modify the following lines in /etc/default/bluetooth:</p>
<pre class="brush: plain;">
HIDD_ENABLED=1
HIDD_OPTIONS=&quot;--master --connect $(bluetooth addr) --server&quot;
</pre>
<p>Next you&#8217;ll add a new section to /etc/bluetooth/hcid.conf for the keyboard:</p>
<pre class="brush: plain;">
device $(bluetooth addr) {
    name &quot;Apple Wireless Keyboard&quot;;
    auth enable;
    encrypt enable;
}
</pre>
<p>At this point you can pair the keyboard. Since I use fluxbox on my MythTV frontend computers I manually start the required applets, etc.</p>
<ul>
1. Start window manager<br />
2. As the logged in user, run &#8220;bluetooth-applet&#8221;<br />
3. Power cycle the Bluetooth keyboard<br />
4. As root, execute &#8220;hidd &#8211;connect $(keyboard addr)<br />
5. Type a PIN number on bluetooth keyboard (i.e. 1234) then hit return<br />
6. The bluetooth applet will start flashing in the window manager.<br />
7. Click the bluetooth applet and enter the same PIN in the dialog that pops up</ul>
<p>That should be it. You now have a working wireless keyboard :-)</p>
<p>If anyone knows of a way to do this entirely on the command line, bypassing the window manager and bluetooth-applet entirely, I&#8217;d love to hear it.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/09/26/set-up-a-bluetooth-keyboard-in-debian-etch/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Performance testing Linux software RAID</title>
		<link>http://www.pixelchaos.net/2008/09/12/performance-testing-linux-software-raid/</link>
		<comments>http://www.pixelchaos.net/2008/09/12/performance-testing-linux-software-raid/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 17:39:28 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=62</guid>
		<description><![CDATA[With the forthcoming release of Debian Lenny it happened to be a good time for me to re-evaluate my decision to use one monster RAID6 device to back all my iSCSI targets. I ran a semi-formal test on different disk configurations for software raid and came up with these results&#8230;

Our test system, for those who [...]]]></description>
			<content:encoded><![CDATA[<p>With the forthcoming release of Debian Lenny it happened to be a good time for me to re-evaluate my decision to use one monster RAID6 device to back all my iSCSI targets. I ran a semi-formal test on different disk configurations for software raid and came up with these results&#8230;</p>
<p><span id="more-62"></span></p>
<p>Our test system, for those who dont follow this blog regularly, is a Supermicro X7DVL-E motherboard with a single Intel Core2 Xeon 5130 @ 2Ghz with 2GB of RAM. The disks used are Seagate ES.2 1TB SATA-II models hooked up to two Supermicro AOC-SAT2-MV8 8-port PCI-X SATA controllers. More complete specs are outlined in my original post where I was building the chassis, which can be found <a href="http://www.pixelchaos.net/2008/03/28/coraid-odyssey-part-1/">here</a>.</p>
<p>The Linux distribution used is, of course, Debian :-) In this case, its Debian 5.0 (Lenny) running kernel 2.6.26-1-686.</p>
<p><strong>Test #1 &#8211; Individual Disks</strong><br />
In order to get some baseline numbers to compare against subsequent tests we will first check performance of all the attached disks individually&#8230;<br />
<code>for disk in $(ls /dev/disk/by-id/ | grep -v part | grep scsi-SATA_ST); do<br />
   echo $disk &#038;&#038; \<br />
  dd if=/dev/zero of=/dev/disk/by-id/$disk bs=4M oflag=direct count=250 &#038;&#038; \<br />
  dd if=/dev/disk/by-id/$disk of=/dev/null bs=4M count=250;<br />
done</code></p>
<p>Which yielded these results&#8230;<br />
<code><br />
5QJ06913 - read:109MB/s, write:109MB/s<br />
5QJ09HZR - read:111MB/s, write:112MB/s<br />
5QJ09JHQ - read:113MB/s, write:109MB/s<br />
5QJ09JV3 - read:109MB/s, write:108MB/s<br />
</code></p>
<p>So our average raw device read speed is 110.5MB/s and writes are 109.5MB/s.</p>
<p><strong>Test #2 &#8211; Bonnie++ on a single disk</strong><br />
Next we will do a bonnie++ test on a single disk (5QJ06913), formatted with default ext3 options</p>
<p><code>mkfs.ext3 /dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913<br />
mount /dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s 4096 -x 5 -u root</code></p>
<p>This test produced average block reads of 105.55MB/s @ 11.4% CPU usage, block writes of 65.93MB/s @ 19%, and block rewrites of 36.95MB/s @ 8%.</p>
<p><strong>Test #3 &#8211; RAID1 pair</strong><br />
For this test we use a RAID1 pair with one disk on each controller, formatted with default ext3 options</p>
<p><code>mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdf /dev/sdg<br />
dd if=/dev/zero of=/dev/md2 bs=4M oflag=direct count=250<br />
dd if=/dev/md2 of=/dev/null bs=4M count=250<br />
</code></p>
<p>This produced raw I/O reads of 111MB/s and writes of 107MB/s. Now for some bonnie++ tests&#8230;</p>
<p><code><br />
mkfs.ext3 /dev/md2<br />
mount /dev/md2 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s 4096 -x 5 -u root<br />
</code></p>
<p>This test produced average block reads of 103.43MB/s @ 14.4% CPU usage, block writes of 60.84MB/s @ 18.6%, and block rewrites of 33.82MB/s @ 8.8%.</p>
<p><strong>Test #4 &#8211; RAID10</strong><br />
For this test we use a RAID10 device consisting of two RAID1 devices, each with a disk on each controller.</p>
<p><code><br />
mdadm --create /dev/md4 --level=0 --raid-devices=2 /dev/md2 /dev/md3<br />
dd if=/dev/zero of=/dev/md4 bs=4M oflag=direct count=250<br />
dd if=/dev/md4 of=/dev/null bs=4M<br />
</code></p>
<p>This produced raw I/O reads of 219MB/s and writes of 207MB/s. A pretty significant improvement.</p>
<p><code><br />
mkfs.ext3 /dev/md4<br />
mount /dev/md4 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s 4096 -x 5 -u root<br />
</code></p>
<p>This test produced average block reads of 198.91MB/s @ 27.8% CPU usage, block writes of 132.4MB/s @ 44%, and block rewrites of 61.75MB/s @ 14.4%.</p>
<p><strong>Test #5 &#8211; RAID5</strong><br />
For this test we will use a RAID5 device with the first two disks on one controller and the third on the second controller</p>
<p><code><br />
mdadm --create /dev/md2 --level=5 --raid-devices=3 /dev/sdf1 /dev/sde1 /dev/sdg1<br />
dd if=/dev/zero of=/dev/md2 bs=4M oflag=direct count=250<br />
dd if=/dev/md2 of=/dev/null bs=4M<br />
</code></p>
<p>This produced raw I/O reads of 67.3MB/s and writes of 130MB/s.</p>
<p><code><br />
mkfs.ext3 /dev/md2<br />
mount /dev/md2 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s 4096 -x 5 -u root<br />
</code></p>
<p>This test produced average block reads of 62.91MB/s @ 8.6% CPU usage, block writes of 65.73MB/s @ 19.6%, and block rewrites of 33.14MB/s @ 7.6%.</p>
<p>Those were all the RAID types I was inclined to test. I realize I left out RAID0 and RAID6. For the application I have in mind, RAID10 is the clear winner. You can download a spreadsheet with the actual bonnie++ output <a href='http://www.pixelchaos.net/wp-content/uploads/2008/09/raidperf.ods'>here</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/09/12/performance-testing-linux-software-raid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VLAN Bridging in Xen</title>
		<link>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/</link>
		<comments>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 00:47:22 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=53</guid>
		<description><![CDATA[Recently I came upon the need to do all my network routing and firewalling inside a Xen domU. I am not the first to do this but I thought I&#8217;d do a little write up on it to help others trying to accomplish the same thing in Debian.
The idea here is to end up with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I came upon the need to do all my network routing and firewalling inside a Xen domU. I am not the first to do this but I thought I&#8217;d do a little write up on it to help others trying to accomplish the same thing in Debian.</p>
<p>The idea here is to end up with (at least) two VLANs on the network with the dom0 and domU&#8217;s being able to choose one or both networks on which to exist. In the case of both, you can set up a handy domU firewall/gateway :)</p>
<p><a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen_vlans.png'><img src="http://www.pixelchaos.net/wp-content/uploads/2008/07/xen_vlans-300x226.png" alt="" title="xen_vlans" width="300" height="226" class="aligncenter size-medium wp-image-54" /></a></p>
<p>As you can see from the diagram above, we will end up with three bridges in the dom0 with all the appropriate glue to tie everything together. Best of all, this is all assembled on the fly during bootup.</p>
<p><span id="more-53"></span></p>
<p>Now, you obviously need to have a Xen dom0 set up and running properly. Once you are at that point, adding VLAN bridging is fairly straightforward:</p>
<p>First we need to install the vlan package to get the tools for manipulating vlans. Crazy, huh?</p>
<pre class="brush: plain;">apt-get install vlan</pre>
<p>Now we set up the interfaces we will need in /etc/network/interfaces. The seasoned admins out there will note that we only bring up the eth0 interface automatically but leave it unconfigured. It will not have an IP or any of the other usual information. The other two (VLAN) interfaces are defined but are NOT brought up during boot. This is important!</p>
<p>In this example the “vlan100″ interface is the replacement for your old “eth0″ interface. Its the interface you’ll be able to reach the dom0 on from the internal VLAN. The “vlan99″ interface is defined but is left unconfigured since there will be no publicly routeable path to the dom0.</p>
<pre class="brush: plain;">auto eth0
iface eth0 inet manual
        pre-up ifconfig $IFACE up
        post-down ifconfig $IFACE down

iface vlan99 inet manual
        mtu 1500
        vlan_raw_device eth0

iface vlan100 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 192.168.1.254
        dns-search pixelchaos.net
        mtu 1500
        vlan_raw_device eth0</pre>
<p>Now we create a new network script for xen located at /etc/xen/scripts/network-multi:</p>
<pre class="brush: plain;">#!/bin/sh
#============================================================================
# Xen vlan bridge start/stop script.
# Xend calls a network script when it starts.
# The script name to use is defined in /etc/xen/xend-config.sxp
# in the network-script field.
#
# This script creates multiple bridges to segregate individual domUs to
# separate VLANs. Customize to fit your needs.
#
# Usage:
#
# network-multi (start|stop|status)
#
#============================================================================

dir=$(dirname &quot;$0&quot;)

##
# To make the tagged interface available to some DomUs, create the default
# bridge. Comment this out to only make vlan-based bridges available.
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=0 netdev=eth0 bridge=&quot;xbr_trunk&quot;

# Once the &quot;normal&quot; bridge is active, bring up the vlan interfaces.
# They will be attached to the virtual eth0 interface, and not the
# physical one.
ifup vlan99
ifup vlan100

# Create any vlan-based briges.
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=1 bridge=&quot;xbr_vl99&quot; netdev=&quot;vlan99&quot;
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=2 bridge=&quot;xbr_vl100&quot; netdev=&quot;vlan100&quot;

# bring up the interfaces again? why do we need to do this? they should have been brought back up by the previous network-bridge call…
ip link set vlan100 up
route add default gw 192.168.1.1 vlan100</pre>
<p>That script basically just calls the standard “network-bridge” script supplied with Xen three times &#8211; once for each VLAN we are setting up. You’ll notice some interesting bits at the end &#8211; We call “ip link” and “route” to bring the vlan100 interface up again. I’m not sure yet why the previous “network-bridge” call doesnt do that on its own… it should as far as I know but I havent dug into why it doesnt. This is just a quick hack to bring “vlan100″ back up again and fix the routes.</p>
<p>Go ahead and add the call to that script in the place of network-bridge in /etc/xen/xend-config.sxp.</p>
<p>Now we need to do one final thing to another Xen script. By default, the xen-network-common.sh script calls “ifdown” directly to take an interface down. Unfortunately, this has the undesirable side effect of destroying any VLANs associated with that interface. This causes all kinds of problems when we call our “network-multi” script so we need to patch /etc/xen/scripts/xen-network-common.sh with the following section:</p>
<pre class="brush: plain;"># do not call ifdown directly
  ifdown()  {
    ip addr flush $1
    ip link set $1 down
    true
  }</pre>
<p>To see exactly where that chunk of code goes you can download my already modified script <a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen-network-common.sh'>here</a>, or get a diff <a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen-network-common.patch'>here</a> if you prefer.</p>
<p>After youve done all that, reboot your dom0. You should now be up and running on the vlan100 interface. The output of &#8220;brctl show&#8221; should show this:</p>
<pre class="brush: plain;">root@atlas:~# brctl show
bridge name  bridge id          STP enabled    interfaces
xbr_trunk    8000.feffffffffff  no             vif0.0
                                               peth0
xbr_vl100    8000.feffffffffff  no             vif0.2
                                               pvlan100
xbr_vl99     8000.feffffffffff  no             vif0.1
                                               pvlan99</pre>
<p>If so, you should be all ready to go. Now edit the vif line in your config file for a given domU to link its ethernet interface to a bridge. My domU firewall is linked to two bridges so it looks like this:</p>
<pre class="brush: plain;">vif= [ 'mac=00:16:3E:44:F9:9C, bridge=xbr_vl99', 'mac=00:16:3E:41:16:51, bridge=xbr_vl100' ]</pre>
<p>Thats it! Easy, huh?</p>
<p>Many, many thanks go to <a href="http://mike.neir.org">Mike Neir</a> for holding my hand through figuring this all out since he&#8217;d already set up a functional system that is very similar. Thanks also go to <a href="http://www.firstserved.net/blog/2007/07/19/bridging-vlan-interfaces-in-xen/trackback">firstserved.net</a> for the ifdown patch and <a href="http://renial.net/weblog/2007/02/27/xen-vlan/trackback">renial.net</a> for other ideas on ways to set up VLAN bridging in Xen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iscsi-target, open-iscsi and Debian</title>
		<link>http://www.pixelchaos.net/2008/07/16/iscsi-target-open-iscsi-and-debian/</link>
		<comments>http://www.pixelchaos.net/2008/07/16/iscsi-target-open-iscsi-and-debian/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 17:41:19 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=58</guid>
		<description><![CDATA[This wasnt incredibly difficult to figure out, but if you have a Debian etch system with iscsi-target compiled from source (as I regularly do) getting both open-iscsi and iscsi-target to play nice together takes a small amount of fiddling.

First of all, install open-iscsi
dpkg -i open-iscsi_2.0.869.2-2_i386.deb
Now compile and install iscsi-target
tar -xzvf iscsitarget-0.4.16.tar.gz
cd iscsitarget-0.4.16
make
make install
And now the [...]]]></description>
			<content:encoded><![CDATA[<p>This wasnt incredibly difficult to figure out, but if you have a Debian etch system with iscsi-target compiled from source (as I regularly do) getting both open-iscsi and iscsi-target to play nice together takes a small amount of fiddling.</p>
<p><span id="more-58"></span></p>
<p>First of all, install open-iscsi<br />
<code>dpkg -i open-iscsi_2.0.869.2-2_i386.deb</code></p>
<p>Now compile and install iscsi-target<br />
<code>tar -xzvf iscsitarget-0.4.16.tar.gz<br />
cd iscsitarget-0.4.16<br />
make<br />
make install</code></p>
<p>And now the important bits. iscsi-target needs to be added to the sysv init scripts in the correct places, which a source install obviously doesnt do:<br />
<code>update-rc.d iscsi-target start 44 S . stop 82 0 6 .</code></p>
<p>That will make it start just before open-iscsi and stop just after it. Thats it! Any iscsi target that you configure with with the “automatic” option should be correctly connected to during bootup<br />
<code>iscsiadm -m node -T iqn.2008-01.net.pixelchaos:mytarget –op update -n node.conn[0].startup -v automatic</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/07/16/iscsi-target-open-iscsi-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 5 (AoE vs iSCSI)</title>
		<link>http://www.pixelchaos.net/2008/04/16/coraid-odyssey-part-5-aoe-vs-iscsi/</link>
		<comments>http://www.pixelchaos.net/2008/04/16/coraid-odyssey-part-5-aoe-vs-iscsi/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 19:40:53 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=51</guid>
		<description><![CDATA[The next phase of this project is choosing AoE or iSCSI. The debate on the relative merits of each protocol continues to rage on the Internet but in my particular case the criteria are pretty simple; which one performs better without causing excessive system load? Just from reading about the two protocols I am already [...]]]></description>
			<content:encoded><![CDATA[<p>The next phase of this project is choosing AoE or iSCSI. The debate on the relative merits of each protocol continues to rage on the Internet but in my particular case the criteria are pretty simple; which one performs better without causing excessive system load? Just from reading about the two protocols I am already leaning toward iSCSI for the simple fact that I can use all my TCP/IP management tools (routing, NAT, firewalling, etc.) on every iSCSI device. The only (potential) drawback is CPU load on the involved systems since it has to calculate TCP checksums for all those packets. Yes, there are many, many other advantages of one protocol over the other. No, they don&#8217;t matter to me in this scenario :-) So here we go!</p>
<p><span id="more-51"></span><br />
In keeping with my character, the first thing I did was start all over again from scratch by reinstalling the operating system. This time around I set up /dev/md0 as /boot (255 MB) and /dev/md1 as an LVM physical volume (the remainder of the disk), within which /, /home, /usr and friends reside as logical volumes. Its something I&#8217;ve wanted to start doing with all my systems for a long time now and shouldn&#8217;t have any bearing on the performance tests we are about to do.</p>
<p>Regardless of which protocol will be used we need to enable jumbo frames on all the involved devices. For my setup that means the target (stor01), the initiator (node02), and the switch (a Cisco Catalyst 2970).</p>
<p>First, we turn on jumbo frames for gigabit ethernet at the switch. Beware that this requires a reset (aka reboot) of the switch to take effect:</p>
<p><code type="text"><br />
c2970# system mtu jumbo 9000<br />
</code></p>
<p>Now we enable an MTU of 9000 on both the target and the initiator:</p>
<p><code type="text"><br />
root@stor01:~# ifconfig bond0 mtu 9000<br />
</code></p>
<p><code type="text"><br />
root@node02:~# ifconfig eth0 mtu 9000<br />
</code></p>
<p>For the sake of comparison, here is an iperf test done between the target and initiator with the standard MTU of 1500, and then with an MTU of 9000:</p>
<p><code type="text"><br />
root@stor01:~# iperf -s<br />
------------------------------------------------------------<br />
Server listening on TCP port 5001<br />
TCP window size: 1.00 MByte (default)<br />
------------------------------------------------------------<br />
[  4] local 65.171.150.4 port 5001 connected with 65.171.150.161 port 58731<br />
[  4]  0.0-10.0 sec    780 MBytes    654 Mbits/sec<br />
[  5] local 65.171.150.4 port 5001 connected with 65.171.150.161 port 58732<br />
[  5]  0.0-10.0 sec    916 MBytes    768 Mbits/sec<br />
</code></p>
<p>As you can see, just enabling jumbo frames produces a raw throughput increase of 17.43%. Nothing to sneeze at.</p>
<p>At this point I tried enabling flow control on the catalyst switch (it is already enabled for both send and receive by default in the e1000 driver) but it did not have any effect on iperf numbers. I turned it back off for now.</p>
<p>So now we set up a 20GB LVM volume on the target and export it using vblade to be mounted on the initiator. We then run a simple dd test to check throughput:</p>
<p><code type="text"><br />
root@node02:~# dd if=/dev/zero of=/mnt/test oflag=direct bs=4M<br />
419+0 records in<br />
419+0 records out<br />
1757413376 bytes (1.8 GB) copied, 133.476 seconds, 13.2 MB/s<br />
</code></p>
<p>CPU load on the target was 10-15% during the dd operation. Now we try writing direct to the (unmounted) block device to rule out any performance penalties of the filesystem itself&#8230;</p>
<p><code type="text"><br />
root@node02:~# dd if=/dev/zero of=/dev/etherd/e0.1 oflag=direct bs=4M<br />
513+0 records in<br />
512+0 records out<br />
2147483648 bytes (2.1 GB) copied, 170.991 seconds, 12.6 MB/s<br />
</code></p>
<p>CPU usage was slightly higher in that test, running 15-20%. So some slight difference but nothing to be too concerned about.</p>
<p>Now we take that same LVM device and share it via iSCSI for the same dd tests:</p>
<p><code type="text"><br />
ladmin@node02:~$ dd if=/dev/zero of=/mnt/test oflag=direct bs=4M<br />
462+0 records in<br />
461+0 records out<br />
1933574144 bytes (1.9 GB) copied, 38.2375 seconds, 50.6 MB/s<br />
</code></p>
<p>CPU load was 6-8% during that test. We also run that same test with flow control enabled at the switch:</p>
<p><code type="text"><br />
ladmin@node02:~$ dd if=/dev/zero of=/mnt/test oflag=direct bs=4M<br />
463+0 records in<br />
462+0 records out<br />
1937768448 bytes (1.9 GB) copied, 38.1851 seconds, 50.7 MB/s<br />
</code></p>
<p>Essentially the same&#8230;</p>
<p>Now this raises the question of why AoE is so much slower than iSCSI on an essentially default install of Debian Etch. To AoE&#8217;s credit, many people report getting just as good (50MB/s or better) of performance from AoE on their systems as I&#8217;m seeing with iSCSI. I spent quite a large amount of time playing with flow control, kernel ring buffer values, filesystem options, etc. and was unable to determine why performance is so terrible for me. I did find a pretty high number (half a dozen at least) of recent posts to the AoE mailing list by other people having essentially identical problems so I&#8217;m certainly not alone. In the interest of completing my testing, I&#8217;ve decided to move forward with iSCSI.</p>
<p>Now we try reformatting with the stride option to mkfs:</p>
<p><code type="text"><br />
mkfs.ext3 -E stride=16<br />
</code></p>
<p>The results of several more tests are shown here&#8230;</p>
<p><code type="text"><br />
root@node02:~# dd if=/dev/zero of=/mnt/test oflag=direct bs=4M<br />
2038431744 bytes (2.0 GB) copied, 41.8938 seconds, 48.7 MB/s<br />
2038431744 bytes (2.0 GB) copied, 42.2633 seconds, 48.2 MB/s<br />
2038431744 bytes (2.0 GB) copied, 41.3756 seconds, 49.3 MB/s<br />
</code></p>
<p>So we don&#8217;t see any appreciable difference when using a combination of the stride= option and flow control, at least with a simple dd test.</p>
<p>Next we turn flow control back off, and reformat again without the stride= option. We are now back to our baseline setup for a new test with bonnie++.</p>
<p><code type="text"><br />
ladmin@node02:~$ /usr/sbin/bonnie++ -d /mnt -s 4096Mb -n 10 -x 5 -q<br />
</code></p>
<p>This test produced block writes of about 82MB/s and block reads of about 37MB/s. The cause for the difference in write speed between the dd and bonnie++ tests is still unclear to me. There also appears to be a known issue where writes are much faster than reads which is apparently due to interrupt handling. This is further evidenced by running a quick dd test that does a read instead of a write:</p>
<p><code type="text"><br />
ladmin@node02:~$ dd if=/mnt/test of=/dev/null bs=4M<br />
3602907136 bytes (3.6 GB) copied, 96.2053 seconds, 37.5 MB/s<br />
3602907136 bytes (3.6 GB) copied, 90.5524 seconds, 39.8 MB/s<br />
3602907136 bytes (3.6 GB) copied, 90.0425 seconds, 40.0 MB/s<br />
3602907136 bytes (3.6 GB) copied, 88.5708 seconds, 40.7 MB/s<br />
</code></p>
<p>As you can see, read operations are about 20% slower than write operations which goes against common thinking with regard to stripped disk arrays.</p>
<p>So there you have it. In my particular situation, with no tuning/optimizing done, iSCSI performs much better than AoE. Even in the event that I were to go to the trouble to performance tune AoE and get it as good as, or even better than, iSCSI I would still be inclined to standardize around iSCSI. Authentication, routing, NAT, etc. can all be done very easily on iSCSI protocol with all the standard TCP/IP tools that are out there. For me that&#8217;s a pretty big advantage.</p>
<p>Next up will be our final piece of the puzzle, left over from the initial system setup &#8211; getting hot swap working with the sata_mv module!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/16/coraid-odyssey-part-5-aoe-vs-iscsi/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 4 (ethernet bonding)</title>
		<link>http://www.pixelchaos.net/2008/04/10/coraid-oddyssey-part-4/</link>
		<comments>http://www.pixelchaos.net/2008/04/10/coraid-oddyssey-part-4/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 14:13:30 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[IOS]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=50</guid>
		<description><![CDATA[On the plate today is getting ethernet interface bonding working to provide load balancing and failover on the dual onboard gigabit interfaces on our home-built Coraid.
This actually turns out to be much easier than expected&#8230;

The first thing we need to do is install the ifenslave utility:

root@stor01:~# apt-get install ifenslave
Reading package lists... Done
Building dependency tree... Done
The [...]]]></description>
			<content:encoded><![CDATA[<p>On the plate today is getting ethernet interface bonding working to provide load balancing and failover on the dual onboard gigabit interfaces on our home-built Coraid.</p>
<p>This actually turns out to be much easier than expected&#8230;</p>
<p><span id="more-50"></span><br />
The first thing we need to do is install the ifenslave utility:</p>
<p><code type="text"><br />
root@stor01:~# apt-get install ifenslave<br />
Reading package lists... Done<br />
Building dependency tree... Done<br />
The following extra packages will be installed:<br />
ifenslave-2.6<br />
The following NEW packages will be installed:<br />
ifenslave ifenslave-2.6<br />
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.<br />
Need to get 12.4kB of archives.<br />
After unpacking 57.3kB of additional disk space will be used.<br />
Do you want to continue [Y/n]?<br />
</code></p>
<p>Now we create /etc/modprobe.d/bonding and add to it:</p>
<p><code type="text"><br />
alias bond0 bonding<br />
options bonding mode=802.3ad miimon=100 downdelay=200 updelay=200<br />
</code></p>
<p>Once that file is created, run &#8220;update-modules&#8221; to, well, update our module parameters. Of special note is the mode parameter. It tells the ethernet bonding modules to use 802.3ad bonding mode, which is supported by my Cisco Catalyst 2900 series gigabit switch.</p>
<p>Now add a new bond0 interface to /etc/network/interfaces (removing all the &#8220;slave&#8221; interfaces from that file at the same time):</p>
<p><code style="text"><br />
auto bond0<br />
iface bond0 inet static<br />
        address 192.168.1.4<br />
        netmask 255.255.255.0<br />
        network 192.168.1.0<br />
        broadcast 192.168.1.255<br />
        gateway 192.168.1.1<br />
        # dns-* options are implemented by the resolvconf package, if installed<br />
        dns-nameservers 192.168.1.254<br />
        dns-search pixelchaos.net<br />
        up /sbin/ifenslave bond0 eth0<br />
        up /sbin/ifenslave bond0 eth1<br />
</code></p>
<p>Thats it! For the sake of simplicity, I just rebooted my server at this point. I&#8217;m of course leaving out the configuration of my Cisco Catalyst 2900 series switch to enable an 802.3ad etherchannel on the two ports we are plugged in to.</p>
<p>Next up will be performance testing AoE vs iSCSI&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/10/coraid-oddyssey-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 3 (performance testing)</title>
		<link>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/</link>
		<comments>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 16:15:46 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=48</guid>
		<description><![CDATA[Performance and failure testing are next up in building our kickin&#8217; iSCSI/AoE device.
The Debian Etch installer supports building and installing onto software RAID arrays. Because of that&#8230;
during installation I configured the initial RAID1 boot volume with hot spare, consisting of three WD 160GB SATA 3Gbps disks. mdadm sees / and swap as /dev/md0 and /dev/md1 [...]]]></description>
			<content:encoded><![CDATA[<p>Performance and failure testing are next up in building our kickin&#8217; iSCSI/AoE device.</p>
<p>The Debian Etch installer supports building and installing onto software RAID arrays. Because of that&#8230;</p>
<p><span id="more-48"></span>during installation I configured the initial RAID1 boot volume with hot spare, consisting of three WD 160GB SATA 3Gbps disks. mdadm sees / and swap as /dev/md0 and /dev/md1 respectively. There was some remaining space on the drives which I set up as /dev/md2 for future use. The remaining arrays I decided to create manually using mdadm after getting a usable system up and running.</p>
<p>First of all we need figure out what devices we want in the arrays by probing /dev. The ultimate goal here is to build three arrays: 1 x RAID1 with 1 hot spare (8GB root, 1GB swap, 151GB extra), 1 x RAID6 with 1 hot spare (4TB Xen LVM&#8217;s + 2TB Bacula LVM), 1 x RAID5 (2TB offsite mirror).</p>
<p>I was forward thinking enough to label all the drive carriers with the serial number of the disk in it so all we need to do is get the disk-by-id name from /dev/disk/by-id/ and then build our test array like so:</p>
<p><code type="text"><br />
mdadm --create /dev/md3 --level=6 --raid-devices=8 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09HZR \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09JV3 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ08XHB \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09KNM \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09JHQ \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ0817T \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09B9P \<br />
--spare-devices=1 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ07CF3<br />
</code></p>
<p>This assembles our /dev/md3 device with the default options for RAID6 (64k chunk, left-symmetric parity)</p>
<p><code type="text"><br />
stor01:~# cat /proc/mdstat<br />
Personalities : [raid1] [raid6] [raid5] [raid4]<br />
md3 : active raid6 sdl[8](S) sdk[7] sdj[6] sdf[5] sdh[4] sdg[3] sdi[2] sde[1] sdd[0]<br />
5860574976 blocks level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU]<br />
[>....................]  resync =  0.8% (8790864/976762496) finish=217.3min speed=74238K/sec<br />
</code></p>
<p>Here you can see that CPU load is moderate doing the first full sync of that array:</p>
<p><code type="text"><br />
Cpu0  :  0.0%us, 33.3%sy,  0.0%ni, 63.3%id,  0.0%wa,  1.3%hi,  2.0%si,  0.0%st<br />
Cpu1  :  0.0%us,  7.0%sy,  0.0%ni, 91.0%id,  0.0%wa,  0.3%hi,  1.7%si,  0.0%st<br />
</code></p>
<p>So, we wait about 4 hours&#8230; and its done :-)</p>
<p>For formatting the volume, I decided to use the stride= option to mkfs.ext3. This provides for optimal striping across a raid array. The secret here is to make $stride = $chunks / $block_size. In our case, thats 4096 byte (4k) blocks divided by 64k chunks. So 16 would be our optimal stride value.</p>
<p><code type="text"><br />
root@stor01:~# mkfs.ext3 -E stride=16 /dev/md3<br />
</code></p>
<p>So how does it perform? Well enough to saturate the dual gigabit NIC ports &#8211; which is all that matters :-)</p>
<p><code type="text"><br />
root@stor01:~# dd bs=4M if=/dev/zero of=/dev/md3<br />
4469+0 records in<br />
4469+0 records out<br />
18744344576 bytes (19 GB) copied, 97.583 seconds, 192 MB/s<br />
</code></p>
<p>I also ran a more real-world test with bonnie++</p>
<p><code type="text"><br />
/usr/sbin/bonnie++ -d /mnt -s 4096Mb -n 100 -x 10 -q<br />
</code></p>
<p>This test showed approximately 335MB/s read, 170MB/s write. You can download the actual data <a href="http://www.pixelchaos.net/?attachment_id=49">here</a> if you wish.</p>
<p>For failure testing the array, its as simple as removing and inserting disks while the array is up and running. Both tests work fine for the onboard SATA II controller but alas, the sata_mv kernel module does not yet support hotplug so all we can do on the remaining drives is simulate a drive failure by removing one disk. This does work fine but I need to see if there is a way to refresh the SATA bus to get any replacement drive to show up and be added back into the running array. Otherwise, we will need to power down the array to replace a faulty disk which kind of ruins the whole project, dont you think? ;-)</p>
<p>So while we wait for sata_mv to start working (or find a different SATA controller to use in this project) we will move on to the remaining issues. Up next; getting port trunking working with a cisco switch&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 2 (sata_mv hotplug)</title>
		<link>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/</link>
		<comments>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:33:28 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=47</guid>
		<description><![CDATA[Todays adventure with building a SAN on the cheap involves attempting to get hotplug working and changing device mappings.
First of all, hotplug. I have discovered that&#8230;
hotplug doesn&#8217;t seem to work on the Supermicro AOC-SAT2-MV8 cards. The controllers do work, but unless a drive is plugged in during bootup they will not be subsequently detected&#8230;

root@stor01:~# lspci
05:01.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Todays adventure with building a SAN on the cheap involves attempting to get hotplug working and changing device mappings.</p>
<p>First of all, hotplug. I have discovered that&#8230;</p>
<p><span id="more-47"></span>hotplug doesn&#8217;t seem to work on the Supermicro AOC-SAT2-MV8 cards. The controllers do work, but unless a drive is plugged in during bootup they will not be subsequently detected&#8230;</p>
<p><code type="text"><br />
root@stor01:~# lspci<br />
05:01.0 SCSI storage controller: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 09)<br />
05:02.0 SCSI storage controller: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 09)<br />
</code></p>
<p>You can see that the Linux kernel sees these cards as Marvell MV88SX6081 devices. Further probing reveals that the sata_mv driver is claiming them:</p>
<p><code type="text"><br />
root@stor01:~$ dmesg | grep 05:01.0<br />
sata_mv 0000:05:01.0: version 0.7<br />
ACPI: PCI Interrupt 0000:05:01.0[A] -> GSI 24 (level, low) -> IRQ 233<br />
sata_mv 0000:05:01.0: 32 slots 8 ports SCSI mode IRQ via INTx<br />
</code></p>
<p>So off we go <a href="http://lkml.org">lkml.org</a> and other sources to find out why&#8230; Basically, hotplug support in the sata_mv module is still a work in progress. A <a href="http://lkml.org/lkml/2007/12/12/143">post</a> to the lkml claims that its slated for inclusion in the 2.6.26 kernel. There is also more information <a href="http://linux-ata.org/driver-status.html">here</a>.</p>
<p>So hotplug isnt going to work for us today :-( On the bright side, 2.6.25-rc7 is the current development kernel so I can&#8217;t imagine that 2.6.26 is too far off.</p>
<p>The second (perceived) issue of getting all the hot swap bays to be mapped to /dev/sd* entries in a particular order doesnt seem to be as much of an issue as I&#8217;d thought.</p>
<p>The Linux kernel will initialize PCI devices in a strange fashion depending on what is plugged in to the bus. For example, if all fifteen bays have drives plugged into them, the leftmost bay always shows up at /dev/sda. Unplug just one drive and reboot the machine and it will be mapped to /dev/sdl for example. The reason this isnt really an issue is that newer Linux kernels have not only udev (which is great but not really a solution for this particular problem) but the /dev/disk/by-* tree. You can find all your disks in there with handy names like /dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913. That name belongs to that particular drive and only that particular drive, ever.</p>
<p><code type="text"><br />
root@stor01:~# ls -l /dev/disk/by-id/ | grep scsi | grep -v part<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ06913 -> ../../sde<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ07CF3 -> ../../sdi<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ0817T -> ../../sdb<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ08T21 -> ../../sdh<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ08XHB -> ../../sdc<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09B9P -> ../../sda<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09GMW -> ../../sdd<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09HZR -> ../../sdg<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09JHQ -> ../../sdk<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09JV3 -> ../../sdj<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09KNM -> ../../sdl<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09LLA -> ../../sdf<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WCAP93952468 -> ../../sdm<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WMAS20341446 -> ../../sdo<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WMAS20366839 -> ../../sdn<br />
</code></p>
<p>Cool, huh?</p>
<p>So we will just let mdadm do its job of assembling /dev/md* devices on the fly at bootup and use the /dev/disk/by-id entries to do stuff to particular disks (like temperature monitoring, etc.).</p>
<p>Coming up in my next post &#8211; performance and failure testing the array.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
