<?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>Sinodun Internet Technologies Ltd</title>
	<atom:link href="http://sinodun.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sinodun.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 May 2012 15:03:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Library Versioning</title>
		<link>http://sinodun.com/2012/05/library-versioning/</link>
		<comments>http://sinodun.com/2012/05/library-versioning/#comments</comments>
		<pubDate>Tue, 01 May 2012 14:52:49 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=629</guid>
		<description><![CDATA[I have been discovering all about library versioning. What I found came as a surprise to me and others especially those from a sysadmin background. Basically it all comes down to the fact that the numbers on the end of a library name may not be what you expect and it is even more complex [...]]]></description>
			<content:encoded><![CDATA[<p>I have been discovering all about library versioning. What I found came as a surprise to me and others especially those from a sysadmin background.</p>
<p>Basically it all comes down to the fact that the numbers on the end of a library name may not be what you expect and it is even more complex on OS X.</p>
<h3>Libtool on Linux</h3>
<p>For example consider the following libraries on a recent CentOS 6.2 install:</p>
<ul>
<li>/lib64/libparted-2.1.so.0.0.0</li>
<li>/lib64/libproc-3.2.8.so</li>
<li>/lib64/libgcrypt.so.11.5.3</li>
</ul>
<p>These show the three different ways in which a library may be versioned. <a href="http://www.gnu.org/software/libtool/manual/html_node/index.html" target="_blank">Chapter 7 of the libtool manual </a>discuses this subject. Libtool library versions are purely concerned with the supported API or interface that the library supports. It determines what the linker will allow to be linked.</p>
<div>
<blockquote><p>libtool library versions are described by three integers:</p>
<ul>
<li>current</li>
<ul>
<li>The most recent interface number that this library implements.</li>
</ul>
<li>revision</li>
<ul>
<li>The implementation number of the current interface.</li>
</ul>
<li>age</li>
<ul>
<li>The difference between the newest and oldest interfaces that this library imple- ments. In other words, the library implements all the interface numbers in the range from number current &#8211; age to current.</li>
</ul>
</ul>
</blockquote>
</div>
<div>
<blockquote><p>If two libraries have identical current and age numbers, then the dynamic linker chooses the library with the greater revision number.</p></blockquote>
<p>This is (or should be) what you see for libgcrypt.so.11.5.3. Running gpg &#8211;version shows that the version of libgcrypt is in fact</p>
<pre># gpg --version
gpg (GnuPG) 2.0.14
libgcrypt 1.4.5</pre>
<p>The version of libgcrypt is 1.4.5 but its API is 11.5.3.</p>
<p>In order to set the Libtool library version you set the  -version-info 11:5:3 flag using libmylib_la_LDFLAGS in your Makefile.am (<a href="http://www.gnu.org/software/automake/manual/automake.html" target="_blank">See the automate manual</a>).</p>
<p>By contrast /lib64/libproc-3.2.8.so has no numbers after the .so. They all appear before it. This reflects the fact that the developers, for whatever reason decided to use the version number of the application in the library. Running free gives</p>
<pre># free -V
procps version 3.2.8</pre>
<p>This is achieved by using the flag  -release in place of -version-info in Makefile.am.</p>
<p>libparted-2.1.so.0.0.0 shows both. Running parted gives</p>
<pre># parted -v
parted (GNU parted) 2.1</pre>
<h3>OS X</h3>
<p>According to <a href="http://www.finkproject.org" target="_blank">Fink</a> the <a href="http://www.finkproject.org/doc/porting/porting.en.html#shared.lib-and-mod" target="_blank">situation on OS X is slightly different</a>. There is a &#8220;strict distinction between shared libraries and dynamically loadable modules&#8221;. On linux any &#8221;shared code can be used as a library and for dynamic loading&#8221;. On OS X there are two types of library MH_DYLIB (a shared library) and MH_BUNDLE (a module). MH_DYLIB carry the extension .dylib and can be linked against in the familiar -lmylib at compile/link time. They can not be loaded as a module using dlopen(). MH_BUNDLE on the other hand can be dlopened. Apple suggest naming these .bundle however, much ported software uses .so instead. It is not directly possible to link against bundles as if they were shared libraries.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2012/05/library-versioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selecting an interval from a integer column in PostgreSQL</title>
		<link>http://sinodun.com/2012/04/selecting-an-interval-from-a-integer-column-in-postgresql/</link>
		<comments>http://sinodun.com/2012/04/selecting-an-interval-from-a-integer-column-in-postgresql/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 14:05:16 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[databases]]></category>
		<category><![CDATA[dev]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=622</guid>
		<description><![CDATA[I needed to create a select that combined a timestamp in one column with an interval specified in minutes from another column. After much manual reading and searching I found the answer on stackoverflow. My SQL looked something like: SELECT d.time AT TIME ZONE 'UTC' + interval '1 minute' * d.minute as time FROM my data [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to create a select that combined a timestamp in one column with an interval specified in minutes from another column. After much manual reading and searching I found the answer on <a href="http://stackoverflow.com/questions/5266758/dynamic-column-based-interval" target="_blank">stackoverflow</a>. My SQL looked something like:</p>
<pre>SELECT d.time AT TIME ZONE 'UTC' + interval '1 minute' * d.minute as time FROM my data d ...</pre>
<p>Much faster than using Perl&#8217;s DateTime::Format::Pg and DateTime::Duration modules to do the addition.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2012/04/selecting-an-interval-from-a-integer-column-in-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading the Subversion plugin on Jenkins</title>
		<link>http://sinodun.com/2012/03/upgrading-the-subversion-plugin-on-jenkins/</link>
		<comments>http://sinodun.com/2012/03/upgrading-the-subversion-plugin-on-jenkins/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 12:55:16 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[dev]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=617</guid>
		<description><![CDATA[Since upgrading our subversion server to 1.7 I have tried several times to upgrade the subversion plugin on Jenkins (v1.457) from 1.34 to 1.39. Using the plugin manager it downloads the plugin and asks you to restart. However, when you restart the jenkins.war expands and overwrites the newly downloaded plugin with the 1.34 version that I [...]]]></description>
			<content:encoded><![CDATA[<p>Since upgrading our subversion server to 1.7 I have tried several times to upgrade the subversion plugin on Jenkins (v1.457) from 1.34 to 1.39. Using the plugin manager it downloads the plugin and asks you to restart. However, when you restart the jenkins.war expands and overwrites the newly downloaded plugin with the 1.34 version that I guess is shipped in the war.</p>
<p>The solution is easy. Use the plugin manager to download the plugin and change the ownership of the subversion.jpi file so that the jenkins user can not overwrite it. Then restart. (This will make future upgrades more difficult as you will have to revert the ownership).</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2012/03/upgrading-the-subversion-plugin-on-jenkins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cutting down the noise of automake</title>
		<link>http://sinodun.com/2012/02/cutting-down-the-noise-of-automake/</link>
		<comments>http://sinodun.com/2012/02/cutting-down-the-noise-of-automake/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 19:32:47 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[dev]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=613</guid>
		<description><![CDATA[Adding AM_SILENT_RULES([yes]) to your configure.ac will greatly reduce the output of make. It will look very similar to the linux kernel build: Making all in common CC strlcat.o CC strlcpy.o AR libcompat.a Making all in netconf/src/ncx CC libncx_a-b64.o CC libncx_a-blob.o CC libncx_a-bobhash.o CC libncx_a-cap.o This line must go after your AM_INIT_AUTOMAKE initialization. You need to be [...]]]></description>
			<content:encoded><![CDATA[<p>Adding AM_SILENT_RULES([yes]) to your configure.ac will greatly reduce the output of make. It will look very similar to the linux kernel build:</p>
<pre>Making all in common
  CC     strlcat.o
  CC     strlcpy.o
  AR     libcompat.a
Making all in netconf/src/ncx
  CC     libncx_a-b64.o
  CC     libncx_a-blob.o
  CC     libncx_a-bobhash.o
  CC     libncx_a-cap.o</pre>
<p>This line must go after your AM_INIT_AUTOMAKE initialization. You need to be using automake &gt;= 1.11. There is a good explanation <a href="http://www.flameeyes.eu/autotools-mythbuster/automake/silent.html" target="_blank">here</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2012/02/cutting-down-the-noise-of-automake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd-update</title>
		<link>http://sinodun.com/2012/02/freebsd-update/</link>
		<comments>http://sinodun.com/2012/02/freebsd-update/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 19:11:13 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=608</guid>
		<description><![CDATA[I have always liked FreeBSD. IMHO it has the best and most up-to-date software collection in the form of ports (much more current than Gentoo last time I looked). I was always irritated by how hard it was to upgrade the kernel and core OS. Talking to several friends I found that the new(ish) freebsd-update utility [...]]]></description>
			<content:encoded><![CDATA[<p>I have always liked FreeBSD. IMHO it has the best and most up-to-date software collection in the form of ports (much more current than Gentoo last time I looked). I was always irritated by how hard it was to upgrade the kernel and core OS. Talking to several friends I found that the new(ish) <a href="http://www.freebsd.org/doc/handbook/updating-freebsdupdate.html" target="_blank">freebsd-update</a> utility seems to have passed a lot of people by.</p>
<p>It allows binary updates to the FreeBSD OS (not ports or packages) it also supports major and minor release upgrades. Along with portsnap and portupgrade FreeBSD is now as easy to manage as any other OS.</p>
<p>One minor gotcha is that it only updates the version number reported by uname if the kernel has been upgraded.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2012/02/freebsd-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Yuma</title>
		<link>http://sinodun.com/2011/12/auto-yuma/</link>
		<comments>http://sinodun.com/2011/12/auto-yuma/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 16:12:14 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[dnsccm]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=601</guid>
		<description><![CDATA[I have written a simple script that converts yuma tools so that it can be compiled via autoconf/automake. There is still a lot of work needed to get all the features working but the basics are there and it builds on OS X Lion. It forms part of our effort to develop DNSCCM (DNS Configuration, Control and [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a simple <a href="http://dnsccm.org/projects/dnsccm/repository/show/trunk/auto-yuma" target="_blank">script</a> that converts <a href="http://www.netconfcentral.org/yuma" target="_blank">yuma tools</a> so that it can be compiled via autoconf/automake. There is still a lot of work needed to get all the features working but the basics are there and it builds on OS X Lion.</p>
<p>It forms part of our effort to develop <a href="http://dnsccm.org/" target="_blank">DNSCCM (DNS Configuration, Control and Monitoring)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2011/12/auto-yuma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun and games with OS X Lion Server</title>
		<link>http://sinodun.com/2011/08/fun-and-games-with-os-x-lion-server/</link>
		<comments>http://sinodun.com/2011/08/fun-and-games-with-os-x-lion-server/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 14:10:21 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=581</guid>
		<description><![CDATA[With the recent release of Lion I decided to upgrade my desktop from Snow Leopard client to Lion Server and at the same time migrate the Snow Leopard mac mini server over to it. According to the combination of a knowledge base article and the migration instructions Chapter 3 page 24 this should be easy. It was [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent release of Lion I decided to upgrade my desktop from Snow Leopard client to Lion Server and at the same time migrate the Snow Leopard mac mini server over to it.</p>
<p>According to the combination of a <a href="http://support.apple.com/kb/HT4766" target="_blank">knowledge base article</a> and the <a href="http://manuals.info.apple.com/en_US/lion_server_upgrading_migrating.pdf" target="_blank">migration instructions</a> Chapter 3 page 24 this should be easy. It was not.</p>
<p>The knowledge base instructions say in step 2-7</p>
<blockquote><p>Open &#8220;Install Mac OS X Lion&#8221;. <strong>Note</strong>: In order to install Lion Server, the Server app must be in the same folder as the Install Mac OS X app. If you just purchased Lion Server, these items should be in the Applications folder on the startup disk.</p>
<p>Click continue and agree to the software license agreement if you agree.</p>
<p>Click the &#8220;Show All Disks…&#8221; button.</p>
<p>Select a blank disk on which to install.</p>
<p>Click the Customize button.</p>
<p>Select the Server Software package.</p></blockquote>
<p>Unfortunately that isn&#8217;t true. It only works if you are already running Lion Server!!! Here is what you need to do.</p>
<p>Assuming you have a disposable Snow Leopard client on volume A and have a blank volume B.</p>
<ol>
<li>Boot into Snow Leopard client.</li>
<li>Use disk utility to erase volume B</li>
<li>Download both the Lion Client app and the Lion Server app from the app store.</li>
<li>They will be place in you /Applications folder</li>
<li>Run the Lion Client app, when asked press &#8220;Show all disks&#8221; then select install on Volume B.</li>
<li>Unlike what Apple say the customise button will stay greyed out and it will ignore the Server app.</li>
<li>During the install ignore the option to migrate (This is a client only migration).</li>
<li>Once Lion Client is installed run the Server App to install the server component</li>
<li>Copy the Lion Client app and the Lion Server app from the volume A /Applications to the new Lion Server /Applications directory.</li>
<li>Use disk utility to erase volume A</li>
<li>Run the Lion Client app, when asked press &#8220;Show all disks&#8221; then select install on Volume A.</li>
<li>This time what Apple say will be true. The customise button will be enabled and you will be able to select the Server component to install.</li>
<li>Connect the mac mini in target disk mode and during the install you will be invited to migrate from another server.</li>
</ol>
<p>This <a href="http://support.apple.com/kb/ht4771" target="_blank">guide to hosting Lion software updates on a Snow Leopard Server</a> is correct and useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2011/08/fun-and-games-with-os-x-lion-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New version of NSCP draft</title>
		<link>http://sinodun.com/2011/03/new-version-of-nscp-draft/</link>
		<comments>http://sinodun.com/2011/03/new-version-of-nscp-draft/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 12:27:04 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=544</guid>
		<description><![CDATA[We have released a new version of the Name Server Control Protocol (NSCP) draft. Older versions of this draft described the use of NETCONF as a transport protocol. For now this has been removed to concentrate on the data model. You can find older versions by clicking on the Projects tab.]]></description>
			<content:encoded><![CDATA[<p>We have released a new version of the <a href="http://tools.ietf.org/id/draft-dickinson-dnsop-nameserver-control-02.txt" target="_blank">Name Server Control Protocol (NSCP) draft</a>.</p>
<p>Older versions of this draft described the use of NETCONF as a transport protocol. For now this has been removed to concentrate on the data model.</p>
<p>You can find older versions by clicking on the Projects tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2011/03/new-version-of-nscp-draft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing grub2 on GNU/Linux Software Raid</title>
		<link>http://sinodun.com/2010/07/installing-grub2-on-gnulinux-software-raid/</link>
		<comments>http://sinodun.com/2010/07/installing-grub2-on-gnulinux-software-raid/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 11:51:47 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sinodun.com/?p=522</guid>
		<description><![CDATA[I have been setting up a two machines with software raid to use as Xen virtual environments. The two machines have 5 and 4 500GB disks. I decided to run Gentoo as the Dom0  OS because there is lots of good documentation for it and it has always been my favorite GNU/Linux distribution. The install [...]]]></description>
			<content:encoded><![CDATA[<p>I have been setting up a two machines with software raid to use as Xen virtual environments. The two machines have 5 and 4 500GB disks. I decided to run Gentoo as the Dom0  OS because there is lots of good documentation for it and it has always been my favorite GNU/Linux distribution. The install of the OS and xen is easy. I opted for the latest Xen 4.0.1rc3-pre code. Just emerge xen and xen-tools to get all the prerequisites and the unmerge them and build the latest source. Creating the RAID arrays was also easy. I did the following.</p>
<p><span id="more-522"></span></p>
<pre>for disk in a b c d ; do
parted -s /dev/sd$disk rm 1 rm 2 rm 3 rm 4 rm 5
parted -s /dev/sd$disk mklabel gpt
parted -s /dev/sd$disk mkpart STUFF 17.4kB 1049kB
parted -s /dev/sd$disk set 1 bios_grub on
parted -s /dev/sd$disk mkpart BOOT 1049kB 5GB
parted -s /dev/sd$disk mkpart SWAP 5GB 21GB
parted -s /dev/sd$disk mkpart ROOT 21GB 71GB
parted -s /dev/sd$disk mkpart XEN 71GB 500GB
for $part in 2 3 4 5 ; do
parted -s /dev/sd$disk set $part raid on
done
done

for md in 1 2 3 4 5 ; do
echo "Removing array"
mdadm --remove --stop /dev/md$md

echo "Creating Array"
if [ x$md == "x2" ] ; then
echo "yes" | mdadm --create /dev/md$md -f --level=1 --raid-devices=4 --metadata=0.90 /dev/sda$md /dev/sdb$md /dev/sdc$md /dev/sdd$md
mkfs.ext2 /dev/md$md
elif [ x$md == "x5" ] ; then
echo "yes" | mdadm --create /dev/md$md -f --level=5 --raid-devices=4 /dev/sda$md /dev/sdb$md /dev/sdc$md /dev/sdd$md
mkfs.xfs -f /dev/md$md
else
echo "yes" | mdadm --create /dev/md$md -f --level=1 --raid-devices=4 /dev/sda$md /dev/sdb$md /dev/sdc$md /dev/sdd$md
if [ x$md == "x3" ] ; then
mkswap /dev/md$md
elif [ x$md == "x4" ] ; then
mkfs.ext4 /dev/md$md
fi
fi
done

mount /dev/md4 /mnt/gentoo
mkdir /mnt/gentoo/boot
mkdir /mnt/gentoo/xen
mount /dev/md2 /mnt/gentoo/boot
swapon /dev/md3
mount /dev/md5 /mnt/gentoo/xen
cd /mnt/gentoo
tar -xjpf /root/stage3-amd64-20100514.tar.bz2 -C /mnt/gentoo
cp -f /root/portage-latest.tar.bz2 /mnt/gentoo
cd /
mount -t proc proc /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
env-update &amp;&amp; source /etc/profile
cd /usr
tar -xjpf /portage-latest.tar.bz2

cp /usr/share/zoneinfo/Europe/London /etc/localtime
cd /etc
echo "127.0.0.1 xen1.sinodun.com xen1 localhost" &gt; hosts
hostname xen1
emerge --sync --quiet
eselect profile set 7
cat &lt;&lt; EOF &gt; /etc/make.conf
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
CHOST="x86_64-pc-linux-gnu"
USE="threads -gnome -kde -minimal -qt4 nfs branding dbus hal jpeg lock session startup-notification thunar X hal fglrx lvm qemu-ifup qemu_user_targets_x86_64 qemu_softmmu_targets_x86_64 aio udev libvirtd lxc network phyp policykit caps nfsv4 parted qemu ccache xen nat ioemu hvm mmx sse sse2 X"

GENTOO_MIRRORS="ftp://mirror.qubenet.net/mirror/gentoo/ ftp://gentoo.wheel.sk/pub/linux/gentoo/ ftp://ftp.swin.edu.au/gentoo"
FEATURES="ccache"
CCACHE_DIR="/var/tmp/ccache"
CCACHE_SIZE="2G"

EOF

mkdir /etc/portage/
cat &lt;&lt; EOF &gt; /etc/portage/package.keywords
dev-python/python-augeas
app-emulation/qemulator
app-admin/augeas
sys-fs/device-mapper
net-firewall/shorewall6-lite
net-nds/rpcbind
net-fs/nfs4-acl-tools
app-emulation/qemu-kvm
net-analyzer/netcat6
x11-libs/cairo
app-emulation/xen
app-emulation/xen-tools
app-emulation/virt-manager
app-emulation/virtinst
app-emulation/libvirt
sys-kernel/xen-sources
net-firewall/ipsec-tools
&lt;sys-boot/grub-9999 **
EOF

emerge ccache mdadm gentoolkit

cat /dev/null  &gt; /etc/mdadm.conf
for md in 1 2 3 4 5 ; do
echo DEVICE /dev/sd[abcd]$md  &gt;&gt; /etc/mdadm.conf
done
for md in 1 2 3 4 5 ; do
echo ARRAY /dev/md$md UUID=`mdadm -D /dev/md$md | grep UUID | awk ' { print $3 } '` &gt;&gt; /etc/mdadm.conf
done</pre>
<p>Then I grabbed a copy of the 2.6.34 kernel and built it with all the Xen features turned on, all the software RAID on and all the drivers for my disk controllers on. I don&#8217;t use an initramfs so they all need to be in the kernel for raid auto-detection to work at boot time.</p>
<p>Then the problems started&#8230;</p>
<p>I could not get any release of grub2 to mutiboot xen and my kernel. Eventually I found that the fix was to get the latest grub code from Bazaar and to use that with a few work arounds.</p>
<ul>
<li>First unmerge any existing grub</li>
<li>build and install the code from bazaar</li>
<li>run grub-mkdevicemap. This will give a file called /boot/grub/device.map that looks something like this:</li>
</ul>
<pre>(hd0)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405131
(hd1)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405138
(hd2)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405139
(hd3)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405141
(hd4)    /dev/disk/by-id/md-uuid-5e9a37eb:6f0d060b:3cdba84c:474e7631
(hd5)    /dev/disk/by-id/md-uuid-66f62ccf:59a6fd08:3cdba84c:474e7631
(hd6)    /dev/disk/by-id/md-uuid-69ac7eac:5395e23b:3cdba84c:474e7631
(hd7)    /dev/disk/by-id/md-uuid-6fd706d5:94eafa75:3cdba84c:474e7631
(hd8)    /dev/disk/by-id/md-uuid-f4168a40:b212cce4:3cdba84c:474e7631</pre>
<ul>
<li>This needs altering to  give md names to the RAID disks. A script like this will do the hard part</li>
</ul>
<pre>for i in 1 2 3 4 5
do echo -n "(md$i)    /dev/disk/by-id/md-uuid-"  &gt;&gt; /boot/grub/device.map
mdadm -D /dev/md$i | grep UUID | awk ' { print $3 } ' &gt;&gt; /boot/grub/device.map
done
# cut the old lines oiut of the file</pre>
<ul>
<li>to read like this</li>
</ul>
<pre>(hd0)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405131
(hd1)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405138
(hd2)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405139
(hd3)    /dev/disk/by-id/ata-SAMSUNG_HD502HJ_S20BJ9CZ405141
(md1)    /dev/disk/by-id/md-uuid-6fd706d5:94eafa75:3cdba84c:474e7631
(md2)    /dev/disk/by-id/md-uuid-69ac7eac:5395e23b:3cdba84c:474e7631
(md3)    /dev/disk/by-id/md-uuid-f4168a40:b212cce4:3cdba84c:474e7631
(md4)    /dev/disk/by-id/md-uuid-66f62ccf:59a6fd08:3cdba84c:474e7631
(md5)    /dev/disk/by-id/md-uuid-5e9a37eb:6f0d060b:3cdba84c:474e7631</pre>
<ul>
<li>Then run grub-mkconfig -o /tmp/grub.cfg. This file will look something like this</li>
</ul>
<pre>Generating grub.cfg ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /usr/local/etc/grub.d and settings from /usr/local/etc/default/grub
#

### BEGIN /usr/local/etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
 load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
 set saved_entry="${prev_saved_entry}"
 save_env saved_entry
 set prev_saved_entry=
 save_env prev_saved_entry
 set boot_once=true
fi

function savedefault {
 if [ -z "${boot_once}" ]; then
 saved_entry="${chosen}"
 save_env saved_entry
 fi
}

function load_video {
 insmod vbe
 insmod vga
 insmod video_bochs
 insmod video_cirrus
}

insmod raid
insmod mdraid
insmod part_gpt
insmod part_gpt
insmod part_gpt
insmod part_gpt
insmod ext2
set root='(md4)'
search --no-floppy --fs-uuid --set 25de7b8d-303c-47fa-8ebb-9b2276f17b5f
if loadfont /usr/local/share/grub/unicode.pf2 ; then
 set gfxmode=640x480
 load_video
 insmod gfxterm
fi
if terminal_output gfxterm ; then true ; else
 # For backward compatibility with versions of terminal.mod that don't
 # understand terminal_output
 terminal gfxterm
fi
insmod raid
insmod mdraid
insmod part_gpt
insmod part_gpt
insmod part_gpt
insmod part_gpt
insmod ext2
set root='(md2)'
search --no-floppy --fs-uuid --set 9de924a9-a266-4952-90a5-2aec6a9d3cce
set locale_dir=($root)/grub/locale
set lang=
insmod gettext
set timeout=5
### END /usr/local/etc/grub.d/00_header ###

### BEGIN /usr/local/etc/grub.d/09_xen ###
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "vmlinuz-2.6.34-xen" {
insmod raid
insmod mdraid
insmod part_gpt
insmod ext2
set root='(md2)'
multiboot /xen.gz dummy=dummy
module /vmlinuz-2.6.34-xen dummy=dummy root=/dev/md4 max_loop=64
}

### END /usr/local/etc/grub.d/09_xen ###

### BEGIN /usr/local/etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-2.6.34-xen
menuentry 'GNU/Linux, with Linux 2.6.34-xen' --class gnu-linux --class gnu --class os {
 load_video
 insmod raid
 insmod mdraid
 insmod part_gpt
 insmod part_gpt
 insmod part_gpt
 insmod part_gpt
 insmod ext2
 set root='(md2)'
 search --no-floppy --fs-uuid --set 9de924a9-a266-4952-90a5-2aec6a9d3cce
 echo    'Loading Linux 2.6.34-xen ...'
 linux    /vmlinuz-2.6.34-xen root=/dev/md4 ro  
}
menuentry 'GNU/Linux, with Linux 2.6.34-xen (recovery mode)' --class gnu-linux --class gnu --class os {
 load_video
 insmod raid
 insmod mdraid
 insmod part_gpt
 insmod part_gpt
 insmod part_gpt
 insmod part_gpt
 insmod ext2
 set root='(md2)'
 search --no-floppy --fs-uuid --set 9de924a9-a266-4952-90a5-2aec6a9d3cce
 echo    'Loading Linux 2.6.34-xen ...'
 linux    /vmlinuz-2.6.34-xen root=/dev/md4 ro single
}
### END /usr/local/etc/grub.d/10_linux ###

### BEGIN /usr/local/etc/grub.d/20_linux_xen ###
### END /usr/local/etc/grub.d/20_linux_xen ###

### BEGIN /usr/local/etc/grub.d/30_os-prober ###
### END /usr/local/etc/grub.d/30_os-prober ###

### BEGIN /usr/local/etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /usr/local/etc/grub.d/40_custom ###

### BEGIN /usr/local/etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
 source $prefix/custom.cfg;
fi
### END /usr/local/etc/grub.d/41_custom ###
done</pre>
<ul>
<li>Unfortunately, those two UUIDs are totally wrong. They come from grub-probe (run by grub-mkconfig)</li>
</ul>
<pre>grub-probe -d --target=fs_uuid /dev/md2
9de924a9-a266-4952-90a5-2aec6a9d3cce</pre>
<ul>
<li>/dev/md2 is my boot disk but according to mdadm the UUID should be:</li>
</ul>
<pre>mdadm -D /dev/md2
/dev/md2:
 Version : 0.90
 Creation Time : Fri Jul  9 11:25:32 2010
 Raid Level : raid1
 Array Size : 4881664 (4.66 GiB 5.00 GB)
 Used Dev Size : 4881664 (4.66 GiB 5.00 GB)
 Raid Devices : 4
 Total Devices : 4
Preferred Minor : 2
 Persistence : Superblock is persistent

 Update Time : Sat Jul 10 13:08:31 2010
 State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
 Spare Devices : 0

 UUID : 69ac7eac:5395e23b:3cdba84c:474e7631
 Events : 0.36

 Number   Major   Minor   RaidDevice State
 0       8        2        0      active sync   /dev/sda2
 1       8       18        1      active sync   /dev/sdb2
 2       8       34        2      active sync   /dev/sdc2
 3       8       50        3      active sync   /dev/sdd2</pre>
<ul>
<li>Fix that by hand in the config don&#8217;t forget t change the UUID format to 12345678-1234-1234-1234-123456789abc and copy it to /boot/grub/grub.cfg.</li>
<li>Finally run grub-install /dev/md1 and you&#8217;re done.</li>
<li>Exit the install</li>
</ul>
<pre>exit
umount /mnt/gentoo/proc
umount /mnt/gentoo/dev
umount /dev/md2
umount /dev/md5
swapoff /dev/md3
umount /dev/md4</pre>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2010/07/installing-grub2-on-gnulinux-software-raid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Netgear ReadyNAS Pro</title>
		<link>http://sinodun.com/2010/02/netgear-readynas-pro/</link>
		<comments>http://sinodun.com/2010/02/netgear-readynas-pro/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:05:52 +0000</pubDate>
		<dc:creator>jad</dc:creator>
				<category><![CDATA[is it me?]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://sinodun.com/blog/?p=459</guid>
		<description><![CDATA[I bought one of these because I keep running out of disk space. With the ability to store 12Tb, I thought it might keep me going for some time to come. It allows you to build raid 0,1 and 5 arrays and Netgear&#8217;s own X raid something or other. Unfortunately, it doent allow striping and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I bought one of <a href="http://www.netgear.com/Products/Storage/ReadyNASPro.aspx" target="_blank">these</a> because I keep running out of disk space. With the ability to store 12Tb, I thought it might keep me going for some time to come.</p>
<p style="text-align: left;">It allows you to build raid 0,1 and 5 arrays and Netgear&#8217;s own X raid something or other. Unfortunately, it doent allow striping and mirroring. It  is compatible with OS X and supports AFP shares and Timemachine as well as <a href="http://sinodun.com/blog/2010/02/os-x-server/">iscsi as I mentioned earlier</a>. However, the GUI is a bit flaky and didn&#8217;t seem to like <a href="http://en.wikipedia.org/wiki/ISCSI#Addressing">Initiator iqn&#8217;s</a> at all. If you download the root ssh plugin you can access the box as root over ssh and look at what it is actually doing.</p>
<p style="text-align: left;">iscsi config is held in /etc/ietd.conf</p>
<pre style="text-align: left;">Target iqn.2010-2.taurus.sinodun.com:calendarserver
 Lun 0 Path=/e/calendarserver,Type=fileio,ScsiSN=RN293R60037B-003,IOMode=wb
 HeaderDigest CRC32,None
 DataDigest CRC32,None
 IncomingUser user xxxxxxxxxxxx
 InitiatorIQN iqn.2010-02.com.sinodun.hydra:calendarserver

Target iqn.2010-2.taurus.sinodun.com:collaboration
 Lun 0 Path=/e/collaboration,Type=fileio,ScsiSN=RN293R60037B-001,IOMode=wb
 HeaderDigest CRC32,None
 DataDigest CRC32,None
 IncomingUser user xxxxxxxxxxxx
 InitiatorIQN iqn.2010-02.com.sinodun.hydra:collaboration</pre>
<p style="text-align: left;">Firstly their Target IQNs don&#8217;t look like the spec described on wikipedia &#8211; I don&#8217;t know if it is Netgear or Wikipedia that is wrong here and don&#8217;t care as this doen&#8217;t seem to break anything.</p>
<p style="text-align: left;">The real problem in the Initiator IQN &#8211; I had to add this by hand and it gets stripped out of every entry in the file every time a new iscsi target is created and at other random times. According to the Netgear web GUI theses are needed for persistent reservation support.</p>
<p style="text-align: left;">However, once it is working it seems nice and stable. If your disks don&#8217;t mount just go and check those Initiator IQNs.</p>
]]></content:encoded>
			<wfw:commentRss>http://sinodun.com/2010/02/netgear-readynas-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

