<?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>My Wushu Blog &#187; GEOM</title>
	<atom:link href="http://www.mywushublog.com/tag/geom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywushublog.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 18:42:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Why you should use disk labels</title>
		<link>http://www.mywushublog.com/2009/12/why-you-should-use-disk-labels/</link>
		<comments>http://www.mywushublog.com/2009/12/why-you-should-use-disk-labels/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 03:19:34 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[GEOM]]></category>
		<category><![CDATA[Jenny]]></category>
		<category><![CDATA[Labels]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=607</guid>
		<description><![CDATA[I recently had a little problem with a new FreeBSD install, and it is one of those times were I sort of appreciate how FreeBSD assigns device handles, yet at the same time hate it :) The setup is this: The OS was installed on a mirrored hardware raid device ...]]></description>
			<content:encoded><![CDATA[<p>I recently had a little problem with a new FreeBSD install, and it is one of those times were I sort of appreciate how FreeBSD assigns device handles, yet at the same time hate it :)</p>
<p>The setup is this:<br />
The OS was installed on a mirrored hardware raid device (using the <a href="http://www.freebsd.org/cgi/man.cgi?query=mpt&#038;sektion=4&#038;manpath=FreeBSD+8.0-RELEASE">mpt(4)</a> driver), and then I had a large RAID6 array attached via a FC controller (using the <a href="http://www.freebsd.org/cgi/man.cgi?query=isp&#038;sektion=4&#038;manpath=FreeBSD+8.0-RELEASE">isp(4)</a> driver). When I installed the OS, the mpt device was showing up as da0. So I went ahead with the install and rebooted the system, so far so good.</p>
<p>What I didn&#8217;t realize was the FC device was not seen yet, so after some fiddling, <a href="http://jettagirl.wordpress.com">Jenny</a> and I got the large RAID6 array to show up&#8230; unfortunately, the isp card was before the mpt card on the PCI bus:<br />
<code><br />
isp0@pci0:2:1:0:	class=0x0c0400 card=0x01321077 chip=0x63221077 rev=0x03 hdr=0x00<br />
    vendor     = 'QLogic Corporation'<br />
    device     = 'QLA6322 Fibre Channel Adapter'<br />
    class      = serial bus<br />
    subclass   = Fibre Channel<br />
mpt0@pci0:2:3:0:	class=0x010000 card=0x30601000 chip=0x00501000 rev=0x02 hdr=0x00<br />
    vendor     = 'LSI Logic (Was: Symbios Logic, NCR)'<br />
    device     = 'SAS 3000 series, 4-port with 1064 -StorPort'<br />
    class      = mass storage<br />
    subclass   = SCSI<br />
</code><br />
and the RAID6 now became da0, and the OS device now became da1. </p>
<p>Doh!</p>
<p>The system prompted for the / drive, so I had to call out the correct device at the mount> prompt:<br />
<code><br />
mount> ufs:/dev/da1s1a<br />
</code><br />
After that, the system continue to boot into mult-user mode, which cause some very strange console behavior (it acted like the return key was being held down), and my only option was to SSH in as local user, su to root, and then fix /etc/fstab.</p>
<p>This was not devastating, however, it show the importance of using disk labels instead of device handles in certain use cases. I haven&#8217;t fixed the / mount, but to get a comfort level with using GEOM labels I added another drive to the system and called it EXPORT.</p>
<p>You can assign a permanent label in two ways (that I know of). When you newfs the device, you can specify the L flag (BTW, -O2 means to use UFS2, and -U will use Soft-Updates):<br />
<code>[root@paper ~]&gt; newfs -O2 -U -L EXPORT /dev/da2s1a</code><br />
OR using glabel (which is what you would have to do for a non UFS filesystem.<br />
<code>[root@paper ~]&gt; glabel create EXPORT da2s1a</code><br />
Now we can see our newly labeled device in action:<br />
<code>[root@paper ~]&gt; ls /dev/label<br />
.      ..     EXPORT<br />
[root@paper ~]&gt; glabel status<br />
                  Name  Status  Components<br />
            label/EXPORT     N/A  da2s1a<br />
</code><br />
To add it to /etc/fstab, you can either edit the file, or append the correctly tab-delimited line like so:<br />
<code><br />
[root@paper ~]&gt; echo "/dev/label/EXPORT\t/export\tufs\trw\t2\t2" &gt;&gt; /etc/fstab<br />
[root@paper ~]&gt; mkdir /export<br />
[root@paper ~]&gt; mount export<br />
</code><br />
Hurray!<br />
<code><br />
[root@paper ~]&gt; df<br />
Filesystem      1K-blocks        Used       Avail Capacity  Mounted on<br />
/dev/da1s1a        60931274   4754540    51302234     8%    /<br />
devfs                     1         1           0   100%    /dev<br />
tank            10569645824 107237376 10462408448     1%    /tank<br />
/dev/label/EXPORT   132022788         4   121460962     0%    /export</p>
<p>[root@paper ~]&gt; mount<br />
/dev/da1s1a on / (ufs, local, soft-updates)<br />
devfs on /dev (devfs, local, multilabel)<br />
tank on /tank (zfs, NFS exported, local)<br />
/dev/label/EXPORT on /export (ufs, local)<br />
</code></p>
<p>This is now a persistent label. To be safe, I&#8217;ll have to boot off of a CD/USB drive and modify the root device.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/12/why-you-should-use-disk-labels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.mywushublog.com/tag/geom/feed/ ) in 0.17840 seconds, on Feb 7th, 2012 at 8:30 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 9:30 am UTC -->
