<?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>Technical Exhaustion</title>
	<atom:link href="http://www.eztiger.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eztiger.org</link>
	<description>Tech tips from the weary</description>
	<lastBuildDate>Mon, 30 Mar 2009 22:21:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting up gmirror on a live server remotely.</title>
		<link>http://www.eztiger.org/2009/03/setting-up-gmirror-on-a-live-server-remotely/</link>
		<comments>http://www.eztiger.org/2009/03/setting-up-gmirror-on-a-live-server-remotely/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 22:16:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[gmirror]]></category>
		<category><![CDATA[mirroring]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=58</guid>
		<description><![CDATA[I&#8217;ve previously discussed how to recover from a disk failure in gmirror. It&#8217;s probably a good idea to describe how to set up a new mirror from scratch. Rather handily this can be done on a live system, remotely via ssh in the space of a few minutes. One reboot is required but other than [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously discussed how to recover from a disk failure in gmirror. It&#8217;s probably a good idea to describe how to set up a new mirror from scratch.</p>
<p>Rather handily this can be done on a live system, remotely via ssh in the space of a few minutes. One reboot is required but other than that the process is seamless.</p>
<p>My existing install is on disk ad4 and the &#8216;spare&#8217; disk I want to mirror this existing installation to is ad6.</p>
<p>Both are 160 gig SATA disks.</p>
<p>Login in as root however way you see fit.</p>
<p>Before we can configure the new mirror we need to disable a safety feature of GEOM :</p>
<p><code># sysctl kern.geom.debugflags=16<br />
kern.geom.debugflags: 0 -> 16</code></p>
<p>This allows us to perform operations on a mounted, and in use disk. This is just set for the current session and will be reset to normal when we reboot &#8211; which we&#8217;ll be doing shortly.</p>
<p>Whilst we&#8217;re doing housekeeping, lets enable gmirror at boot :</p>
<p><code># echo geom_mirror_load="YES" >> /boot/loader.conf</code></p>
<p>You should probably check your loader.conf first. On a fresh system its empty and the above command is safe, however you probably want to have a quick glance over it and backup your existing one as a precaution if it contains existing settings.</p>
<p>Lets create our new mirror &#8211; with one command :</p>
<p><code># gmirror label -v -b round-robin gm0 /dev/ad4<br />
Metadata value stored on /dev/ad4</code></p>
<p>And we&#8217;re done! We now have a gmirror device but with only one member &#8211; the existing disk.</p>
<p>There are a number of different balance algorithms to choose from, the gmirror man page steps in :</p>
<p><code>load, prefer,round-robin,split</code></p>
<p>Finding out information on how these actually perform under the hood (beyond the superficial explanation in the man page) is quite tricky. And indeed most information leads to the fact that they don&#8217;t really behave as hoped and you&#8217;re better off sticking with round-robin which does what it says and gives marginally the best performance.</p>
<p>If you want to test with your specific work load / pattern you can change this anytime you like :</p>
<p><code>gmirror configure -b load gm0</code></p>
<p>Now we have a mirror device, and have enabled the drivers to be loaded on boot &#8211; we need to tell our system to mount from it next boot. So we need to edit /etc/fstab. Take a backup of your existing one now!</p>
<p>What happens next depends on your specific install. In general you need to add /dev/mirror/ to each entry and you need to change your hard disk device to be gm0 (or whatever you chose in the above to call your mirror device).</p>
<p>So I had a previous entry :</p>
<p><code>/dev/ad4s1a  /               ufs     rw              1       1</code></p>
<p>Which now becomes :</p>
<p><code>/dev/mirror/gm0s1a /               ufs     rw              1       1</code></p>
<p>Repeat for each mount point that contains reference to your existing disk. Make sure you get this right, any errors here means you won&#8217;t be booting back up without difficulty!</p>
<p>Once you&#8217;re happy &#8211; reboot!</p>
<p>Cross your fingers.</p>
<p>Wait anxiously.</p>
<p>Nervously fidget.</p>
<p>And you&#8217;re back! Log in and do a quick df, hopefully you should see something akin to :</p>
<p><code>/dev/mirror/gm0s1a    507630 141610    325410    30%    /</code></p>
<p>Looking good so far. Lets check the mirror is up :</p>
<p><code># gmirror status<br />
      Name    Status  Components<br />
mirror/gm0  COMPLETE  ad4</code></p>
<p>ok, so far so good. We&#8217;re up and running on our new mirror device. But it still only has one member. We need to add our second, ad6, disk.</p>
<p><code>#gmirror insert gm0 /dev/ad6</code></p>
<p>And we&#8217;re done! You&#8217;re now mirrored &#8211; your mirror is currently degraded :</p>
<p><code># gmirror status<br />
      Name    Status  Components<br />
mirror/gm0  DEGRADED  ad4<br />
                      ad6 (70%)</code></p>
<p>But will soon become complete when the new disk finished sync&#8217;ing.</p>
<p><code># gmirror status<br />
      Name    Status  Components<br />
mirror/gm0  COMPLETE  ad4<br />
                                ad6</code></p>
<p>And we&#8217;re done.</p>
<p>There are some caveats that should be mentioned.</p>
<p>I&#8217;ve run this config in anger in production for years now and never had problems &#8211; but there is a more complicated procedure to configure gmirror :</p>
<p><a href="http://people.freebsd.org/~rse/mirror/">http://people.freebsd.org/~rse/mirror/</a></p>
<p>This takes into account the differening gemoetries of your two disks and avoids any problem with data going where it shouldn&#8217;t.</p>
<p><a href="http://markmail.org/message/6vqfrgufv6jeu3yq#query:freebsd%20set%20up%20geom%20mirror+page:1+mid:wfkmluqgni45jzdo+state:results">http://markmail.org/message/6vqfrgufv6jeu3yq#query:freebsd%20set%20up%20geom%20mirror+page:1+mid:wfkmluqgni45jzdo+state:results</a></p>
<p>gmirror also seems to be a performance dog, especially when compared to Linux software RAID. Which is unfortunate.</p>
<p><a href="http://www.freebsdwiki.net/index.php/RAID,_performance_tests">http://www.freebsdwiki.net/index.php/RAID,_performance_tests</a></p>
<p>But it&#8217;s ease of use lets me put up with that. Although hopefully we will see improvements over the next few versions of FreeBSD.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2009/03/setting-up-gmirror-on-a-live-server-remotely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD Installer Bug</title>
		<link>http://www.eztiger.org/2009/03/freebsd-installer-bug/</link>
		<comments>http://www.eztiger.org/2009/03/freebsd-installer-bug/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 21:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Installer]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=56</guid>
		<description><![CDATA[I came across a known bug in the FreeBSD installer for the first time today. During the text network install (using the netboot iso) I had problems resolving the hostname of my chosen FTP mirror. The installer hung for an age trying to connect. Assuming I had a made a typo in the network config, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a known bug in the FreeBSD installer for the first time today.</p>
<p>During the text network install (using the netboot iso) I had problems resolving the hostname of my chosen FTP mirror. The installer hung for an age trying to connect.</p>
<p>Assuming I had a made a typo in the network config, I ctrl+c&#8217;d the installer and chose to restart the install process when prompted.</p>
<p>This time round I connected and started retrieving package sets correctly &#8211; maybe I did make that typo after all.</p>
<p>However in the half dozen or so times I rebooted the server and restarted the install completely from scratch &#8211;  I received various different errors ranging from simple &#8216;disk full&#8217; messages to &#8216;unable to create symlink&#8217; errors and even &#8216;no free inodes&#8217; !</p>
<p>I was working remotely over a KVMoIP at the time and was starting to fret I had hardware issues on the other end of the line.</p>
<p>This belief was also founded on receiving the notorious disk geometry error from the installer during the partitioning stage. This is a long standing &#8216;issue&#8217; and these days really means very little (in fact I believe it is being supressed as of FreeBSD 8? Finally!) and from past experience usually presents no problem &#8211; but there is always a nagging doubt &#8211; especially if more things go wrong!</p>
<p>However it turns out I had fallen foul of yet another long standing bug in the installer. This time if ctrl+c&#8217;ing out the installer and restarting (without rebooting) the next time round the installation attempts to write to the ramdisk instead of your allocated spinning disk &#8211; which obviously fills up very quickly and soon gives a variety of disk full errors!</p>
<p><a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/45565">http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/45565</a><br />
<a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=42162&#038;cat=bin">http://www.freebsd.org/cgi/query-pr.cgi?pr=42162&#038;cat=bin</a></p>
<p>These reports are dated 2002! and still this issue remains.</p>
<p>The solution is to point the installer to the IP address of the FTP server and bypass the icky host resolution.</p>
<p>FreeBSD has a &#8216;notorious&#8217; reputation for being very hardware picky which, in actual fact, is quite far from the truth these days. Whilst not matching Linux, support is very good &#8211; certainly when compared to OpenSolaris. However I can&#8217;t help but wonder if these two very long standing features / bugs which present themselves very quickly during the already outdated (by modern standards) install procedure, cause people to instantly assume there is a support issue with their disk and / or controller and thus to  move on (quite speedily I would warrant) from FreeBSD.</p>
<p>There is constant talk of a revamped installer but as of yet no sign. Let&#8217;s hope FreeBSD 8 brings some improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2009/03/freebsd-installer-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with zones</title>
		<link>http://www.eztiger.org/2009/03/fun-with-zones/</link>
		<comments>http://www.eztiger.org/2009/03/fun-with-zones/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 11:35:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Zones]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=50</guid>
		<description><![CDATA[Some quick Solaris 10 Zone management commands. To list your running zones : # zoneadm list And with a bit more detail : #zoneadm list -v Change the IP address of a Zone #zonecfg -z zonecfg:zonename> select net address=oldip zonecfg:zonename:net> set address=newip zonecfg:zonename:net> end zonecfg:zonename> commit Change the name of a Zone #zonecfg -z zonename [...]]]></description>
			<content:encoded><![CDATA[<p>Some quick Solaris 10 Zone management commands.</p>
<p>To list your running zones :</p>
<p><code># zoneadm list</code></p>
<p>And with a bit more detail :</p>
<p><code>#zoneadm list -v</code></p>
<p><em><strong>Change the IP address of a Zone</strong></em></p>
<p><code>#zonecfg -z <zonename><br />
zonecfg:zonename> select net address=oldip<br />
zonecfg:zonename:net> set address=newip<br />
zonecfg:zonename:net> end<br />
zonecfg:zonename> commit</code></p>
<p><em><strong>Change the name of a Zone</strong></em></p>
<p><code>#zonecfg -z zonename<br />
zonecfg:zonename> set zonename=newzonename<br />
zonecfg:zonename> commit<br />
zonecfg:zonename> exit</code></p>
<p><em><strong>Moving a Zone on disk</strong></em></p>
<p>Stop the zone (let do this cleanly) :</p>
<p><code>#zoneadm -z zonename halt</code></p>
<p>Then move :</p>
<p><code>#zoneadm -z zonename move /your/new/path</code></p>
<p>You should see a message similar to :</p>
<p><code>Moving across file systems; copying zonepath /your/new/path...<br />
Cleaning up zonepath /your/new/path...</code></p>
<p>And bring it back up :</p>
<p><code>#zoneadm -z zonename boot</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2009/03/fun-with-zones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading mySQL 4 to mySQL 5 in FreeBSD</title>
		<link>http://www.eztiger.org/2009/02/upgrading-mysql-4-to-mysql-5-in-freebsd/</link>
		<comments>http://www.eztiger.org/2009/02/upgrading-mysql-4-to-mysql-5-in-freebsd/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 22:26:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=44</guid>
		<description><![CDATA[First a caveat : the following steps worked well on a lightly used mySQL server in production (~5 queries per second average, heavily biased to select&#8217;s &#8211; spread over around 30 individual databases) but your experience may vary on more heavily loaded servers. This also uses the ports build and the portupgrade tool. mySQL 5 [...]]]></description>
			<content:encoded><![CDATA[<p>First a caveat : the following steps worked well on a lightly used mySQL server in production (~5 queries per second average, heavily biased to select&#8217;s &#8211; spread over around 30 individual databases) but your experience may vary on more heavily loaded servers. This also uses the ports build and the portupgrade tool. mySQL 5 also brings changes to table structures, new features and changed features within the server. Ensure your applications or other database users are compatible with 5 before proceeding. Test accordingly!</p>
<p>Canonical steps :<br />
	<strong>
<li>Backup</li>
<li>Upgrade client first</li>
<li>Upgrade server</li>
<li>Start new server</li>
<li>Run post install update script</li>
<li>Test</li>
<p></strong><br />
<br />
	<em><strong>
<li>Backup</li>
<p></strong></em><br />
- Use mysqldump or whatever other backup process you have in place to take a backup before you begin. Once the backup has been taken move it somewhere safe and mark it as being taken immediately before the upgrade from 4 to 5. The upgrade process from 4 to 5 will examine/alter the structure and elements of *all* your databases so this is a significant backup milestone to keep.<br />
<br />
	<em><strong>
<li>Upgrade client</li>
<p></strong></em><br />
- We have to upgrade the client libraries first. As the mySQL 4 and mySQL 5 ports are completely seperate in the ports tree, we will use portupgrade to install 5, replacing 4 along the way. This is a different process than simply updating a port as you would normally.</p>
<p><code>cd /usr/ports<br />
portupgrade -o databases/mysql51-client mysql-client</code></p>
<p>This should install the upgraded console and libraries. You can verify the version with :</p>
<p><code># mysql --version<br />
mysql  Ver 14.14 Distrib 5.1.30, for portbld-freebsd6.2 (i386) using  5.0<br />
</code><br />
A good idea at this point is to check your server is still happy &#8211; run some queries and poke it a little bit.<br />
<br />
	<em><strong>
<li>Upgrade server</li>
<p></strong></em><br />
- The big one! We essentially do the same steps as the client upgrade. This will upgrade whilst the server continues to run. However, for some reason, the port install script stops mysql during the process &#8211; so this is the start of your, hopefully short, period of downtime.<br />
<code>cd /usr/ports<br />
portupgrade -o databases/mysql51-server mysql-server</code><br />
</p>
<p>	<em><strong>
<li>Start new server</li>
<p></strong></em><br />
- If all has gone well you can now start your new mySQL 5 server.<br />
<code># /usr/local/etc/rc.d/mysql-server start</code><br />
The rc.conf options have not changed so this will start right up. Login and confirm the new servers version. Handily this also checks that you *can* still login &#8211; which is an excellent first step to pass!</p>
<p><code># mysql -u root -p<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 2966<br />
Server version: 5.1.30 FreeBSD port: mysql-server-5.1.30</p>
<p></code></p>
<p>
<em><strong>
<li>Run post install update script</li>
<p></strong></em><br />
- This updates the mySQL table structure and various other housekeeping tasks to migrate your data from mySQL 4 to 5 format. The official definition is thus :</p>
<blockquote><p>mysql_upgrade program that checks all tables for incompatibilities with the current version of MySQL Server and repairs them if necessary. </p></blockquote>
<p>Strangely we do need to have the server running (with the old out of date formatted data) to perform this update &#8211; but mySQL seems quite happy to do so. Be warned this does change the data in your main mySQL database and it also parses and updates all your other databases where necessary. Hope you took that backup!<br />
<code>#mysql_upgrade -u root -p  –datadir=/var/db/mysql</code><br />
Obviously amend the datadir path if necessary &#8211; although the above is the FreeBSD default. This will grind away for potentially some time depending on the size of your data.<br />
<br />
<em><strong>
<li>Test</li>
<p></strong></em><br />
- That&#8217;s it, you&#8217;re all done! Now test, test and test. Check the data integrity and check your applications are still behaving as expected. You should also take the chance to update the client tools of other servers who may access this to version parity. It would also be worth rebuilding any &#8216;middleware&#8217; ports you have that interface with mySQL (php5-mysql, p5-mysql etc).</p>
<p>Have fun and good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2009/02/upgrading-mysql-4-to-mysql-5-in-freebsd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding all existing SGE projects</title>
		<link>http://www.eztiger.org/2009/01/finding-all-existing-sge-projects/</link>
		<comments>http://www.eztiger.org/2009/01/finding-all-existing-sge-projects/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 10:32:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SGE]]></category>
		<category><![CDATA[qconf]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=42</guid>
		<description><![CDATA[To find a list of current SGE projects, use the following flags to qconf : qconf -sprjl Which can be conveniently remembered as &#8216;show project list&#8217;.]]></description>
			<content:encoded><![CDATA[<p>To find a list of current SGE projects, use the following flags to qconf :</p>
<blockquote><p><tt>qconf -sprjl</tt></p></blockquote>
<p>Which can be conveniently remembered as &#8216;show project list&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2009/01/finding-all-existing-sge-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Grid Engine Cheat Sheet</title>
		<link>http://www.eztiger.org/2008/11/sun-grid-engine-cheat-sheet/</link>
		<comments>http://www.eztiger.org/2008/11/sun-grid-engine-cheat-sheet/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 12:02:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SGE]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=40</guid>
		<description><![CDATA[A nice cheat sheet for some common SGE tasks : http://idolinux.blogspot.com/2008/09/sge-cheat-sheet.html]]></description>
			<content:encoded><![CDATA[<p>A nice cheat sheet for some common SGE tasks :</p>
<p><a href="http://idolinux.blogspot.com/2008/09/sge-cheat-sheet.html">http://idolinux.blogspot.com/2008/09/sge-cheat-sheet.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2008/11/sun-grid-engine-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purging a backup volume in Bacula</title>
		<link>http://www.eztiger.org/2008/08/purging-a-backup-volume-in-bacula/</link>
		<comments>http://www.eztiger.org/2008/08/purging-a-backup-volume-in-bacula/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 13:49:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bacula]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=35</guid>
		<description><![CDATA[Quick and dirty &#8211; this should never be needed, but in the rare events that your auto rotation cycle fails or you&#8217;re just using a volume for testing and want to blank it to start from scratch, from the Bacula console enter : purge jobs volume After a short warning you can choose which pool [...]]]></description>
			<content:encoded><![CDATA[<p>Quick and dirty &#8211; this should never be needed, but in the rare events that your auto rotation cycle fails or you&#8217;re just using a volume for testing and want to blank it to start from scratch, from the Bacula console enter :</p>
<p><code>purge jobs volume</code></p>
<p>After a short warning you can choose which pool and then which volume you want to purge.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2008/08/purging-a-backup-volume-in-bacula/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing and re-adding a disk in gmirror</title>
		<link>http://www.eztiger.org/2008/08/removing-and-re-adding-a-disk-in-gmirror/</link>
		<comments>http://www.eztiger.org/2008/08/removing-and-re-adding-a-disk-in-gmirror/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 11:43:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=18</guid>
		<description><![CDATA[Running software RAID-1 using gmirror under FreeBSD can save some headaches. Sometimes a disk literally fails leaving you running on a spare, sometimes you just have a &#8216;blip&#8217; during a busy period of the server which causes gmirror to drop the disk from the array. This happened today and from dmesg we can see : [...]]]></description>
			<content:encoded><![CDATA[<p>Running software RAID-1 using gmirror under FreeBSD can save some headaches.</p>
<p>Sometimes a disk literally fails leaving you running on a spare, sometimes you just have a &#8216;blip&#8217; during a busy period of the server which causes gmirror to drop the disk from the array.</p>
<p>This happened today and from dmesg we can see :</p>
<p><code>GEOM_MIRROR: Request failed (error=5). ad4[READ(offset=48103390720, length=16384                                                                              )]<br />
GEOM_MIRROR: Device gm0: provider ad4 disconnected.</code></p>
<p>Basically, my SATA disk ad4 had a bit of a read error. As this has happened before I&#8217;m not overly concerned. I don&#8217;t know, however, if this is a physical disk problem or just gmirror err&#8217;ing on the side of caution and aggressively removing it from the array. A full s.m.a.r.t report in due course may shed some light. If this had been a write error I would be a bit more concerned. Nonetheless gmirror caught it and removed it from the array as faulty.</p>
<p>We can confirm using the gmirror list and gmirror status commands</p>
<p><code>guru# gmirror status<br />
Name    Status  Components<br />
mirror/gm0  DEGRADED  ad6<br />
</code><br />
<code>guru# gmirror list<br />
Geom name: gm0<br />
State: DEGRADED<br />
Components: 2<br />
Balance: round-robin<br />
Slice: 4096<br />
Flags: NONE<br />
GenID: 6<br />
SyncID: 1<br />
ID: 2879715010<br />
Providers:<br />
1. Name: mirror/gm0<br />
Mediasize: 79999999488 (75G)<br />
Sectorsize: 512<br />
Mode: r5w5e6<br />
Consumers:<br />
1. Name: ad6<br />
Mediasize: 80026361856 (75G)<br />
Sectorsize: 512<br />
Mode: r1w1e1<br />
State: ACTIVE<br />
Priority: 0<br />
Flags: DIRTY<br />
GenID: 6<br />
SyncID: 1<br />
ID: 1663191490</code></p>
<p>Which tells us the mirror device gm0 is degraded and only SATA disk ad6 is still playing.</p>
<p>In an actual disk failure situation at this point we&#8217;d bring the server down and replace the failed ad4 device. If hardware supports you could also hotswap &#8211; but I&#8217;m not sure how the FreeBSD kernel would handle that.</p>
<p>We don&#8217;t need to do that in this instance, as I&#8217;m fairly sure this is just a blip. So I&#8217;ll just re add the disk to the array and see if it rebuilds.</p>
<p>After replacing the disk (if necessary) to re add the disk we first have to tell gmirror to &#8216;forget&#8217; components of the array that have failed.</p>
<p><code>guru# gmirror forget gm0</code></p>
<p>This forgets the broken members for the array &#8216;gm0&#8242;.</p>
<p>We can confirm using the gmirror status command :</p>
<p><code>guru# gmirror status<br />
Name    Status  Components<br />
mirror/gm0  COMPLETE  ad6<br />
</code></p>
<p>Now we can add (or re-add!) the &#8216;new&#8217; disk and watch it rebuild!</p>
<p><code>guru# gmirror insert gm0 ad4<br />
guru# gmirror status<br />
Name    Status  Components<br />
mirror/gm0  DEGRADED  ad6<br />
ad4 (0%)</code></p>
<p>After a while&#8230;</p>
<p><code>guru# gmirror status<br />
Name    Status  Components<br />
mirror/gm0  DEGRADED  ad6<br />
ad4 (64%)</code></p>
<p>And finally&#8230;</p>
<p><code>guru# gmirror status<br />
Name    Status  Components<br />
mirror/gm0  COMPLETE  ad6<br />
ad4<br />
guru#<br />
</code></p>
<p>We can glean a nice summary from dmesg :</p>
<p><code>GEOM_MIRROR: Device gm0: provider ad4 detected.<br />
GEOM_MIRROR: Device gm0: rebuilding provider ad4.<br />
GEOM_MIRROR: Device gm0: rebuilding provider ad4 finished.<br />
GEOM_MIRROR: Device gm0: provider ad4 activated.</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2008/08/removing-and-re-adding-a-disk-in-gmirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bacula Design &#8216;Feature&#8217;</title>
		<link>http://www.eztiger.org/2008/08/bacula-design-feature/</link>
		<comments>http://www.eztiger.org/2008/08/bacula-design-feature/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 15:17:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bacula]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.eztiger.org/?p=12</guid>
		<description><![CDATA[I unwittingly stumbled across a reasonably well hidden Bacula design foible today. I&#8217;ve noticed for some time that when doing test restores, or browsing the &#8216;most recent backup&#8217; for a client Bacula has included files that should not be there based on the timeline of the restore. If, after performing a full backup, some files [...]]]></description>
			<content:encoded><![CDATA[<p>I unwittingly stumbled across a reasonably well hidden Bacula design foible today.</p>
<p>I&#8217;ve noticed for some time that when doing test restores, or browsing the &#8216;most recent backup&#8217; for a client Bacula has included files that should not be there based on the timeline of the restore.</p>
<p>If, after performing a full backup, some files are deleted and then a differential (or incremental!) backup is taken these previously deleted files would still be restored if I did the &#8216;latest backup&#8217; for a client.</p>
<p>The expected behavior (in my opinion) would be for these files <em>not</em> to be included in a restore of the most recent backup as, at the point in time the latest backup was taken, the files were not on disk.</p>
<p>This is a known feature of Bacula and is documented as a sub-project to <a href="http://bacula.org/en/?page=projects">fix</a></p>
<p>This has been underway since 2005, hopefully good progress is being made.</p>
<p>Unfortunately this means that any restores made expecting a &#8216;point in time&#8217; snapshot of the system to be written back to disk will not behave as expected.</p>
<p>This may leave the system in an inconsistent or, at best, unknown state. This will also skew disk usage for a restore, using more space than expected and may either cause problems depending on the target disk size or necessitate a spring clean post restore to tidy things up again. This would be particularly painful for administrators with busy systems and lots of changes between incremental and differential backup windows.</p>
<p>This only occurs between each full backup so one workaround would be to perform a full backup each day but this is not often a practical solution.</p>
<p>It&#8217;s some comfort that at least the data is backed up safely and that data can be retrieved in some form, however this makes the restore process a little more complicated than it perhaps should be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eztiger.org/2008/08/bacula-design-feature/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

