<?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; Linux</title>
	<atom:link href="http://www.pixelchaos.net/category/linux/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>working with initrd.img files</title>
		<link>http://www.pixelchaos.net/2009/05/28/working-with-initrdimg-files/</link>
		<comments>http://www.pixelchaos.net/2009/05/28/working-with-initrdimg-files/#comments</comments>
		<pubDate>Thu, 28 May 2009 13:41:56 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=104</guid>
		<description><![CDATA[You may have occasion to edit the contents of an initrd.img file. If so, here is how:
Extract the contents of the image
gunzip &#60; your-initrd.img &#124; cpio -i --make-directories
Now make your edits and then repackage the initrd
find . &#124; cpio -o -H newc &#124; gzip -9 &#62; your-new-initrd.img
]]></description>
			<content:encoded><![CDATA[<p>You may have occasion to edit the contents of an initrd.img file. If so, here is how:</p>
<p>Extract the contents of the image</p>
<pre class="brush: plain;">gunzip &lt; your-initrd.img | cpio -i --make-directories</pre>
<p>Now make your edits and then repackage the initrd</p>
<pre class="brush: plain;">find . | cpio -o -H newc | gzip -9 &gt; your-new-initrd.img</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/05/28/working-with-initrdimg-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sata_mv timeouts fixed</title>
		<link>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/</link>
		<comments>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:33:32 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=101</guid>
		<description><![CDATA[Well isnt this a happy day for owners of the Supermicro 8-Port SATA Card AOC-SAT2-MV8. It appears a long standing issue with port timeouts has been fixed.
See the lkml.org mailing list post here
&#8230; and the townspeople rejoiced :)
]]></description>
			<content:encoded><![CDATA[<p>Well isnt this a happy day for owners of the Supermicro 8-Port SATA Card AOC-SAT2-MV8. It appears a long standing issue with port timeouts has been fixed.</p>
<p>See the lkml.org mailing list post <a href="http://lkml.org/lkml/2009/1/30/462">here</a></p>
<p>&#8230; and the townspeople rejoiced :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/04/08/sata_mv-timeouts-fixed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>diskless booting with PXE and NFS</title>
		<link>http://www.pixelchaos.net/2009/02/15/diskless-booting-with-pxe-and-nfs/</link>
		<comments>http://www.pixelchaos.net/2009/02/15/diskless-booting-with-pxe-and-nfs/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 15:10:42 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=89</guid>
		<description><![CDATA[For a long time now I&#8217;ve wanted to set up all my mythfrontends to be diskless nodes that boot via PXE using an NFS share as their root filesystem. I finally got around to doing this. I was even able to just migrate my existing installations directly into the PXE boot environment. Here is how [...]]]></description>
			<content:encoded><![CDATA[<p>For a long time now I&#8217;ve wanted to set up all my mythfrontends to be diskless nodes that boot via PXE using an NFS share as their root filesystem. I finally got around to doing this. I was even able to just migrate my existing installations directly into the PXE boot environment. Here is how I accomplished it&#8230;</p>
<p><span id="more-89"></span></p>
<p>The first thing youll need is a TFTP server. This will serve out the kernel and initrd images to clients on the network.</p>
<pre class="brush: plain;">
root@pxe:~$ apt-get install tftpd-hpa
</pre>
<p>That will install a good tftp server daemon and create the tftp root for you in /var/lib/tftpboot. Some HOWTO&#8217;s on the Internet suggest installing the syslinux package as well which provides a needed file (pxelinux.0). I prefer to download the entire netboot environment for debian since this will also provide a network bootable installer for Debian on top of the other goodness we are creating today.</p>
<pre class="brush: plain;">
root@pxe:~$ cd /var/lib/tftpboot
root@pxe:~$ wget http://ftp.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/netboot.tar.gz
root@pxe:~$ tar xzvf netboot.tar.gz
</pre>
<p>The kernel and initrd you are going to use to boot the mythbox must reside on the TFTP server. Furthermore, the initrd must be updated to support NFS root. On the mythbox I was migrating to the NFS root, it looked like this:</p>
<pre class="brush: plain;">
root@mythbox:~$ sed -i 's/BOOT=local/BOOT=nfs/'  /etc/initramfs-tools/initramfs.conf
root@mythbox:~$ /usr/sbin/mkinitramfs -o /boot/initrd.img-2.6.26-1-686_netboot
</pre>
<p>Now just copy the /boot/vmlinuz-2.6.26-1-686 and /boot/initrd.img-2.6.26-1-686_netboot to /var/lib/tftpboot/ on the TFTP server.</p>
<p>Last step for the TFTP server is to create a config file for our mythbox. If you dont create one specifically for it, it will instead boot the network installer as mentioned above. Create the file /var/lib/tftpboot/pxelinux.cfg/01-$(hardware ethernet address). Including the hardware address in the file name binds that config to the particular workstation we are working on today. In my case, the file name is 01-00-19-db-4a-6a-0e.</p>
<pre class="brush: plain;">
LABEL linux
KERNEL vmlinuz-2.6.26-1-686
APPEND root=/dev/nfs initrd=initrd.img-2.6.26-1-686_netboot nfsroot=192.168.1.108:/srv/nfs/mythbox.pixelchaos.net ip=dhcp rw
</pre>
<p>Now that our TFTP server is up and running we will next need to configure a DHCP server to provide IP addresses to netboot clients, as well as point them to the TFTP server to continue the boot process.</p>
<pre class="brush: plain;">
root@dhcp:~$ apt-get install dhcp3-server
</pre>
<p>That will install the DHCP service for you. Now we just need to add one little section to /etc/dhcp3/dhcpd.conf for the workstation we are going to netboot.</p>
<pre class="brush: plain;">
host mythbox {
hardware ethernet 00:19:db:4a:6a:0e;
fixed-address mythbox.pixelchaos.net;
filename &quot;pxelinux.0&quot;;
next-server 192.168.1.115;
}
</pre>
<p>host mythbox: mythbox is just the descriptive name for this configuration block .You can use any name you like.<br />
hardware ethernet 00:19:db:4a:6a:0e: This is the hardware ethernet address of the workstation we are netbooting.<br />
fixed-address mythbox.pixelchaos.net: This tells the DHCP server what address to assign the mythbox. You can use a FQDN (if its resolvable!) or an IP address.<br />
filename &#8220;pxelinux.0&#8243;: This is the PXE boot loader file that we installed onto our TFTP server earlier.<br />
next-server 192.168.1.115: This is the IP address of our TFTP server. It tells the mythbox where the &#8220;next server&#8221; is after it gets its IP address from the DHCP server. The &#8220;next server&#8221; can be any machine on the network. It can even be the same one running DHCP.</p>
<p>Once all that is done, restart your DHCP server.</p>
<pre class="brush: plain;">
root@dhcp:~$ /etc/init.d/dhcp3-server restart
</pre>
<p>Now for the third piece of the puzzle, our NFS root filesystem. You&#8217;ll first need to create a directory to share.</p>
<pre class="brush: plain;">
root@nfs:~$ mkdir /srv/nfs/mythbox.pixelchaos.net
</pre>
<p>Now add that directory to /etc/exports so that it gets shared via NFS with this line:</p>
<pre class="brush: plain;">
/srv/nfs/mythbox.pixelchaos.net mythbox(rw,async,no_root_squash)
</pre>
<p>The rw, async, and no_root_squash options are important. Dont omit them. At this point we can reload all our NFS exports to active this new share point.</p>
<pre class="brush: plain;">
root@nfs:~$ exportfs -rv
</pre>
<p>At this point the entire TFTP, DHCP, and NFS parts of the environment are ready to go. Now we will migrate our existing installation of Linux from the mythbox onto its new nfsroot. First we make a directory to mount the NFS share on and then mount it.</p>
<pre class="brush: plain;">
root@mythbox:~$ mkdir /mnt/nfs
root@mythbox:~$ mount -t nfs -o nolock 192.168.1.108:/srv/nfs/mythbox.pixelchaos.net /mnt/nfs
</pre>
<p>Now we run a cp command on every locally mounted partition, as well as /dev. On my mythbox it looked like this:</p>
<pre class="brush: plain;">
root@mythbox:~$ cp -axv /. /mnt/nfs/.
root@mythbox:~$ cp -axv /boot/. /mnt/nfs/boot/.
root@mythbox:~$ cp -axv /home/. /mnt/nfs/home/.
root@mythbox:~$ cp -axv /dev/. /mnt/nfs/dev/.
</pre>
<p>The last thing to do is edit two files that we copied up to /mnt/nfs. The first is /mnt/nfs/etc/network/interfaces. You&#8217;ll need to remove any lines that bring the interface up automatically. You want to remove anything like &#8220;allow-hotplug eth0&#8243; and just leave a single line like &#8220;iface eth0 inet dhcp&#8221;. The network interface will have already been brought up by netboot normally and leaving in any &#8220;hotplug&#8221; or &#8220;auto&#8221; lines will bring it up again, which has the effect of destroying it.</p>
<p>Now we remove all the old filesystems from /mnt/nfs/etc/fstab so that it looks like this:</p>
<pre class="brush: plain;">
# /etc/fstab: static file system information.
#
# &lt;file system&gt; 		&lt;mount point&gt;   	&lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;
/dev/nfs        /               nfs     defaults 0 0
none            /tmp            tmpfs   defaults 0 0
none            /var/run        tmpfs   defaults 0 0
none            /var/lock       tmpfs   defaults 0 0
none            /var/tmp        tmpfs   defaults 0 0
none            /media          tmpfs   defaults 0 0
</pre>
<p>That should be it. Now just set the mythbox to use network booting in its BIOS and reboot.</p>
<p>Cool, huh? :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/02/15/diskless-booting-with-pxe-and-nfs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</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<br />
<code style="bash">losetup -f -v disk.img</code></p>
<p>Next, we get a listing of the partition table it contains:</p>
<p><code style="bash">fdisk -ul /dev/loop0</p>
<p>Disk /dev/loop0: 4294 MB, 4294967296 bytes<br />
133 heads, 62 sectors/track, 1017 cylinders, total 8388608 sectors<br />
Units = sectors of 1 * 512 = 512 bytes</p>
<p>      Device Boot      Start         End      Blocks   Id  System<br />
/dev/loop0p1              62     7998619     3999279   83  Linux<br />
/dev/loop0p2         7998620     8386181      193781   82  Linux swap / Solaris</code></p>
<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>
<p><code>losetup -o 31744 -f -v /dev/loop0<br />
Loop device is /dev/loop2</code></p>
<p>Looks good so far. Now mount it.</p>
<p><code>mount /dev/loop2 /mnt</code></p>
<p>Thats it. You should now be able to get at all the files on that partition.</p>
<p><strong>EDIT 2009-01-13</strong><br />
Since writing this I have discovered that you can supply the ‘offset’ argument to mount directly and bypass the entire process of using loopback devices…<br />
<code><br />
fdisk -ul disk.img # to get your offset value as noted above<br />
mount -o loop,offset=31744 disk.img /mnt # to mount a given partition on /mnt<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/10/01/how-to-mount-partitioned-disk-image-files/feed/</wfw:commentRss>
		<slash:comments>1</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>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>
		<slash:comments>2</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>Convert firmware images from .bin to .trx</title>
		<link>http://www.pixelchaos.net/2007/11/04/convert-firmware-images-from-bin-to-trx/</link>
		<comments>http://www.pixelchaos.net/2007/11/04/convert-firmware-images-from-bin-to-trx/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 17:52:19 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/34</guid>
		<description><![CDATA[You may on occasion have a need to convert .bin firmware images such as those used to flash linksys based devices into .trx formatted images that can be accepted by OpenWRT. Its actually quite easy to do:
dd if=image.bin of=image.trx bs=32 skip=1
That will strip the first 32 bytes off the image, thus making it a valid [...]]]></description>
			<content:encoded><![CDATA[<p>You may on occasion have a need to convert .bin firmware images such as those used to flash linksys based devices into .trx formatted images that can be accepted by OpenWRT. Its actually quite easy to do:</p>
<p><code type="bash">dd if=image.bin of=image.trx bs=32 skip=1</code></p>
<p>That will strip the first 32 bytes off the image, thus making it a valid .trx formatted firmware image file. Neat, huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/11/04/convert-firmware-images-from-bin-to-trx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tar and Restore Files Over SSH</title>
		<link>http://www.pixelchaos.net/2007/08/16/tar-files-over-ssh/</link>
		<comments>http://www.pixelchaos.net/2007/08/16/tar-files-over-ssh/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 14:29:17 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/22</guid>
		<description><![CDATA[This will be pretty obvious to seasoned *nix admins but it&#8217;s possible to tar/gz/bzip files over an ssh connection onto a remote file system. Read on to find out how&#8230;

Simply start out within an ssh session on the machine youre sending data FROM:

tar cjvf - /home &#124; ssh root@backup.pixelchaos.net "cat > /backup/home.tar.bz2"
You can also use [...]]]></description>
			<content:encoded><![CDATA[<p>This will be pretty obvious to seasoned *nix admins but it&#8217;s possible to tar/gz/bzip files over an ssh connection onto a remote file system. Read on to find out how&#8230;</p>
<p><span id="more-22"></span></p>
<p>Simply start out within an ssh session on the machine youre sending data FROM:</p>
<p><code type="bash"><br />
tar cjvf - /home | ssh root@backup.pixelchaos.net "cat > /backup/home.tar.bz2"</code></p>
<p>You can also use dd (or any other data/pipe handling commands):</p>
<p><code type="bash"><br />
tar cjvf - /home | ssh root@backup.pixelchaos.net "dd of=/backup/home.tar.bz2"<br />
</code></p>
<p>To restore that same file over ssh:</p>
<p><code type="bash"><br />
ssh root@backup.pixelchaos.net "cat /backup/home.tar.bz2" | tar xjvf -<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/08/16/tar-files-over-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerPC Arch Added to Backports</title>
		<link>http://www.pixelchaos.net/2007/07/12/powerpc-arch-added-to-backports/</link>
		<comments>http://www.pixelchaos.net/2007/07/12/powerpc-arch-added-to-backports/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 14:40:27 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/15</guid>
		<description><![CDATA[I have added powerpc to my backports repository in addition to the already included i386 and amd64 archictectures. See this post for more information.
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>I have added powerpc to my backports repository in addition to the already included i386 and amd64 archictectures. See <a href="http://www.pixelchaos.net/index.php/archives/14">this post</a> for more information.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2007/07/12/powerpc-arch-added-to-backports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
