<?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>LosByers- Interesting Musings Helpful Hints from a Unix System Administrator &#187; Solaris</title>
	<atom:link href="http://losbyers.com/wordpress/tag/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://losbyers.com/wordpress</link>
	<description>All the info I need</description>
	<lastBuildDate>Wed, 01 Sep 2010 19:48:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Procedure to swap ZFS pools Solaris</title>
		<link>http://losbyers.com/wordpress/2009/12/procedure-to-swap-zfs-pools-solaris/</link>
		<comments>http://losbyers.com/wordpress/2009/12/procedure-to-swap-zfs-pools-solaris/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 22:21:37 +0000</pubDate>
		<dc:creator>LosByers</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://losbyers.com/wordpress/?p=52</guid>
		<description><![CDATA[<p>Procedure to add a new ZFS pool to a system, copy the data from an old pool, switch the mounts and remove the old pool.</p>
<p>Sorry there isn&#8217;t much in the way of comments or coloring.  It was just copied from the terminal window.  The procedure below does create the ZFS filesystem, clone it, move it, [...]]]></description>
			<content:encoded><![CDATA[<p><span>Procedure to add a new ZFS pool to a system, copy the data from an old pool, switch the mounts and remove the old pool.</span></p>
<p>Sorry there isn&#8217;t much in the way of comments or coloring.  It was just copied from the terminal window.  The procedure below does create the ZFS filesystem, clone it, move it, then deletes the old ZFS information.</p>
<p>The procedure uses disks mapped from and EMC array.  The reason it was needed is that a new EMC was introduced so the data needed to be copied from the old EMC to the new EMC disks, and the old EMC disks needed to be disconnected.</p>
<p>The procedure will walk through creating a volume, adding data to it, cloning it, swapping volumes, and deleting the original.</p>
<p><span id="more-52"></span></p>
<p><span> nj11mhf0016$ sudo zpool create -f -m /testa testz1 emcpower1a<br />
nj11mhf0016$ sudo zpool create -f -m /testb testz2 emcpower2a<br />
</span></p>
<p><span>nj11mhf0016$ zpool list<br />
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT<br />
testz1                  101G     94K    101G     0%  ONLINE     -<br />
testz2                  101G     94K    101G     0%  ONLINE     -<br />
</span></p>
<p><span>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000499 101044951     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 61207120    1024 61206096     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 61206096       0 61206096     0%    /tmp<br />
swap                 61206152      56 61206096     1%    /var/run<br />
testz1               104251392      24 104251301     1%    /testa<br />
testz2               104251392      24 104251301     1%    /testb<br />
</span></p>
<p><span>nj11mhf0016$ sudo zfs create -o quota=24G testz1/data<br />
nj11mhf0016$ sudo zfs create -o quota=24G testz2/data<br />
</span></p>
<p><span>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000499 101044951     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 61207072    1024 61206048     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 61206048       0 61206048     0%    /tmp<br />
swap                 61206104      56 61206048     1%    /var/run<br />
testz1               104251392      25 104251271     1%    /testa<br />
testz2               104251392      24 104251272     1%    /testb<br />
testz1/data          25165824      24 25165799     1%    /testa/data<br />
testz2/data          25165824      24 25165799     1%    /testb/data</span></p>
<p># Copy in some data for testing<br />
sudo rsync -qa -H /var /testa/data/</p>
<p># Make a few test changes and copy the data to the 2nd mount point.<br />
sudo rsync -qa -H /testa/data/* /testb/data/</p>
<p>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000548 101044902     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 52008488    1024 52007464     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 52007464       0 52007464     0%    /tmp<br />
swap                 52007520      56 52007464     1%    /var/run<br />
testz1               104251392      25 99863975     1%    /testa<br />
testz2               104251392      26 99863897     1%    /testb<br />
testz1/data          25165824 4387236 20778587    18%    /testa/data<br />
testz2/data          25165824 4387339 20778485    18%    /testb/data</p>
<p>Now swap and delete them.</p>
<p>Move testa to the side, just in case.<br />
nj11mhf0016$ zfs list<br />
NAME          USED  AVAIL  REFER  MOUNTPOINT<br />
testz1       4.18G  95.2G  25.5K  /testa<br />
testz1/data  4.18G  19.8G  4.18G  /testa/data<br />
testz2       4.18G  95.2G  26.5K  /testb<br />
testz2/data  4.18G  19.8G  4.18G  /testb/data<br />
nj11mhf0016$ sudo mkdir /move<br />
nj11mhf0016$ sudo zfs set mountpoint=/move testz1</p>
<p>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000550 101044900     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 52004096    1024 52003072     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 52003072       0 52003072     0%    /tmp<br />
swap                 52003128      56 52003072     1%    /var/run<br />
testz2               104251392      26 99863897     1%    /testb<br />
testz2/data          25165824 4387339 20778485    18%    /testb/data<br />
testz1               104251392      25 99863571     1%    /move<br />
testz1/data          25165824 4387627 20778197    18%    /move/data</p>
<p>Move new files onto the old mount.<br />
nj11mhf0016$ sudo zfs set mountpoint=/testa testz2</p>
<p>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000558 101044892     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 51995568    1024 51994544     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 51994544       0 51994544     0%    /tmp<br />
swap                 51994600      56 51994544     1%    /var/run<br />
testz1               104251392      25 99863571     1%    /move<br />
testz1/data          25165824 4387627 20778197    18%    /move/data<br />
testz2               104251392      26 99863838     1%    /testa<br />
testz2/data          25165824 4387339 20778485    18%    /testa/data</p>
<p># Verify that everything is ok and the same.</p>
<p># Remove the move pool.<br />
nj11mhf0016$ sudo zfs destroy -r testz1<br />
nj11mhf0016$ sudo zpool destroy testz1</p>
<p>nj11mhf0016$ df -k<br />
Filesystem            kbytes    used   avail capacity  Mounted on<br />
/dev/dsk/c0t0d0s0    108126717 6000557 101044893     6%    /<br />
/devices                   0       0       0     0%    /devices<br />
ctfs                       0       0       0     0%    /system/contract<br />
proc                       0       0       0     0%    /proc<br />
mnttab                     0       0       0     0%    /etc/mnttab<br />
swap                 51977088    1024 51976064     1%    /etc/svc/volatile<br />
objfs                      0       0       0     0%    /system/object<br />
fd                         0       0       0     0%    /dev/fd<br />
swap                 51976064       0 51976064     0%    /tmp<br />
swap                 51976120      56 51976064     1%    /var/run<br />
testz2               104251392      26 99863838     1%    /testa<br />
testz2/data          25165824 4387339 20778485    18%    /testa/data</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flosbyers.com%2Fwordpress%2F2009%2F12%2Fprocedure-to-swap-zfs-pools-solaris%2F&amp;linkname=Procedure%20to%20swap%20ZFS%20pools%20Solaris"><img src="http://losbyers.com/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://losbyers.com/wordpress/2009/12/procedure-to-swap-zfs-pools-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find processes and what network ports they use on Solaris 10</title>
		<link>http://losbyers.com/wordpress/2009/12/find-processes-and-what-network-ports-they-use-on-solaris-10/</link>
		<comments>http://losbyers.com/wordpress/2009/12/find-processes-and-what-network-ports-they-use-on-solaris-10/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 22:14:04 +0000</pubDate>
		<dc:creator>LosByers</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://losbyers.com/wordpress/?p=48</guid>
		<description><![CDATA[<p>Show all of the processes and any open ports that they may be using.</p>
<p>for pid in `ps -aeo pid &#124; grep -v PID`; do
sudo pfiles ${pid} &#124; egrep &#8220;^${pid}:&#124;sockname:&#8221;
done</p>
<p>Once you know the PID&#8217;s of the processes you can determine all of the atributes of the applications using pargs, instead of ps. In Solaris 10 the [...]]]></description>
			<content:encoded><![CDATA[<p>Show all of the processes and any open ports that they may be using.</p>
<p><span style="color: #800080;">for pid in `ps -aeo pid | grep -v PID`; do<br />
sudo pfiles ${pid} | egrep &#8220;^${pid}:|sockname:&#8221;<br />
done</span></p>
<p>Once you know the PID&#8217;s of the processes you can determine all of the atributes of the applications using pargs, instead of ps. In Solaris 10 the /usr/ucb/ps is the same AT&amp;T version as /bin/ps, so the output is not very handy.</p>
<p><span style="color: #800080;">sudo pargs PID</span></p>
<p>The output for both will look like the following</p>
<p><span style="color: #3366ff;">sudo pfiles 28141 | egrep &#8220;^28141:|sockname:&#8221;<br />
28141:  /local/apps/wlapp02/Autonomy/IDOLServer/jre/bin/java -Djava.util.loggi<br />
sockname: AF_INET 0.0.0.0  port: 8080<br />
sockname: AF_INET 0.0.0.0  port: 50608<br />
sockname: AF_INET 0.0.0.0  port: 8009<br />
sockname: AF_INET 127.0.0.1  port: 8005</span></p>
<p><span style="color: #3366ff;">sudo pargs 28141<br />
28141:  /local/apps/wlapp02/Autonomy/IDOLServer/jre/bin/java -Djava.util.logging.manage<br />
argv[0]: /local/apps/wlapp02/Autonomy/IDOLServer/jre/bin/java<br />
argv[1]: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager</span></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flosbyers.com%2Fwordpress%2F2009%2F12%2Ffind-processes-and-what-network-ports-they-use-on-solaris-10%2F&amp;linkname=Find%20processes%20and%20what%20network%20ports%20they%20use%20on%20Solaris%2010"><img src="http://losbyers.com/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://losbyers.com/wordpress/2009/12/find-processes-and-what-network-ports-they-use-on-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
