<?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>a little stupid blog &#187; Solaris</title>
	<atom:link href="http://alittlestupid.com/category/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://alittlestupid.com</link>
	<description>join the revolution... be a little stupid</description>
	<lastBuildDate>Thu, 14 Jul 2011 14:27:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Howto: Mount LOFS File System To Running Solaris 10 Zone</title>
		<link>http://alittlestupid.com/2011/05/20/howto-mount-lofs-file-system-to-running-solaris-10-zone/</link>
		<comments>http://alittlestupid.com/2011/05/20/howto-mount-lofs-file-system-to-running-solaris-10-zone/#comments</comments>
		<pubDate>Fri, 20 May 2011 18:05:23 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=531</guid>
		<description><![CDATA[How to mount a loopback file system to a running Solaris 10 zone (i.e. container) from the global zone. In the example below, I&#8217;m mounting the the lofs file system as read-only so the Non-global zone cant modify the contents. Assumptions: 1. Global zone name: global 2. Non-global zone name: ngzname 3. Disk you want [...]]]></description>
			<content:encoded><![CDATA[<p>How to mount a loopback file system to a running Solaris 10 zone (i.e. container) from the global zone.  In the example below, I&#8217;m mounting the the lofs file system as read-only so the Non-global zone cant modify the contents.</p>
<p>Assumptions:<br />
1. Global zone name: global<br />
2. Non-global zone name: ngzname<br />
3. Disk you want mounted: c1t1d1s0<br />
4. Non-global zone is up and running</p>
<p>Let&#8217;s get started.</p>
<p>1. Identify the disk you want to mount from the global to the zone.  In this case its <em>c1t1d1s0</em>.</p>
<p>2. Mount the disk as you normally would from the global zone.<br />
    a. Create the mount point from the global zone</p>
<pre class="brush: plain; title: ; notranslate">
        # mkdir /mnt/olddisk
</pre>
<p>    b. Create the mount point for the Non-global zone</p>
<pre class="brush: plain; title: ; notranslate">
        # mkdir /zones/ngzname/root/mnt/olddisk
</pre>
<p>3. Mount the disk to both the global and Non-global zone<br />
     a. For the global</p>
<pre class="brush: plain; title: ; notranslate">
        # mount /dev/dsk/c1t1d1s0 /mnt/olddisk
</pre>
<p>     b. For the Non-global<br />
         <strong>ENSURE ngzone is up and running</strong>.  For me, mounting the file system as read-only was a requirement.  Your mileage may vary.</p>
<pre class="brush: plain; title: ; notranslate">
        # mount -o ro -F lofs /mnt/olddisk /zones/ngzname/root/mnt/olddisk
</pre>
<p>4. Verify mount point is up and running<br />
     a. From global</p>
<pre class="brush: plain; title: ; notranslate">
         # df -h /mnt/olddisk
         # mount | grep /mnt/olddisk
</pre>
<p>     b. Log into Non-global zone</p>
<pre class="brush: plain; title: ; notranslate">
          # df -h /mnt/olddisk
</pre>
<p>The disk should be mount as read only from the global to the Non-global zone as read-only.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2011/05/20/howto-mount-lofs-file-system-to-running-solaris-10-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to grow a ZFS volume</title>
		<link>http://alittlestupid.com/2010/10/24/how-to-grow-a-zfs-volume/</link>
		<comments>http://alittlestupid.com/2010/10/24/how-to-grow-a-zfs-volume/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 03:20:09 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=518</guid>
		<description><![CDATA[How to grow a ZFS Volume. Assume the following is true: Pool Name: fort Volume Name: vol1 Mount Point: /mnt/vol1 1. Display file system mount status Notice its 1Gig in size (962M formatted). 2. Display current ZFS volume size and reservation properties Confirms the volume is 1Gig in size with a 1Gig reservation. 3. Change [...]]]></description>
			<content:encoded><![CDATA[<p>How to grow a ZFS Volume.</p>
<p>Assume the following is true:</p>
<li>Pool Name: <strong>fort</strong></li>
<li>Volume Name: <strong>vol1</strong></li>
<li>Mount Point:  <strong>/mnt/vol1</strong></li>
<p>1. Display file system mount status</p>
<pre class="brush: plain; title: ; notranslate">
# df -h /mnt/vol1/
Filesystem             size   used  avail capacity  Mounted on
/dev/zvol/dsk/fort/vol1
                       962M   1.0M   903M     1%    /mnt/vol1
</pre>
<p>Notice its 1Gig in size (962M formatted).</p>
<p>2. Display current ZFS volume size and reservation properties</p>
<pre class="brush: plain; title: ; notranslate">
# zfs get volsize,reservation fort/vol1
NAME           PROPERTY     VALUE          SOURCE
fort/vol1  volsize      1G             -
fort/vol1  reservation  1G             local
</pre>
<p>Confirms the volume is 1Gig in size with a 1Gig reservation.</p>
<p>3. Change the volsize ZFS property for fort/vol1 to 2Gig.</p>
<pre class="brush: plain; title: ; notranslate">
# zfs set volsize=2g fort/vol1
</pre>
<p>4. Confirm the changes were made by displaying the volsize and reservation ZFS properties.</p>
<pre class="brush: plain; title: ; notranslate">
# zfs get volsize,reservation fort/vol1
NAME           PROPERTY     VALUE          SOURCE
fort/vol1  volsize      2G             -
fort/vol1  reservation  2G             local
</pre>
<p>Notice the &#8220;volsize&#8221; is now set to 2Gig.  At this point, the OS doesnt see the expanded file system.  In order for the OS to see the size, you will have to expand the file system with &#8220;growfs&#8221;.</p>
<p>5. Run growfs to expand mounted file system</p>
<pre class="brush: plain; title: ; notranslate">
# growfs -M /mnt/vol1 /dev/zvol/rdsk/fort/vol1
Warning: 2048 sector(s) in last cylinder unallocated
/dev/zvol/rdsk/fort/vol1:   4194304 sectors in 683 cylinders of 48 tracks, 128 sectors
        2048.0MB in 49 cyl groups (14 c/g, 42.00MB/g, 20160 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 86176, 172320, 258464, 344608, 430752, 516896, 603040, 689184, 775328,
 3359648, 3445792, 3531936, 3618080, 3704224, 3790368, 3876512, 3962656,
 4048800, 4134944
</pre>
<p>The output should now show you the new volume size.</p>
<p>6. Confirm the size of mounted file system using df or dd.</p>
<pre class="brush: plain; title: ; notranslate">
# df -h /mnt/vol1/
Filesystem             size   used  avail capacity  Mounted on
/dev/zvol/dsk/fort/vol1
                       1.9G   2.0M   1.8G     1%    /mnt/vol1

# dd if=/dev/zvol/dsk/fort/vol1 of=/dev/null bs=1024k
2048+0 records in
2048+0 records out
</pre>
<p>Thats it!  Growing a ZFS volume is an online operation in my mind.    </p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2010/10/24/how-to-grow-a-zfs-volume/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto: Mount New File System To Running Solaris 10 Zone</title>
		<link>http://alittlestupid.com/2009/10/22/howto-mount-new-file-system-to-running-solaris-10-zone/</link>
		<comments>http://alittlestupid.com/2009/10/22/howto-mount-new-file-system-to-running-solaris-10-zone/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:17:14 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[how-to's]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=499</guid>
		<description><![CDATA[I recently came across the need to mount a new file system to a Solaris 10 non-global zone without rebooting the actual zone. There are other ways to accomplish this same task but most of the solutions I&#8217;ve found required rebooting the non-global zone. Unfortunately, we could not take an outage by rebooting the non-global [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across the need to mount a new file system to a Solaris 10 non-global zone without rebooting the actual zone.  There are other ways to accomplish this same task but most of the solutions I&#8217;ve found required rebooting the non-global zone.  Unfortunately, we could not take an outage by rebooting the non-global zone yet the file system needed to be added to the zone.</p>
<p>The method below describes a way in which you can mount a new file system (UFS) to a running Solaris 10 zone without the need of a reboot.  </p>
<ul>
<strong>Assumptions:</strong>
<li>All commands need to be run from the global zone as the root user unless otherwise specified.</li>
<p><strong>Prerequisites:</strong>
<li>A Solaris 10 host with at least one running non-global zone.</li>
<p><strong>Limitations:</strong>
<li>You can not unmount the file system from the non-global zone.  Some say this is a benefit <img src='http://alittlestupid.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p>Lets get started!</p>
<ol>
<ul>Log into the global zone and create the new file system like you normally would.  In this example, I use SVM to create a new metadevice (d1000), one way mirror (d2000), and a 1Gig soft partition (d2001).  Your mileage may vary.  </p>
<blockquote><p>
<code><br />
	# metainit d1000 1 1 c1t5d0s0 -i 128k<br />
	# metainit d2000 -m d1000<br />
	# metainit d2001 -p d2000 1g<br />
	# echo y | newfs -i 8192 /dev/md/rdsk/d2001<br />
</code>
</p></blockquote>
</ul>
<ul>Create the block and character devices for the zone.  Run &#8220;ls -lL&#8221; against the newly created soft partition (d2001) to find the major and minor character and block values.</p>
<blockquote><p>
       <code><br />
	# ls -lL /dev/md/*dsk/d2001<br />
        brw-r----- 1 root sys 85, 2001 Oct  6 13:46 /dev/md/dsk/d2001<br />
	crw-r----- 1 root sys 85, 2001 Oct  6 13:47 /dev/md/rdsk/d2001<br />
        </code>
        </p></blockquote>
<p><strong>NOTE:</strong> The major and minor values are <strong>85</strong> and <strong>2001</strong>, respectively.  Notice that the &#8220;dsk&#8221; device is a <em>&#8220;block-type&#8221;</em> file and &#8220;rdsk&#8221; device is a <em>&#8220;character-type&#8221;</em> file.</p>
</ul>
<ul>Run <a href="http://www.phy.ohiou.edu/cgi-bin/man-cgi.sol?mknod+1M">mknod</a> to create the two special files for the zone.  Keep in mind that the name of the two files need to be saved down the myzone device path.  </p>
<blockquote><p>
       <code><br />
         # mknod /zones/myzone1/dev/md/dsk/d2001 b 85 2001<br />
         # mknod /zones/myzone1/dev/md/rdsk/d2001 c 85 2001<br />
        </code>
        </p></blockquote>
</ul>
<ul>Correct the permissions and ownerships of the new d2001 block-type and character-type files. </p>
<blockquote><p>
       <code><br />
         # chmod 640 /zones/myzone1/dev/md/*dsk/d2001<br />
         # chown root:root /zones/myzone1/dev/md/*dsk/d2001<br />
        </code>
        </p></blockquote>
</ul>
<ul>Create a mount point in the &#8220;myzone1&#8243; non-global zone.</p>
<blockquote><p>
       <code><br />
       # mkdir /zones/myzone1/root/wandisimo<br />
       </code>
       </p></blockquote>
</ul>
<ul>Confirm its not already mounted</p>
<blockquote><p>
       <code><br />
         # mount | grep wandisimo<br />
       </code>
       </p></blockquote>
<p>You should not get anything back from the command above.
</ul>
<ul>Mount the file system </p>
<blockquote><p>
       <code><br />
         # mount /dev/md/dsk/d2001 /zones/myzone1/root/wandisimo<br />
       </code>
       </p></blockquote>
<p>You are probably thinking to your self, <em>&#8220;Why couldn&#8217;t we just skip to this step and be done with it?&#8221;</em>  From my testing, if the block and character files are not created down the &#8220;myzone1&#8243; device path first, it fails to mount.   If you were to add the soft partition using zonecfg or by adding it to the zone XML file then rebooting the non-global zone, the boot process actually creates the block and character device for you.  </p>
<p><strong>NOTE:</strong> Even though the file system successfully gets mounted, it will not show up in a &#8220;df&#8221; output as actually being mounted.
</ul>
<ul>Check to see if its mounted</p>
<blockquote><p>
       <code><br />
         # df -h | grep wandisimo<br />
        </code>
       </p></blockquote>
<p>You should not get any output.
</ul>
<ul>Confirm the file system is in fact mounted by running the mount command</p>
<blockquote><p>
       <code><br />
         # mount | grep wandisimo<br />
/zones/myzone1/root/wandisimo on /dev/md/dsk/d2001    read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=15407d3 on Tue Oct  6 14:11:45 2009<br />
        </code>
       </p></blockquote>
</ul>
<ul>Log into the running non-global zone (myzone1) to confirm the file system is indeed mounted</p>
<blockquote><p>
       <code><br />
         # zlogin myzone1<br />
         (myzone1)# df -h /wandisimo<br />
         Filesystem             size   used  avail capacity  Mounted on<br />
         /wandisimo            1008M   1.0M   947M     1%    /wandisimo<br />
        </code>
       </p></blockquote>
</ul>
<p><strong>Done.  No need to reboot the non-global zone!</strong>
</ol>
<p>If you would like to make this permanent, you will need to add it to the /etc/vfstab in the global zone.</p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2009/10/22/howto-mount-new-file-system-to-running-solaris-10-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minimum disk size required for Solaris ZFS pool</title>
		<link>http://alittlestupid.com/2009/06/01/minimum-disk-size-required-for-solaris-zfs-pool/</link>
		<comments>http://alittlestupid.com/2009/06/01/minimum-disk-size-required-for-solaris-zfs-pool/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 15:31:25 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=469</guid>
		<description><![CDATA[Ever wanted to find out the the smallest size disk that one could use in a zfs pool? No? Well, I did (goes to show you how exciting my life really is). It turns out that your disk must be at least 64Megs in size. I started with 500Meg disks and worked my way down [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to find out the the smallest size disk that one could use in a zfs pool?  No?  Well, I did (goes to show you how exciting my life really is).  It turns out that your disk must be at least 64Megs in size.  </p>
<p>I started with 500Meg disks and worked my way down to 50Meg disks.  Keep in mind that these are not real disks.  They are empty files created by the mkfile command and stored in /tmp/ that I am using as disks.  I would not recommend using files in a live system but they work great for tests and experiments. </p>
<p>All my tests were as expected until I created the 50Meg disk/files.</p>
<p>Using the Bash shell, here is what I did:</p>
<p>1. Create the 50Meg disk files</p>
<blockquote>
<pre>
# for i in {1..5}; do mkfile 50m /tmp/disk${i}; done
</pre>
</blockquote>
<p>This created 5 x 50Meg files in /tmp.  </p>
<p>2. I then attempted to create a raidz ZFS pool using those files as my disks.</p>
<blockquote>
<pre>
# zpool create fort raidz /var/tmp/{1..5}
cannot create 'fort': one or more devices is less than the minimum size (64M)
</pre>
</blockquote>
<p>3. Changing the size to 64Meg files worked.</p>
<blockquote>
<pre>
#  for i in {1..5}; do mkfile 64m /tmp/disk${i}; done
# zpool create fort raidz /tmp/disk{1..5}
# zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
fort                    296M    143K    296M     0%  ONLINE     -

# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
fort   109K   204M  39.1K  /fort

# zpool status -v
  pool: fort
 state: ONLINE
 scrub: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        fort            ONLINE       0     0     0
          raidz1        ONLINE       0     0     0
            /tmp/disk1  ONLINE       0     0     0
            /tmp/disk2  ONLINE       0     0     0
            /tmp/disk3  ONLINE       0     0     0
            /tmp/disk4  ONLINE       0     0     0
            /tmp/disk5  ONLINE       0     0     0

errors: No known data errors
</pre>
</blockquote>
<p>For future reference, your disks must be a equal to or greater than 64Megs in size.  Great for 64Meg USB drives, sarcasm included&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2009/06/01/minimum-disk-size-required-for-solaris-zfs-pool/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add ZFS file system to Solaris non-global zone</title>
		<link>http://alittlestupid.com/2009/04/28/add-zfs-file-system-to-solaris-non-global-zone/</link>
		<comments>http://alittlestupid.com/2009/04/28/add-zfs-file-system-to-solaris-non-global-zone/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 20:26:30 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=456</guid>
		<description><![CDATA[Ever wanted to add a ZFS file system to a Solaris 10 non-global zone but ran into the following error: could not verify fs /test: zfs &#8216;tank/test&#8217; mountpoint is not &#8220;legacy&#8221; zoneadm: zone non-global-zone failed to verify The fix would be to update/create the ZFS dataset as a legacy mount point. For this post, I [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to add a ZFS file system to a Solaris 10 non-global zone but ran into the following error:</p>
<blockquote><p>
could not verify fs /test: zfs &#8216;tank/test&#8217; mountpoint is not &#8220;legacy&#8221;<br />
zoneadm: zone non-global-zone failed to verify
</p></blockquote>
<p>The fix would be to update/create the ZFS dataset as a legacy mount point.  For this post, I assume that you have both basic understanding of <a href="http://en.wikipedia.org/wiki/Solaris_Containers">Solaris zone</a> technology and <a href="http://en.wikipedia.org/wiki/ZFS">zfs</a> file systems. </p>
<p>In the version of Solaris that I run, (Solaris 10 11/06, sparc) here are the steps you would need to follow in order to add a ZFS file system to a Solaris non-global zone. </p>
<ol>
<li>Create a legacy zfs pool from the global zone<br />
<blockquote><p>
# zpool create tank c0t0d0s0
</p></blockquote>
</li>
<li>Create a zfs dataset using the new <em>tank</em> zfs pool<br />
<blockquote>
<pre>
# zfs create tant/test
</pre>
</blockquote>
</li>
<li>Display the zfs pool<br />
<blockquote>
<pre>
# zfs list
NAME                USED  AVAIL  REFER  MOUNTPOINT
tank               6.57G   120G  26.5K  /tank
tank/test          24.5K   120G  24.5K  /tank/test
</pre>
</blockquote>
</li>
<li>Set the new tank/test dataset as a legacy mount point<br />
<blockquote>
<pre>
# zfs set mountpoint=legacy tank/test
</pre>
</blockquote>
</li>
<li>Display the zfs pool<br />
<blockquote>
<pre>
# zfs list
NAME                USED  AVAIL  REFER  MOUNTPOINT
tank               6.57G   120G  24.5K  /tank
tank/test          24.5K   120G  24.5K  legacy
</pre>
</blockquote>
</li>
<p>Notice the mount point for <em>tank/test</em> changed from the actual mount point <em>/tank/test</em> to <em>legacy</em>.</p>
<li>Create a Solaris non-global zone with similar options as below<br />
<blockquote>
<pre>
# zonecfg -z non-global-zone info

...
fs:
        dir: /test
        special: tank/test
        raw not specified
        type: zfs
        options: []
dataset:
        name: tank/test
...
</pre>
</blockquote>
</li>
</ol>
<p>After the zone has been created and booted, login into the non-global-zone and running a <em>&#8220;df&#8221;</em> will show you the new ZFS pool is mounted and ready to satisfy your ZFS needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2009/04/28/add-zfs-file-system-to-solaris-non-global-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assign metadevice to Solaris non-global zone</title>
		<link>http://alittlestupid.com/2009/04/23/assign-metadevice-to-solaris-non-global-zone/</link>
		<comments>http://alittlestupid.com/2009/04/23/assign-metadevice-to-solaris-non-global-zone/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 16:33:29 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=444</guid>
		<description><![CDATA[From the global zone, create the SVM Metadevice like you normally would. Create the zone and add the SVM Metadevice to the zone configuration via zonecfg. global-zone# zonecfg -z myzone myzone: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:myzone> create zonecfg:myzone> set zonepath=/zones/myzone zonecfg:myzone> set autoboot=true zonecfg:myzone> add net zonecfg:myzone:net> [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>From the global zone, create the SVM Metadevice like you normally would.</li>
<li>Create the zone and add the SVM Metadevice to the zone configuration via zonecfg. </li>
</ol>
<p><code></p>
<blockquote><p>
global-zone# zonecfg -z myzone<br />
myzone: No such zone configured<br />
Use 'create' to begin configuring a new zone.<br />
zonecfg:myzone> create<br />
zonecfg:myzone> set zonepath=/zones/myzone<br />
zonecfg:myzone> set autoboot=true<br />
zonecfg:myzone> add net<br />
zonecfg:myzone:net> set address=192.168.1.100<br />
zonecfg:myzone:net> set physical=ce0<br />
zonecfg:myzone:net> end<br />
zonecfg:myzone:net> add device<br />
zonecfg:myzone:net> set match=/dev/md/*dsk/d110<br />
zonecfg:myzone:net> end<br />
zonecfg:myzone> add attr<br />
zonecfg:myzone:attr> set name=comment<br />
zonecfg:myzone:attr> set type=string<br />
zonecfg:myzone:attr>set value="My first zone with metadevices - myzone"<br />
zonecfg:myzone:attr> end<br />
zonecfg:myzone> verify<br />
zonecfg:myzone> export
</p></blockquote>
<p></code><br />
The key line to adding the SVM Metadevice to the non-global zone is the following:</p>
<blockquote><p>
zonecfg:myzone:net> add device<br />
zonecfg:myzone:net> set match=/dev/md/*dsk/d610<br />
zonecfg:myzone:net> end
</p></blockquote>
<p>I used an asterisk to signify that I want both the the dsk and rdsk devices.</p>
<p>Assuming all went well, you should be able to mount and unmount the SVM Metadevice from the non-global zone.  Why would you want to provide the ability for a non-global zone to mount and un-mount a file system at will?  In my case, the mount point assigned to d110 in the example above is cloned daily using <a href="http://en.wikipedia.org/wiki/Symmetrix">EMC clone technology</a>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2009/04/23/assign-metadevice-to-solaris-non-global-zone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solaris 10 zfs automatically mount at boot time</title>
		<link>http://alittlestupid.com/2009/04/20/solaris-10-zfs-automatically-mount-at-boot-time/</link>
		<comments>http://alittlestupid.com/2009/04/20/solaris-10-zfs-automatically-mount-at-boot-time/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 14:58:01 +0000</pubDate>
		<dc:creator>Juan Martinez</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://alittlestupid.com/?p=448</guid>
		<description><![CDATA[I&#8217;m fairly new to zfs but my initial exposure has been nothing but good, so far. I created a zfs zpool to test the compression algorithms that are natively built into the zfs file system in my release of Solaris 10 11/06. The tests went well but during one of those tests, the need to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m fairly new to zfs but my initial exposure has been nothing but good, so far.  I created a zfs zpool to test the compression algorithms that are natively built into the zfs file system in my release of Solaris 10 11/06.  The tests went well but during one of those tests, the need to reboot the box was necessary for un-related reasons.  This being a dev box, a reboot during the day was not a problem with the business.</p>
<p>When the box came back up I was pleasantly surprised to see the zfs pool already mounted and online.  I didn&#8217;t remember whether or not I had added the entry in /etc/vfstab.  Scratching my head, I immediately went off to check /etc/vfstab on the box but there was no entry for the zfs pool I was working on.  Hmm&#8230; </p>
<p>How did the zfs pool automatically mount itself at boot time?  Was it magical zfs gnomes?  How about the <del datetime="2009-04-20T13:57:05+00:00">Sun</del> Oracle Gods?</p>
<p>The Solaris 10 OS reads /etc/zfs/zpool.cache at boot time and mounts all the pools it finds in that file.  That file is in binary form so if you want to take a peek, run strings against that file.</p>
<blockquote><p>
# /usr/bin/strings /etc/zfs/zpool.cache<br />
tank<br />
version<br />
name<br />
tank<br />
state<br />
pool_guid<br />
(7id<br />
vdev_tree<br />
type<br />
root<br />
guid<br />
(7id<br />
children<br />
type<br />
disk<br />
guid<br />
/§y[ü<br />
path<br />
/dev/dsk/c1t5d0s0<br />
devid<br />
id1,ssd@n20000011c6f0b1fb/a<br />
whole_disk<br />
metaslab_array<br />
metaslab_shift<br />
ashift<br />
asize
</p></blockquote>
<p>If you wanted to get fancy, you can even set a zfs property for the pool so that it doesn&#8217;t mount automatically at boot time using the &#8220;canmount&#8221; option.  Further details can be found at the zfs man page <a href="http://docs.sun.com/app/docs/doc/819-2240/zfs-1m">http://docs.sun.com/app/docs/doc/819-2240/zfs-1m</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alittlestupid.com/2009/04/20/solaris-10-zfs-automatically-mount-at-boot-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.421 seconds -->

