<?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"
	>

<channel>
	<title>pixelchaos.net</title>
	<atom:link href="http://www.pixelchaos.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelchaos.net</link>
	<description>random bits for your terminal</description>
	<pubDate>Mon, 13 Oct 2008 16:09:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Prune old mythtv channels</title>
		<link>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/</link>
		<comments>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 00:19:05 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[HowTo]]></category>

		<category><![CDATA[MythTV]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=73</guid>
		<description><![CDATA[Looking for a way to bulk remove channels that I&#8217;ve delselected in my channel lineup at Schedules Direct, I happened upon this blog post. Seems to work great :)
For the impatient, the important bit is this:
DELETE channel,program FROM channel NATURAL LEFT JOIN program WHERE program.title IS NULL;
]]></description>
			<content:encoded><![CDATA[<p>Looking for a way to bulk remove channels that I&#8217;ve delselected in my channel lineup at Schedules Direct, I happened upon <a title="this blog post" href="http://www.ilikelinux.com/tips-and-howtos/tips-for-using-mysql-with-mythtv/trackback" target="_blank">this blog post</a>. Seems to work great :)</p>
<p>For the impatient, the important bit is this:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">DELETE channel,program FROM channel NATURAL LEFT <a href="http://www.php.net/join"><span style="color: #000066;">JOIN</span></a> program WHERE program.title IS <span style="color: #000000; font-weight: bold;">NULL</span>;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/10/12/prune-old-mythtv-channels/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to mount partitioned disk image files</title>
		<link>http://www.pixelchaos.net/2008/10/01/how-to-mount-partitioned-disk-image-files/</link>
		<comments>http://www.pixelchaos.net/2008/10/01/how-to-mount-partitioned-disk-image-files/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 18:41:33 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
		
		<category><![CDATA[HowTo]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=72</guid>
		<description><![CDATA[Mounting unpartitioned disk image files in Linux is easy. You just execute &#8216;mount -o loop disk.img /mnt&#8217; right?
Well, if your disk image file happens to contain partitions its a little bit trickier. Here is what you need to do:

First you attach the disk image to the first available loopback device
losetup -f -v disk.img
Next, we get [...]]]></description>
			<content:encoded><![CDATA[<p>Mounting unpartitioned disk image files in Linux is easy. You just execute &#8216;mount -o loop disk.img /mnt&#8217; right?</p>
<p>Well, if your disk image file happens to contain partitions its a little bit trickier. Here is what you need to do:</p>
<p><span id="more-72"></span></p>
<p>First you attach the disk image to the first available loopback device</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">losetup -f -v disk.img</div>
<p>Next, we get a listing of the partition table it contains:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">fdisk -ul /dev/loop0</p>
<p>Disk /dev/loop0: <span style="color: #cc66cc;">4294</span> MB, <span style="color: #cc66cc;">4294967296</span> bytes<br />
<span style="color: #cc66cc;">133</span> heads, <span style="color: #cc66cc;">62</span> sectors/track, <span style="color: #cc66cc;">1017</span> cylinders, total <span style="color: #cc66cc;">8388608</span> sectors<br />
Units = sectors of <span style="color: #cc66cc;">1</span> * <span style="color: #cc66cc;">512</span> = <span style="color: #cc66cc;">512</span> bytes</p>
<p>&nbsp; &nbsp; &nbsp; Device Boot &nbsp; &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/end"><span style="color: #000066;">End</span></a> &nbsp; &nbsp; &nbsp;Blocks &nbsp; Id &nbsp;<a href="http://www.php.net/system"><span style="color: #000066;">System</span></a><br />
/dev/loop0p1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">62</span> &nbsp; &nbsp; <span style="color: #cc66cc;">7998619</span> &nbsp; &nbsp; <span style="color: #cc66cc;">3999279</span> &nbsp; <span style="color: #cc66cc;">83</span> &nbsp;Linux<br />
/dev/loop0p2 &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">7998620</span> &nbsp; &nbsp; <span style="color: #cc66cc;">8386181</span> &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">193781</span> &nbsp; <span style="color: #cc66cc;">82</span> &nbsp;Linux swap / Solaris</div>
<p>Now for the juicy part. You attach one the partitions contained in the disk image to yet another loopback device by specifying the offset of the partition.</p>
<p>The -o option to losetup tells it the number of bytes to skip at the beginning of the file. To get that number, you multiply the number of bytes per unit (in this case, 512) by the &#8216;Start&#8221; value of the parititon (in this case, 62). So our -o value will be 31744.</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">losetup -o <span style="color: #cc66cc;">31744</span> -f -v /dev/loop0<br />
Loop device is /dev/loop2</div>
<p>Looks good so far. Now mount it.</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mount /dev/loop2 /mnt</div>
<p>Thats it. You should now be able to get at all the files on that partition.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/10/01/how-to-mount-partitioned-disk-image-files/feed/</wfw:commentRss>
		</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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">apt-get install bluez-utils bluez-gnome</div>
<p>Now we need to figure out the Bluetooth address of the keyboard:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">user@host:~$ hcitool scan<br />
Scanning &#8230;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">00</span>:<span style="color: #cc66cc;">23</span>:<span style="color: #cc66cc;">41</span>:D4:<span style="color: #cc66cc;">42</span>:<span style="color: #cc66cc;">78</span> &nbsp; &nbsp; &nbsp; laptop<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">00</span>:<span style="color: #cc66cc;">27</span>:E2:A1:3F:E5 &nbsp; &nbsp; &nbsp; Apple Wireless Keyboard</div>
<p>Now that you have the Bluetooth address of the keyboard, lets modify the following lines in /etc/default/bluetooth:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">HIDD_ENABLED=<span style="color: #cc66cc;">1</span><br />
HIDD_OPTIONS=<span style="color: #ff0000;">&quot;&#8211;master &#8211;connect $(bluetooth addr) &#8211;server&quot;</span></div>
<p>Next you&#8217;ll add a new section to /etc/bluetooth/hcid.conf for the keyboard:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">device $<span style="color: #66cc66;">&#40;</span>bluetooth addr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; name <span style="color: #ff0000;">&quot;Apple Wireless Keyboard&quot;</span>;<br />
&nbsp; &nbsp; auth enable;<br />
&nbsp; &nbsp; encrypt enable;<br />
<span style="color: #66cc66;">&#125;</span></div>
<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>
		</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 - 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;</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #b1b100;">for</span> disk in $<span style="color: #66cc66;">&#40;</span>ls /dev/disk/by-id/ | grep -v part | grep scsi-SATA_ST<span style="color: #66cc66;">&#41;</span>; <span style="color: #b1b100;">do</span><br />
<span style="color: #ff0000"> &nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$disk</span> &amp;&amp; \<br />
&nbsp; dd <span style="color: #b1b100;">if</span>=/dev/zero of=/dev/disk/by-id/<span style="color: #0000ff;">$disk</span> bs=4M oflag=direct <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span> &amp;&amp; \<br />
&nbsp; dd <span style="color: #b1b100;">if</span>=/dev/disk/by-id/<span style="color: #0000ff;">$disk</span> of=/dev/<span style="color: #000000; font-weight: bold;">null</span> bs=4M <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span>;</span><br />
done</div>
<p>Which yielded these results&#8230;</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<p>So our average raw device read speed is 110.5MB/s and writes are 109.5MB/s.</p>
<p><strong>Test #2 - 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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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 <span style="color: #cc66cc;">4096</span> -x <span style="color: #cc66cc;">5</span> -u root</div>
<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 - RAID1 pair</strong><br />
For this test we use a RAID1 pair with one disk on each controller, formatted with default ext3 options</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mdadm &#8211;create /dev/md2 &#8211;level=<span style="color: #cc66cc;">1</span> &#8211;raid-devices=<span style="color: #cc66cc;">2</span> /dev/sdf /dev/sdg<br />
dd <span style="color: #b1b100;">if</span>=/dev/zero of=/dev/md2 bs=4M oflag=direct <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span><br />
dd <span style="color: #b1b100;">if</span>=/dev/md2 of=/dev/<span style="color: #000000; font-weight: bold;">null</span> bs=4M <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span></div>
<p>This produced raw I/O reads of 111MB/s and writes of 107MB/s. Now for some bonnie++ tests&#8230;</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mkfs.ext3 /dev/md2<br />
mount /dev/md2 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s <span style="color: #cc66cc;">4096</span> -x <span style="color: #cc66cc;">5</span> -u root</div>
<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 - RAID10</strong><br />
For this test we use a RAID10 device consisting of two RAID1 devices, each with a disk on each controller.</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mdadm &#8211;create /dev/md4 &#8211;level=<span style="color: #cc66cc;">0</span> &#8211;raid-devices=<span style="color: #cc66cc;">2</span> /dev/md2 /dev/md3<br />
dd <span style="color: #b1b100;">if</span>=/dev/zero of=/dev/md4 bs=4M oflag=direct <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span><br />
dd <span style="color: #b1b100;">if</span>=/dev/md4 of=/dev/<span style="color: #000000; font-weight: bold;">null</span> bs=4M</div>
<p>This produced raw I/O reads of 219MB/s and writes of 207MB/s. A pretty significant improvement.</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mkfs.ext3 /dev/md4<br />
mount /dev/md4 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s <span style="color: #cc66cc;">4096</span> -x <span style="color: #cc66cc;">5</span> -u root</div>
<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 - 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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mdadm &#8211;create /dev/md2 &#8211;level=<span style="color: #cc66cc;">5</span> &#8211;raid-devices=<span style="color: #cc66cc;">3</span> /dev/sdf1 /dev/sde1 /dev/sdg1<br />
dd <span style="color: #b1b100;">if</span>=/dev/zero of=/dev/md2 bs=4M oflag=direct <a href="http://www.php.net/count"><span style="color: #000066;">count</span></a>=<span style="color: #cc66cc;">250</span><br />
dd <span style="color: #b1b100;">if</span>=/dev/md2 of=/dev/<span style="color: #000000; font-weight: bold;">null</span> bs=4M</div>
<p>This produced raw I/O reads of 67.3MB/s and writes of 130MB/s.</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mkfs.ext3 /dev/md2<br />
mount /dev/md2 /mnt<br />
/usr/sbin/bonnie++ -q -d /mnt -s <span style="color: #cc66cc;">4096</span> -x <span style="color: #cc66cc;">5</span> -u root</div>
<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>
		</item>
		<item>
		<title>Bacula 2.4.2 for Mac OS X</title>
		<link>http://www.pixelchaos.net/2008/08/19/bacula-242-for-mac-os-x/</link>
		<comments>http://www.pixelchaos.net/2008/08/19/bacula-242-for-mac-os-x/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 20:48:30 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
		
		<category><![CDATA[Bacula]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=63</guid>
		<description><![CDATA[Yet another update to the bacula client (and bconsole) for Mac OS X. System requirements and upgrade process are the same as with 2.4.0.
Enjoy!
bacula-client-242-1
]]></description>
			<content:encoded><![CDATA[<p>Yet another update to the bacula client (and bconsole) for Mac OS X. System requirements and upgrade process are the same as with 2.4.0.</p>
<p>Enjoy!<br />
<a href='http://www.pixelchaos.net/wp-content/uploads/2008/08/bacula-client-242-1.zip'>bacula-client-242-1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/08/19/bacula-242-for-mac-os-x/feed/</wfw:commentRss>
		</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[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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">apt-get install vlan</div>
<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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">auto eth0<br />
iface eth0 inet manual<br />
&nbsp; &nbsp; &nbsp; &nbsp; pre-up ifconfig <span style="color: #0000ff;">$IFACE</span> up<br />
&nbsp; &nbsp; &nbsp; &nbsp; post-down ifconfig <span style="color: #0000ff;">$IFACE</span> down</p>
<p>iface vlan99 inet manual<br />
&nbsp; &nbsp; &nbsp; &nbsp; mtu <span style="color: #cc66cc;">1500</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vlan_raw_device eth0</p>
<p>iface vlan100 inet <a href="http://www.php.net/static"><span style="color: #000066;">static</span></a><br />
&nbsp; &nbsp; &nbsp; &nbsp; address <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; netmask <span style="color: #cc66cc;">255.255</span><span style="color: #cc66cc;">.255</span><span style="color: #cc66cc;">.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; network <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; broadcast <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.255</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; gateway <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dns-nameservers <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.254</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dns-search pixelchaos.net<br />
&nbsp; &nbsp; &nbsp; &nbsp; mtu <span style="color: #cc66cc;">1500</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vlan_raw_device eth0</div>
<p>Now we create a new network script for xen located at /etc/xen/scripts/network-multi:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #808080; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #808080; font-style: italic;">#============================================================================</span><br />
<span style="color: #808080; font-style: italic;"># Xen vlan bridge start/stop script.</span><br />
<span style="color: #808080; font-style: italic;"># Xend calls a network script when it starts.</span><br />
<span style="color: #808080; font-style: italic;"># The script name to use is defined in /etc/xen/xend-config.sxp</span><br />
<span style="color: #808080; font-style: italic;"># in the network-script field.</span><br />
<span style="color: #808080; font-style: italic;">#</span><br />
<span style="color: #808080; font-style: italic;"># This script creates multiple bridges to segregate individual domUs to</span><br />
<span style="color: #808080; font-style: italic;"># separate VLANs. Customize to fit your needs.</span><br />
<span style="color: #808080; font-style: italic;">#</span><br />
<span style="color: #808080; font-style: italic;"># Usage:</span><br />
<span style="color: #808080; font-style: italic;">#</span><br />
<span style="color: #808080; font-style: italic;"># network-multi (start|stop|status)</span><br />
<span style="color: #808080; font-style: italic;">#</span><br />
<span style="color: #808080; font-style: italic;">#============================================================================</span></p>
<p><a href="http://www.php.net/dir"><span style="color: #000066;">dir</span></a>=$<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/dirname"><span style="color: #000066;">dirname</span></a> <span style="color: #ff0000;">&quot;$0&quot;</span><span style="color: #66cc66;">&#41;</span></p>
<p><span style="color: #808080; font-style: italic;">##</span><br />
<span style="color: #808080; font-style: italic;"># To make the tagged interface available to some DomUs, create the default</span><br />
<span style="color: #808080; font-style: italic;"># bridge. Comment this out to only make vlan-based bridges available.</span><br />
<span style="color: #ff0000;">&quot;$dir/network-bridge&quot;</span> <span style="color: #ff0000;">&quot;$@&quot;</span> vifnum=<span style="color: #cc66cc;">0</span> netdev=eth0 bridge=<span style="color: #ff0000;">&quot;xbr_trunk&quot;</span></p>
<p><span style="color: #808080; font-style: italic;"># Once the &quot;normal&quot; bridge is active, bring up the vlan interfaces.</span><br />
<span style="color: #808080; font-style: italic;"># They will be attached to the virtual eth0 interface, and not the</span><br />
<span style="color: #808080; font-style: italic;"># physical one.</span><br />
ifup vlan99<br />
ifup vlan100</p>
<p><span style="color: #808080; font-style: italic;"># Create any vlan-based briges.</span><br />
<span style="color: #ff0000;">&quot;$dir/network-bridge&quot;</span> <span style="color: #ff0000;">&quot;$@&quot;</span> vifnum=<span style="color: #cc66cc;">1</span> bridge=<span style="color: #ff0000;">&quot;xbr_vl99&quot;</span> netdev=<span style="color: #ff0000;">&quot;vlan99&quot;</span><br />
<span style="color: #ff0000;">&quot;$dir/network-bridge&quot;</span> <span style="color: #ff0000;">&quot;$@&quot;</span> vifnum=<span style="color: #cc66cc;">2</span> bridge=<span style="color: #ff0000;">&quot;xbr_vl100&quot;</span> netdev=<span style="color: #ff0000;">&quot;vlan100&quot;</span></p>
<p><span style="color: #808080; font-style: italic;"># 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…</span><br />
ip <a href="http://www.php.net/link"><span style="color: #000066;">link</span></a> set vlan100 up<br />
route add <span style="color: #000000; font-weight: bold;">default</span> gw <span style="color: #cc66cc;">192.168</span><span style="color: #cc66cc;">.1</span><span style="color: #cc66cc;">.1</span> vlan100<br />
<span style="color: #808080; font-style: italic;"># start up iscsi… it fails during boot since we have no active interface</span><br />
/etc/init.d/iscsi-target restart<br />
/etc/init.d/open-iscsi restart</div>
<p>That script basically just calls the standard “network-bridge” script supplied with Xen three times - once for each VLAN we are setting up. You’ll notice some interesting bits at the end;</p>
<p>   1. 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.<br />
   2. We call two init.d scripts to restart both the iscsi-target service, as well as open-iscsi. I use iSCSI on my Xen dom0’s to access the filesystems of domU’s. If you do that too, youll need to restart the service here since it fails when the dom0 initially boots (since there is no active network interface, remember?)</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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #808080; font-style: italic;"># do not call ifdown directly</span><br />
&nbsp; ifdown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; ip addr <a href="http://www.php.net/flush"><span style="color: #000066;">flush</span></a> $<span style="color: #cc66cc;">1</span><br />
&nbsp; &nbsp; ip <a href="http://www.php.net/link"><span style="color: #000066;">link</span></a> set $<span style="color: #cc66cc;">1</span> down<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; <span style="color: #66cc66;">&#125;</span></div>
<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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">root@atlas:~<span style="color: #808080; font-style: italic;"># brctl show</span><br />
bridge name &nbsp;bridge id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;STP enabled &nbsp; &nbsp;interfaces<br />
xbr_trunk &nbsp; &nbsp;<span style="color: #cc66cc;">8000</span>.feffffffffff &nbsp;no &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vif0<span style="color: #cc66cc;">.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;peth0<br />
xbr_vl100 &nbsp; &nbsp;<span style="color: #cc66cc;">8000</span>.feffffffffff &nbsp;no &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vif0<span style="color: #cc66cc;">.2</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pvlan100<br />
xbr_vl99 &nbsp; &nbsp; <span style="color: #cc66cc;">8000</span>.feffffffffff &nbsp;no &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vif0<span style="color: #cc66cc;">.1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pvlan99</div>
<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>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">vif= <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&#8216;mac=00:16:3E:44:F9:9C, bridge=xbr_vl99&#8242;</span>, <span style="color: #ff0000;">&#8216;mac=00:16:3E:41:16:51, bridge=xbr_vl100&#8242;</span> <span style="color: #66cc66;">&#93;</span></div>
<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>
		</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[Mac OS X]]></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</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">dpkg -i open-iscsi_2<span style="color: #cc66cc;">.0</span><span style="color: #cc66cc;">.869</span><span style="color: #cc66cc;">.2</span>-2_i386.deb</div>
<p>Now compile and install iscsi-target</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">tar -xzvf iscsitarget<span style="color: #cc66cc;">-0.4</span><span style="color: #cc66cc;">.16</span>.tar.gz<br />
cd iscsitarget<span style="color: #cc66cc;">-0.4</span><span style="color: #cc66cc;">.16</span><br />
make<br />
make install</div>
<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:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">update-rc.d iscsi-target start <span style="color: #cc66cc;">44</span> S . stop <span style="color: #cc66cc;">82</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">6</span> .</div>
<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</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">iscsiadm -m node -T iqn<span style="color: #cc66cc;">.2008</span><span style="color: #cc66cc;">-01</span>.net.pixelchaos:mytarget –op update -n node.conn<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.startup -v automatic</div>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/07/16/iscsi-target-open-iscsi-and-debian/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bacula 2.4.0-1 for Mac OS X</title>
		<link>http://www.pixelchaos.net/2008/06/26/bacula-240-1-for-mac-os-x/</link>
		<comments>http://www.pixelchaos.net/2008/06/26/bacula-240-1-for-mac-os-x/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:22:33 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
		
		<category><![CDATA[Bacula]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=59</guid>
		<description><![CDATA[Binaries for the latest bacula-fd and bconsole have been updated. Upgrades from previous versions should be handled in an intelligent fashion.
Please report any issues and I will resolve them ASAP. Thanks and enjoy!
bacula-client-240-1
]]></description>
			<content:encoded><![CDATA[<p>Binaries for the latest bacula-fd and bconsole have been updated. Upgrades from previous versions should be handled in an intelligent fashion.</p>
<p>Please report any issues and I will resolve them ASAP. Thanks and enjoy!</p>
<p><a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/bacula-client-240-1.zip'>bacula-client-240-1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/06/26/bacula-240-1-for-mac-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Coraid Odyssey: Part 6 (sata_mv hotplug)</title>
		<link>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/</link>
		<comments>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 12:51:03 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=52</guid>
		<description><![CDATA[The final installment of our coraid adventure and not really much to say other than this: it works! Hotplug support is working as of kernel 2.6.25-git11 and appears to function as it should.
Thanks go to Mark Lord, Marvell Corporation, EMC Corporation and Red Hat, Inc. for the coding magic.
]]></description>
			<content:encoded><![CDATA[<p>The final installment of our coraid adventure and not really much to say other than this: it works! Hotplug support is working as of kernel 2.6.25-git11 and appears to function as it should.</p>
<p>Thanks go to Mark Lord, Marvell Corporation, EMC Corporation and Red Hat, Inc. for the coding magic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/29/coraid-odyssey-part-6-sata_mv-hotplug/feed/</wfw:commentRss>
		</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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">c2970# system mtu jumbo 9000</div>
<p>Now we enable an MTU of 9000 on both the target and the initiator:</p>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">root@stor01:~# ifconfig bond0 mtu 9000</div>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">root@node02:~# ifconfig eth0 mtu 9000</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">root@stor01:~# iperf -s<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Server listening on TCP port 5001<br />
TCP window size: 1.00 MByte (default)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
[ &nbsp;4] local 65.171.150.4 port 5001 connected with 65.171.150.161 port 58731<br />
[ &nbsp;4] &nbsp;0.0-10.0 sec &nbsp; &nbsp;780 MBytes &nbsp; &nbsp;654 Mbits/sec<br />
[ &nbsp;5] local 65.171.150.4 port 5001 connected with 65.171.150.161 port 58732<br />
[ &nbsp;5] &nbsp;0.0-10.0 sec &nbsp; &nbsp;916 MBytes &nbsp; &nbsp;768 Mbits/sec</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<p>CPU load was 6-8% during that test. We also run that same test with flow control enabled at the switch:</p>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">mkfs.ext3 -E stride=16</div>
<p>The results of several more tests are shown here&#8230;</p>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ladmin@node02:~$ /usr/sbin/bonnie++ -d /mnt -s 4096Mb -n 10 -x 5 -q</div>
<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>
<div class="text" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">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</div>
<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 - 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>
		</item>
	</channel>
</rss>
