<?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>unixpowered.com &#187; zfs</title>
	<atom:link href="http://www.unixpowered.com/blog/category/zfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unixpowered.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 13:42:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Solaris Containers and ZFS</title>
		<link>http://www.unixpowered.com/blog/2010/06/05/solaris-containers-and-zfs/</link>
		<comments>http://www.unixpowered.com/blog/2010/06/05/solaris-containers-and-zfs/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 09:02:36 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris containers]]></category>
		<category><![CDATA[solaris zones]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://www.unixpowered.com/blog/?p=498</guid>
		<description><![CDATA[I had to create some containers for developers to do their work. Developers always seem to want root access to a machine. Containers work very nice in this scenario: if a developer messes up his container, I can just clone a new one off a &#8220;gold&#8221; container. ZFS can be very handy here as well: [...]]]></description>
			<content:encoded><![CDATA[<p>I had to create some containers for developers to do their work. Developers always seem to want root access to a machine. Containers work very nice in this scenario: if a developer messes up his container, I can just clone a new one off a &#8220;gold&#8221; container. ZFS can be very handy here as well: by installing a container on ZFS filesystem and assigning ZFS quota, you can limit how big the container can grow.</p>
<p>So, first I created a ZFS pool out of two slices on two disks. This is not really recommended way to create ZFS pool. You should really be using two whole disks. And, ignore the fact that those disks both reside on the same controller. Right after that I created <em>dev1</em> filesystem within the <em>zonepool</em>:</p>
<p><code>bash-3.00# <strong>zpool create -m /export/home/zones zonepool mirror c0t0d0s3 c0t1d0s3</strong><br />
bash-3.00# <strong>zfs create zonepool/dev1</strong><br />
bash-3.00# <strong>zfs list</strong><br />
NAME               USED  AVAIL  REFER  MOUNTPOINT<br />
zonepool           122K  55.6G  25.5K  /export/home/zones<br />
zonepool/dev1     24.5K  8.00G  24.5K  /export/home/zones/dev1</code></p>
<p>Next I set ZFS quota on the filesystem to 8GB:</p>
<p><code>bash-3.00# <strong>zfs set quota=8G zonepool/dev1</strong><br />
bash-3.00# <strong>zfs get all zonepool/dev1</strong><br />
NAME              PROPERTY       VALUE                       SOURCE<br />
zonepool/dev1     type           filesystem                  -<br />
zonepool/dev1     creation       Fri Jun  4  9:17 2010       -<br />
zonepool/dev1     used           24.5K                       -<br />
zonepool/dev1     available      8.00G                       -<br />
zonepool/dev1     referenced     24.5K                       -<br />
zonepool/dev1     compressratio  1.00x                       -<br />
zonepool/dev1     mounted        yes                         -<br />
zonepool/dev1     quota          8G                          local<br />
zonepool/dev1     reservation    none                        default<br />
zonepool/dev1     recordsize     128K                        default<br />
zonepool/dev1     mountpoint     /export/home/zones/dev1     inherited from zonepool<br />
zonepool/dev1     sharenfs       off                         default<br />
zonepool/dev1     checksum       on                          default<br />
zonepool/dev1     compression    off                         default<br />
zonepool/dev1     atime          on                          default<br />
zonepool/dev1     devices        on                          default<br />
zonepool/dev1     exec           on                          default<br />
zonepool/dev1     setuid         on                          default<br />
zonepool/dev1     readonly       off                         default<br />
zonepool/dev1     zoned          off                         default<br />
zonepool/dev1     snapdir        hidden                      default<br />
zonepool/dev1     aclmode        groupmask                   default<br />
zonepool/dev1     aclinherit     secure                      default<br />
zonepool/dev1     canmount       on                          default<br />
zonepool/dev1     shareiscsi     off                         default<br />
zonepool/dev1     xattr          on                          default</code></p>
<p>Now, I should mention, that prior to configuring <em>/export/home/zones</em> to reside on ZFS I uninstalled <em>dev1</em> container which was there previously. So, the container itself was gone, but the system still had knowledge of the container&#8217;s configuration. I wrote a post on configuring containers <a title="Solaris Containers" href="index.php/archives/2009/06/14/solaris-containers/" target="_self">here</a>.</p>
<p><code>bash-3.00# <strong>zoneadm list -cv</strong><br />
ID NAME             STATUS     PATH                           BRAND    IP<br />
0 global           running    /                              native   shared<br />
- dev1             configured /export/home/zones/dev1        native   shared</code></p>
<p>Since the container was already configured, I went ahead and started installing it:</p>
<p><code>bash-3.00# <strong>zoneadm -z dev1 install</strong><br />
/export/home/zones/dev1 must not be group readable.<br />
/export/home/zones/dev1 must not be group executable.<br />
/export/home/zones/dev1 must not be world readable.<br />
/export/home/zones/dev1 must not be world executable.<br />
could not verify zonepath /export/home/zones/dev1 because of the above errors.<br />
zoneadm: zone dev1 failed to verify<br />
bash-3.00#</code></p>
<p>Woops, looks like the container directory permissions need some fixing:</p>
<p><code>bash-3.00# <strong>cd /export/home/zones/</strong><br />
bash-3.00# <strong>ls -l</strong><br />
total 3<br />
drwxr-xr-x   2 root     sys            2 Jun  3 09:48 dev1<br />
bash-3.00# <strong>chmod 700 dev1</strong><br />
bash-3.00# <strong>chown root:root dev1</strong></code></p>
<p>One more try to install the container:</p>
<p><code>bash-3.00# <strong>zoneadm -z dev1 install</strong><br />
Preparing to install zone .<br />
Creating list of files to copy from the global zone.<br />
Copying &lt;2561&gt; files to the zone.<br />
Initializing zone product registry.<br />
Determining zone package initialization order.<br />
Preparing to initialize &lt;1086&gt; packages on the zone.<br />
Initialized &lt;1086&gt; packages on zone.<br />
Zone  is initialized.<br />
The file  contains a log of the zone installation.</code></p>
<p>That&#8217;s it. After the container install completed, before booting <em>dev1</em>, I stuck the following <em>sysidcfg</em> file into <em>/etc</em> directory of <em>dev1</em> container:</p>
<p><code>bash-3.00# <strong>more sysidcfg</strong><br />
system_locale=en_US<br />
timezone=US/Central<br />
terminal=vt100<br />
security_policy=NONE<br />
network_interface=primary {<br />
hostname=dev1<br />
}<br />
nfs4_domain=dynamic<br />
name_service=NIS {<br />
domain_name=example.com<br />
name_server=nis1(10.1.1.1)<br />
}</code></p>
<p>That way I would not be asked any container configuration questions during first container boot. Except for the root password, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2010/06/05/solaris-containers-and-zfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird disk label after using ZFS on a LUN</title>
		<link>http://www.unixpowered.com/blog/2009/10/04/weird-disk-label-after-using-zfs-on-a-lun/</link>
		<comments>http://www.unixpowered.com/blog/2009/10/04/weird-disk-label-after-using-zfs-on-a-lun/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:42:49 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris tips]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://www.unixpowered.com/blog/?p=352</guid>
		<description><![CDATA[If you ever used ZFS on a LUN and then tried to reuse that LUN for UFS you might have noticed a &#8220;weird&#8221; disk label on it. This is known as EFI label.
Here is how it looks in format command:
partition&#62; p
Current partition table (original):
Total disk sectors available: 73383902 + 16384 (reserved sectors)
Part    [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever used ZFS on a LUN and then tried to reuse that LUN for UFS you might have noticed a &#8220;weird&#8221; disk label on it. This is known as EFI label.</p>
<p>Here is how it looks in <em>format</em> command:</p>
<p><code>partition&gt; <strong>p</strong><br />
Current partition table (original):<br />
Total disk sectors available: 73383902 + 16384 (reserved sectors)</code></p>
<p><code>Part      Tag    Flag     First Sector        Size        Last Sector<br />
0        usr    wm                34      34.99GB         73383902<br />
1 unassigned    wm                 0          0              0<br />
2 unassigned    wm                 0          0              0<br />
3 unassigned    wm                 0          0              0<br />
4 unassigned    wm                 0          0              0<br />
5 unassigned    wm                 0          0              0<br />
6 unassigned    wm                 0          0              0<br />
8   reserved    wm          73383903       8.00MB         73400286</code></p>
<p>If you use straight <em>format</em> command there is no way to get rid of EFI label. Instead, you have to use <em>-e</em> option with <em>format</em> to get to expert features:</p>
<p><code>bash-3.00# <strong>format -e</strong></code></p>
<p>With <em>-e</em> options when you label the LUN you will be asked about the type of label you want to put on the disk:</p>
<p><code>format&gt; <strong>label</strong><br />
[0] SMI Label<br />
[1] EFI Label<br />
Specify Label type[1]: <strong>0</strong><br />
Warning: This disk has an EFI label. Changing to SMI label will erase all<br />
current partitions.<br />
Continue? y<br />
Auto configuration via format.dat[no]? <strong>yes</strong></code></p>
<p>I suppose you could alternatively use <em>dd</em> command and blank out the whole disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/10/04/weird-disk-label-after-using-zfs-on-a-lun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and dirty ZFS cheatsheet</title>
		<link>http://www.unixpowered.com/blog/2008/12/20/quick-and-dirty-zfs-cheatsheet/</link>
		<comments>http://www.unixpowered.com/blog/2008/12/20/quick-and-dirty-zfs-cheatsheet/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 15:53:38 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris utilities]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=104</guid>
		<description><![CDATA[Create simple striped pool:
zpool create [pool_name] [device] [device] ...
zpool create datapool c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0
Create mirrored pool:
zpool create [pool_name] mirror [device] [device] ...
zpool create datapool mirror c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0
Create Raid-Z pool:
zpool create [pool_name] raidz [device] [device] [device] ...
zpool create datapool raidz c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0 c5t439257C4000019250000900000540000d0
Transform simple pool to a mirror:
zpool create [pool_name] [device]
zpool attach [pool_name] [existing_device] [new_device]
zpool create datapool [...]]]></description>
			<content:encoded><![CDATA[<p>Create simple striped pool:<br />
<code>zpool create [pool_name] [device] [device] ...<br />
<strong>zpool create datapool c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0</strong></code></p>
<p>Create mirrored pool:<br />
<code>zpool create [pool_name] mirror [device] [device] ...<br />
<strong>zpool create datapool mirror c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0</strong></code></p>
<p>Create Raid-Z pool:<br />
<code>zpool create [pool_name] raidz [device] [device] [device] ...<br />
<strong>zpool create datapool raidz c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0 c5t439257C4000019250000900000540000d0</strong></code></p>
<p>Transform simple pool to a mirror:<br />
<code>zpool create [pool_name] [device]<br />
zpool attach [pool_name] [existing_device] [new_device]<br />
<strong>zpool create datapool c5t433127A900011C370000C00003210000d0<br />
zpool attach datapool c5t433127A900011C370000C00003210000d0 c5t433127B4001031250000900000540000d0</strong></code></p>
<p>Expand simple pool:<br />
<code>zpool create [pool_name] [device]<br />
zpool add [pool_name] [new_device]<br />
<strong>zpool create datapool c5t433127A900011C370000C00003210000d0<br />
zpool add datapool c5t433127B4001031250000900000540000d0</strong></code></p>
<p>Expand mirrored pool by attaching additional mirror:<br />
<code>zpool add [pool_name] mirror [new_device] [new_device]<br />
<strong>zpool add datapool mirror c5t433127A900011C370000C00003460000d0 c5t433127B400011C370000C00003410000d0</strong></code></p>
<p>Replace device in a pool:<br />
<code>zpool replace [pool_name] [old_device] [new_device]<br />
<strong>zpool replace datapool c5t433127A900011C370000C00003410000d0 c5t433127B4001031250000900000540000d0</strong></code></p>
<p>Destroy pool:<br />
<code>zpool destroy [pool_name]<br />
<strong>zpool destroy datapool</strong></code></p>
<p>Set pool mountpoint:<br />
<code>zfs set mountpoint=/path [pool_name]<br />
<strong>zfs set mountpoint=/export/zfs datapool</strong></code></p>
<p>Display configured pools:<br />
<code>zpool list<br />
<strong>zpool list</strong></code></p>
<p>Display pool status info:<br />
<code>zpool status [-v] [pool_name]<br />
<strong>zpool status -v datapool</strong></code></p>
<p>Display pool I/O statistics:<br />
<code>zpool iostat [pool_name]<br />
<strong>zpool iostat datapool</strong></code></p>
<p>Display pool command history:<br />
<code>zpool history [pool_name]<br />
<strong>zpool history datapool</strong></code></p>
<p>Export a pool:<br />
<code>zpool export [pool_name]<br />
<strong>zpool export datapool</strong></code></p>
<p>Import a pool:<br />
<code>zpool import [pool_name]<br />
<strong>zpool import datapool</strong></code></p>
<p>Create a filesystem:<br />
<code>zfs create [pool_name]/[fs_name]<br />
<strong>zfs create datapool/filesystem</strong></code></p>
<p>Destroy a filesystem:<br />
<code>zfs destroy [pool_name]/[fs_name]<br />
<strong>zfs destroy datapool/filesystem</strong></code></p>
<p>Rename a filesystem:<br />
<code>zfs rename [pool_name]/[fs_name] [pool_name]/[fs_name]<br />
<strong>zfs rename datapool/filesystem datapool/newfilesystem</strong></code></p>
<p>Move a filesystem:<br />
<code>zfs rename [pool_name]/[fs_name] [pool_name]/[fs_name]/[fs_name]<br />
<strong>zfs rename datapool/filesystem datapool/users/filesystem</strong></code></p>
<p>Display properties of a filesystem:<br />
<code>zfs get all [pool_name]/[fs_name]<br />
<strong>zfs get all datapool/filesystem</strong></code></p>
<p>Make a snapshot:<br />
<code>zfs snapshot [pool_name]/[fs_name]@[time]<br />
<strong>zfs snapshot datapool/filesystem@friday</strong></code></p>
<p>Roll back filesystem to its snapshot:<br />
<code>zfs rollback [pool_name]/[fs_name]@[time]<br />
<strong>zfs rollback datapool/filesystem@friday</strong></code></p>
<p>Clone a filesystem:<br />
<code>zfs snapshot [pool_name]/[fs_name]@[time]<br />
zfs clone [pool_name]/[fs_name]@[time] [pool_name]/[fs_name]<br />
<strong>zfs snapshot datapool/filesystem@today<br />
zfs clone datapool/filesystem@today datapool/filesystemclone</strong></code></p>
<p>Backup filesystem to a file:<br />
<code>zfs send [pool_name]/[fs_name] &gt; /path/to/file<br />
<strong>zfs send datapool/filesystem@friday &gt; /tmp/filesystem.bkp</strong></code></p>
<p>Restore filesystem from a file:<br />
<code>zfs receive [pool_name]/[fs_name] &lt; /path/to/file<br />
<strong>zfs receive datapool/restoredfilesystem &lt; /tmp/filesystem.bkp</strong></code></p>
<p>Create ZFS volume:<br />
<code>zfs create -V [size] [pool_name]/[vol_name]<br />
<strong>zfs create -V 100mb datapool/zvolume<br />
newfs /dev/zvol/dsk/datapool/zvolume</strong></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/12/20/quick-and-dirty-zfs-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
