<?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>unixwiz &#187; Solaris</title>
	<atom:link href="http://blogs.sungeek.net/unixwiz/category/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sungeek.net/unixwiz</link>
	<description>anything dealing with *NIX or what ever I want to write about</description>
	<lastBuildDate>Fri, 02 Jul 2010 02:28:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ZFS + PCA, goodbye UFS</title>
		<link>http://blogs.sungeek.net/unixwiz/2010/04/11/zfs-pca-goodbye-ufs/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2010/04/11/zfs-pca-goodbye-ufs/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 23:04:29 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[Patch Check Advanced]]></category>
		<category><![CDATA[Patching]]></category>
		<category><![CDATA[PCA]]></category>
		<category><![CDATA[UFS]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1294</guid>
		<description><![CDATA[ZFS has been around for a while now.. I have used it for some data partitions, but when Sun added the ability to use it as the root filesystem, I was a little hesitant to start using it there. Part of it was because, I know if I get a root disk that crashes and [...]]]></description>
			<content:encoded><![CDATA[<p>ZFS has been around for a while now.. I have used it for some data partitions, but when Sun added the ability to use it as the root filesystem, I was a little hesitant to start using it there. Part of it was because, I know if I get a root disk that crashes and it is on UFS, I can get in to it pretty well. ZFS was different and I was never really comfortable about using it for root, until last night. I have been looking for a way to keep a lot of Solaris machines up to date with the Recommended and Security patches and doing it with UFS seemed to be taking for ever. Part of the problem I had with keeping them updated with UFS was the shear downtime it required to install the cluster in single user mode. Multiply that by X number of machines and it is a never ending chore to update them. </p>
<p>This weekend I started looking at the <a href="http://www.par.univie.ac.at/solaris/pca/intro.html">PCA</a> tool, since I have seen a lot of people mention good things about it. So off to my test machine and I installed a new VM with Solaris 10 10/09 ( update 8 ) in it. After the install was finished using a ZFS root, I decided to set up a PCA proxy server on another machine. The purpose of the PCA Proxy server is that it will be the one with access to the Internet to download the patches from sunsolve. It was extremely easy to do this, (in fact I have it running in a zone on my main server.)</p>
<ol>
<li> Created a new plain zone (can be on anything, but I wanted to keep it seperate).
</li>
<li> Configure the apache2 instance on the machine, by copying the /etc/apache2/httpd.conf-example to /etc/apache2/httpd.conf
</li>
<li> Edit the httpd.conf and change the line that says &#8220;Timeout 300&#8243; to be &#8220;Timeout 1800&#8243;. You need to make it at least 1800, if not more depending on the speed of your Internet connection. At 22Mb/s 1800 was ok for me.
</li>
<li>Create a directory /var/apache2/htdocs/patches, make it owned by webservd:webservd and 755 as the permissions.
</li>
<li> Download and save a copy of pca in /var/apache2/cgi-bin and call it pca-proxy.cgi. Make it owned by webservd:webservd and 755 as the permissions.
</li>
<li>Create a file in /etc called pca-proxy.conf. In it place the following:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">xrefdir=</span>/var/apache2/htdocs/patches<br />
<span class="re2">patchdir=</span>/var/apache2/htdocs/patches<br />
<span class="re2">user=</span>sunsolveusername<br />
<span class="re2">passwd=</span>sunsolvepassword</div>
</div>
</li>
<li> In order to make the proxy run a little faster on the first use, I decided to download and &#8220;cache&#8221; the latest security and recommended patch cluster. (You don&#8217;t need to do this, but if the patches are missing the pca proxy server will download them. Considering my machine needed 156 patches, this was faster&#8230;) Once the recommended and security patches were downloaded, I placed them in a temp place and unzipped the cluster. Once the cluster is unzipped, I needed to make zip files of each patch (so that the pca client can download the zip file). To do this, I went in to tmp/10_x86_Recommended/patches and ran the following:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw1">for</span> i <span class="kw1">in</span> `<span class="kw2">cat</span> patch_order`<br />
<span class="kw1">do</span><br />
<span class="kw2">zip</span> -r <span class="re1">$i</span> <span class="re1">$i</span><br />
<span class="kw1">done</span></div>
</div>
</li>
<li> Once the zipping is done, move all the patch zip files in to the /var/apache2/htdocs/patches directory.
</li>
<li>Start up the apache2 service &#8220;svcadm enable apache2&#8243;
</li>
<li> Now it is time to configure the client, copy the pca script to the client machine and place it some place, I used /root.
</li>
<li>Next create a config file /etc/pca.conf in it with the following:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">patchurl=</span>http://pca-host/cgi-bin/pca-proxy.cgi<br />
<span class="re2">xrefurl=</span>http://pca-host/cgi-bin/pca-proxy.cgi<br />
<span class="re2">syslog=</span>local7<br />
<span class="re2">safe=</span><span class="nu0">1</span></div>
</div>
<p>The first two lines tells pca where to find the patches and the patchdiag.xref file. The syslog line tells it to log all activity to local7 syslog facaility. The last line &#8220;safe=1&#8243; means: Safe patch installation. Checks all files for local modifications before installing a patch. A patch will not be installed if files with local modifications would be overwritten.
</li>
<li> Now that the config file is created, make sure that syslog is set to handle local7 info, I have mine set to local7.info going to /var/adm/local7.log. PCA will log the patch installation stuff to that log (i.e.:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">Apr <span class="nu0">11</span> <span class="nu0">17</span>:<span class="nu0">10</span>:<span class="nu0">50</span> zfstest2 pca: <span class="br0">&#91;</span>ID <span class="nu0">702911</span> local7.notice<span class="br0">&#93;</span> Installed <span class="kw2">patch</span> <span class="nu0">124631</span><span class="nu0">-36</span> <span class="br0">&#40;</span>SunOS <span class="nu0">5</span>.10_x86: System Administration Applications, Network, and C<span class="br0">&#41;</span><br />
Apr <span class="nu0">11</span> <span class="nu0">19</span>:<span class="nu0">07</span>:<span class="nu0">04</span> zfstest2 pca: <span class="br0">&#91;</span>ID <span class="nu0">702911</span> local7.notice<span class="br0">&#93;</span> Failed to <span class="kw2">install</span> <span class="kw2">patch</span> <span class="nu0">118246</span><span class="nu0">-21</span> <span class="br0">&#40;</span>comm_dssetup <span class="nu0">6.4</span><span class="nu0">-5</span>.05_x86: core <span class="kw2">patch</span><span class="br0">&#41;</span> <span class="re2">rc=</span><span class="nu0">15</span></div>
</div>
</li>
</ol>
<p>Now comes the part that makes ZFS worth using&#8230; We are going to create a new &#8220;boot environment&#8221; and then patch that environment&#8221;</p>
<ol>
<li>First we need to create a new BE;
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">lucreate -n p20100411</div>
</div>
<p> The p20100411 can be anything, I used today&#8217;s date since I patched the machine today.. Makes it easy to remember when the last time the machine was patched.</li>
<li>Now we need to mount it
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">lumount p20100411 /.alt.root</div>
</div>
</li>
<li>Now we can start patching;
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">pca -i -R /.alt.root</div>
</div>
</li>
<li>Because I cached most of the patches locally on my pca proxy, it should not take too long for it to download, unzip and install the patches in the alt root</li>
<li>Once the patching is done, it will give you a summary line telling you how many patches were downloaded and installed:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">Download Summary: <span class="nu0">156</span> total, <span class="nu0">156</span> successful, <span class="nu0">0</span> skipped, <span class="nu0">0</span> failed<br />
Install Summary : <span class="nu0">156</span> total, <span class="nu0">156</span> successful, <span class="nu0">0</span> skipped, <span class="nu0">0</span> failed</div>
</div>
</li>
<li>Now we need to unmount the alt root and activate it to boot:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">luumount p20100411<br />
luactivate p20100411</div>
</div>
</li>
<li>Now just reboot the machine. You MUST use init or shutdown, if you don&#8217;t then it won&#8217;t boot in to the new boot environment. I use
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">shutdown -g0 -i6 -y</div>
</div>
</li>
<li>
</li>
<li>Depending on how long it takes for your machine to boot, when it comes back up it should be on the new ZFS file system:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">bash<span class="nu0">-3.00</span><span class="re3"># <span class="kw2">df</span> -h</span><br />
Filesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">size</span> &nbsp; used &nbsp;avail capacity &nbsp;Mounted on<br />
rpool/ROOT/p20100411 &nbsp; &nbsp;49G &nbsp; <span class="nu0">6</span>.6G &nbsp; &nbsp;38G &nbsp; &nbsp;<span class="nu0">15</span>% &nbsp; &nbsp;/</div>
</div>
</li>
<li>Now you can run that new patched system for how ever long it takes to verify your patches didn&#8217;t break anything. Once you are sure everything is ok, then you can delete the old install, in my case:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ludelete s10x_u8wos_08a</div>
</div>
<p>This should let you recover a little bit of space. In my case it was about 1.5 gig.</li>
</ol>
<p>The only thing left is to set up a bunch of scripts to do &#8220;pca -l&#8221; about once a month to see what patches need installed and to log that. PCA has a lot of other functions than I went over here, in a couple of words, it seems to be kick ass. On top of that it is free! The ability to create new BE&#8217;s will definitely hope any one with the right amount of disk space be able to keep their system up to date.</p>
<p>One Tip, make sure you watch the output of the luactivate command. This is what is displayed:</p>
<pre>
**********************************************************************

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

**********************************************************************

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Boot from Solaris failsafe or boot in single user mode from the Solaris
Install CD or Network.

2. Mount the Parent boot environment root slice to some directory (like
/mnt). You can use the following command to mount:

     mount -Fzfs /dev/dsk/c1t0d0s0 /mnt

3. Run <luactivate> utility with out any arguments from the Parent boot
environment root slice, as shown below:

     /mnt/sbin/luactivate

4. luactivate, activates the previous working boot environment and
indicates the result.

5. Exit Single User mode and reboot the machine.

**********************************************************************
</luactivate></pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2010/04/11/zfs-pca-goodbye-ufs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bad Oracle, Leave Solaris free</title>
		<link>http://blogs.sungeek.net/unixwiz/2010/03/28/bad-oracle-leave-solaris-free/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2010/03/28/bad-oracle-leave-solaris-free/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 23:49:58 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Licensing]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1283</guid>
		<description><![CDATA[I just read Ben Rockwood&#8217;s post about Solaris No Longer Free. All I can say is I am severely disappointed in how Oracle has pretty much killed Sun and it&#8217;s products. One of the best things that Sun ever did was allow people to use Solaris for free. The caveat was you only got the [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="http://www.cuddletech.com/blog/pivot/entry.php?id=1120">Ben Rockwood&#8217;s post about Solaris No Longer Free</a>. All I can say is I am severely disappointed in how Oracle has pretty much killed Sun and it&#8217;s products. One of the best things that Sun ever did was allow people to use Solaris for free. The caveat was  you only got the Security patches for free. About a month or so ago, Oracle decided that you couldn&#8217;t get any patches unless you had a support contract. Ok I can sort of see your position on that, but why the hell are you now going to start charging for the OS as well. You have taken one of the best OS&#8217; in the world for servers and basically killed it. What you are going to do is push more people to Linux (eck, I hate linux..). I am not sure why a company that has the number one OS would ever push people away from its OS. Linux is still immature in many ways and can&#8217;t scale at all unless you want to scale out and use up more power/floor space.  </p>
<p>I hope that the Solaris user community will come around like they did when Sun tried to kill Solaris X86, and let Oracle know what a bad idea this was. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2010/03/28/bad-oracle-leave-solaris-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seeing Red &#8211; RIP Sun</title>
		<link>http://blogs.sungeek.net/unixwiz/2010/01/28/seeing-red/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2010/01/28/seeing-red/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 02:06:57 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[RIP]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1254</guid>
		<description><![CDATA[Not sure how I feel now that Sun is no longer Sun. Kinda weird watching the Oracle web cast of their purchase of Sun and what is going to happen. One thing I can&#8217;t understand is they are all wearing badges saying &#8220;We&#8217;re Hiring!&#8221;. But yet they let go SO many good Sun employees. I [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure how I feel now that Sun is no longer Sun. Kinda weird watching the Oracle web cast of their purchase of Sun and what is going to happen. One thing I can&#8217;t understand is they are all wearing badges saying &#8220;We&#8217;re Hiring!&#8221;. But yet they let go SO many good Sun employees. I just don&#8217;t think it is going to be the same old Sun that I have used since 1994. </p>
<p>RIP Sun 1982 &#8211; 2010<br />
<div id="attachment_1259" class="wp-caption alignleft" style="width: 610px"><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2010/01/SunRIPsmall.jpg" alt="" title="RIP Sun 1982-2010" width="600" height="469" class="size-full wp-image-1259" /><p class="wp-caption-text">From http://blogs.sun.com/jag/</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2010/01/28/seeing-red/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor Man&#8217;s Network Traffic Meter</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/09/12/poor-mans-network-traffic-meter/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/09/12/poor-mans-network-traffic-meter/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 02:36:55 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Shell Scripts]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[netstat]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1209</guid>
		<description><![CDATA[Set out tonight to find a way to log &#8220;network traffic&#8221; through the interfaces on my solaris box. What I was wanting was the actually amount of traffic going through the interfaces. First thought was to use netstat. But that only shows &#8220;packets&#8221; and the packets could be differing sizes. So I ended up using [...]]]></description>
			<content:encoded><![CDATA[<p>Set out tonight to find a way to log &#8220;network traffic&#8221; through the interfaces on my solaris box. What I was wanting was the actually amount of traffic going through the interfaces. First thought was to use netstat. But that only shows &#8220;packets&#8221; and the packets could be differing sizes. So I ended up using kstat. I wrote this simple little script to grab the interface names, and then use kstat to get the data out of the network module for each card:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re3">#!/bin/ksh</span><br />
<span class="re3">#Get list of Ethernet Cards <span class="kw1">in</span> machine:</span><br />
<span class="re2">MyHOST=</span><span class="st0">&quot;`hostname`&quot;</span><br />
<span class="re2">OS=</span><span class="st0">&quot;`uname -r`&quot;</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re0">$<span class="br0">&#123;</span>OS<span class="br0">&#125;</span></span> == <span class="st0">&quot;5.10&quot;</span> <span class="br0">&#93;</span> ; <span class="kw1">then</span><br />
&nbsp; &nbsp;<span class="re2">MyETHERS=</span><span class="st0">&quot;`/usr/sbin/dladm show-dev | awk &#8216;{print $1}&#8217;`&quot;</span><br />
<span class="kw1">else</span><br />
&nbsp; &nbsp;<span class="re2">MyETHERS=</span><span class="st0">&quot;`/usr/sbin/ifconfig -a | awk &#8216;{print $1}&#8217; | grep <span class="es0">\&quot;</span>:<span class="es0">\&quot;</span> | awk -F&#8217;:&#8217; &#8216;{print $1}&#8217; | sort -u | grep -v <span class="es0">\&quot;</span>^lo0<span class="es0">\&quot;</span>`&quot;</span><br />
<span class="kw1">fi</span><br />
<span class="re2">COUNT=</span><span class="nu0">0</span><br />
<span class="kw1">while</span> <span class="br0">&#91;</span> <span class="re1">$COUNT</span> -lt <span class="nu0">800</span> <span class="br0">&#93;</span>; <br />
&nbsp; <span class="kw1">do</span><br />
&nbsp; <span class="kw1">for</span> i <span class="kw1">in</span> `<span class="kw3">echo</span> <span class="re1">$MyETHERS</span>`<br />
&nbsp; <span class="kw1">do</span><br />
&nbsp; &nbsp; <span class="re2">OBYTES=</span><span class="st0">&quot;`/usr/bin/kstat -p -c net -n $i -s obytes64 | awk &#8216;{print $2}&#8217;`&quot;</span><br />
&nbsp; &nbsp; <span class="re2">RBYTES=</span><span class="st0">&quot;`/usr/bin/kstat -p -c net -n $i -s rbytes64 | awk &#8216;{print $2}&#8217;`&quot;</span><br />
&nbsp; &nbsp; <span class="re2">SNAPTIME=</span><span class="st0">&quot;`perl -e <span class="es0">\&quot;</span>print(time());<span class="es0">\&quot;</span>`&quot;</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;${MyHOST},${i},${SNAPTIME},${OBYTES},${RBYTES}&quot;</span><br />
&nbsp; &nbsp; <span class="re2">OBYTES=</span><br />
&nbsp; &nbsp; <span class="re2">RBYTES=</span> <br />
&nbsp; &nbsp; <span class="re2">SNAPTIME=</span><br />
&nbsp; <span class="kw1">done</span><br />
&nbsp; <span class="kw2">sleep</span> <span class="nu0">10</span><br />
&nbsp; <span class="re2">COUNT=</span><span class="st0">&quot;`expr $COUNT + 1`&quot;</span><br />
<span class="kw1">done</span></div>
</div>
<p>You have to be root to run this, but that is only because of the dladm command I am using on Solaris 10. If you don&#8217;t want to run it as root, then comment out the if statement and just leave the line that uses ifconfig. When you run it, it will produce an output like this:</p>
<blockquote><p>
gonzo,elxl0,1252806095,37255837,715035<br />
gonzo,rge0,1252806096,605012664015,863919572622<br />
gonzo,elxl0,1252806106,37255837,715035<br />
gonzo,rge0,1252806107,605012664377,863919573090
</p></blockquote>
<p>The output is formated as hostname, ethernet, time of the run, sending bytes, and receiving bytes. (The time is the epoch time.) The above script will only run 800 times, pausing 10 seconds between each run of the kstat. You can change how long it runs by changing the line:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw1">while</span> <span class="br0">&#91;</span> <span class="re1">$COUNT</span> -lt <span class="nu0">800</span> <span class="br0">&#93;</span>;</div>
</div>
<p>Just change the 800 to some other number. The second item to change is the &#8220;interval&#8221; time and that is controled by the :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">sleep</span> <span class="nu0">10</span></div>
</div>
<p>You probably don&#8217;t want to run this every second. Every 10 is about right, as it will allow me to get the traffic with out much overhead.</p>
<p>The second script I did, was a little php script (but can be done in probably any language, but I use php for just about everything. This script takes output from the file you created above (just run the above script, redirect it to a file) and gives you a human readable output.</p>
<p>Note if you have more than one ethernet card active in your system, currently you will need to<br />
&#8220;grep&#8221; out each card to it&#8217;s own file. If you have a bunch of machines, you should probably import the data from above in to a mysql db, and then modify this script to pull the info from it.</p>
<p>Here is the script to just parse one network card:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">&lt;?php</span><br />
date_default_timezone_set<span class="br0">&#40;</span><span class="st0">&quot;EST&quot;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$fp</span>=<a href="http://www.php.net/fopen"><span class="kw3">fopen</span></a><span class="br0">&#40;</span><span class="st0">&quot;Netstat.csv&quot;</span>,r<span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re0">$i</span>=<span class="nu0">0</span>;<br />
&nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>!<a href="http://www.php.net/feof"><span class="kw3">feof</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$buffer</span>=<a href="http://www.php.net/fgets"><span class="kw3">fgets</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$buffer</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/list"><span class="kw3">list</span></a><span class="br0">&#40;</span><span class="re0">$hostname</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$ethernet</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$time</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$sending</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$receiving</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#41;</span> = <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot;,&quot;</span>,<span class="re0">$buffer</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="re0">$newtime</span>=<a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8216;r&#8217;</span>,<span class="re0">$time</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$i</span> != <span class="nu0">0</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$TDIFF</span>=<span class="br0">&#40;</span><span class="re0">$time</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>-<span class="re0">$time</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="nu0">-1</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$SDIFF</span>=<span class="br0">&#40;</span><span class="re0">$sending</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>-<span class="re0">$sending</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="nu0">-1</span><span class="br0">&#93;</span><span class="br0">&#41;</span>/<span class="re0">$TDIFF</span>/<span class="nu0">1024</span>/<span class="nu0">1024</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$RDIFF</span>=<span class="br0">&#40;</span><span class="re0">$receiving</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>-<span class="re0">$receiving</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="nu0">-1</span><span class="br0">&#93;</span><span class="br0">&#41;</span>/<span class="re0">$TDIFF</span>/<span class="nu0">1024</span>/<span class="nu0">1024</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/printf"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;%s|%s|%s|%3.3f|%3.3f<span class="es0">\n</span>&quot;</span>,<span class="re0">$hostname</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$ethernet</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>,<span class="re0">$newtime</span>,<span class="re0">$SDIFF</span>,<span class="re0">$RDIFF</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$SDIFF</span>=<span class="st0">&quot;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$RDIFF</span>=<span class="st0">&quot;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$TDIFF</span>=<span class="st0">&quot;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$i</span>++;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<a href="http://www.php.net/fclose"><span class="kw3">fclose</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
</div>
<p>In the above, I named my redirected output to be Netstat.csv. What the above script outputs will look like this:</p>
<blockquote><p>
gonzo|rge0|Sat, 12 Sep 2009 15:44:38 -0500|0.000|0.000<br />
gonzo|rge0|Sat, 12 Sep 2009 15:44:49 -0500|0.000|0.007<br />
gonzo|rge0|Sat, 12 Sep 2009 15:45:04 -0500|6.677|0.065<br />
gonzo|rge0|Sat, 12 Sep 2009 15:45:18 -0500|3.148|0.027<br />
gonzo|rge0|Sat, 12 Sep 2009 15:45:41 -0500|5.377|0.076<br />
gonzo|rge0|Sat, 12 Sep 2009 15:45:55 -0500|8.678|0.111<br />
gonzo|rge0|Sat, 12 Sep 2009 15:46:16 -0500|9.499|0.117<br />
gonzo|rge0|Sat, 12 Sep 2009 15:46:30 -0500|8.861|0.117<br />
gonzo|rge0|Sat, 12 Sep 2009 15:46:46 -0500|9.183|0.120<br />
gonzo|rge0|Sat, 12 Sep 2009 15:47:02 -0500|10.783|0.139<br />
gonzo|rge0|Sat, 12 Sep 2009 15:47:15 -0500|7.103|0.093<br />
gonzo|rge0|Sat, 12 Sep 2009 15:47:29 -0500|7.165|0.100<br />
gonzo|rge0|Sat, 12 Sep 2009 15:47:44 -0500|6.995|0.095<br />
gonzo|rge0|Sat, 12 Sep 2009 15:48:01 -0500|6.986|0.099<br />
gonzo|rge0|Sat, 12 Sep 2009 15:48:15 -0500|5.678|0.069<br />
gonzo|rge0|Sat, 12 Sep 2009 15:48:28 -0500|6.530|0.090<br />
gonzo|rge0|Sat, 12 Sep 2009 15:48:53 -0500|3.477|0.046<br />
gonzo|rge0|Sat, 12 Sep 2009 15:49:14 -0500|6.459|0.083<br />
gonzo|rge0|Sat, 12 Sep 2009 15:49:31 -0500|7.754|0.105<br />
gonzo|rge0|Sat, 12 Sep 2009 15:49:58 -0500|9.416|0.121<br />
gonzo|rge0|Sat, 12 Sep 2009 15:50:10 -0500|10.854|0.139<br />
gonzo|rge0|Sat, 12 Sep 2009 15:50:21 -0500|11.922|0.152<br />
gonzo|rge0|Sat, 12 Sep 2009 15:50:31 -0500|12.556|0.165<br />
gonzo|rge0|Sat, 12 Sep 2009 15:50:43 -0500|12.813|0.170<br />
gonzo|rge0|Sat, 12 Sep 2009 15:50:54 -0500|14.783|0.188<br />
gonzo|rge0|Sat, 12 Sep 2009 15:51:05 -0500|12.729|0.168<br />
gonzo|rge0|Sat, 12 Sep 2009 15:51:16 -0500|12.018|0.148<br />
gonzo|rge0|Sat, 12 Sep 2009 15:51:27 -0500|10.786|0.141<br />
gonzo|rge0|Sat, 12 Sep 2009 15:51:38 -0500|13.566|0.167<br />
gonzo|rge0|Sat, 12 Sep 2009 15:51:49 -0500|11.234|0.144<br />
gonzo|rge0|Sat, 12 Sep 2009 15:52:01 -0500|12.914|0.165
</p></blockquote>
<p>The output is : hostname, ethernet, time of query,sending speed in Mbps, receiving speed in Mbps. As you can see from the above, I was copying some large amounts of data. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/09/12/poor-mans-network-traffic-meter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenVPN between Solaris and MacOSX</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 00:06:34 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[LZO]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[TUN]]></category>
		<category><![CDATA[Tunnelblick]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1178</guid>
		<description><![CDATA[I decided to see if I could get a VPN connection working between my laptop (running MacOSX) and my home server running Solaris 10. It turned out to be pretty easy to do a simple config. I am using OpenVPN. To compile the software on my Solaris box I needed to download 3 items: Virtual [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to see if I could get a VPN connection working between my laptop (running MacOSX) and my home server running Solaris 10. It turned out to be pretty easy to do a simple config. I am using <a href="http://openvpn.net/">OpenVPN</a>. To compile the software on my Solaris box I needed to download 3 items:</p>
<ol>
<li>
 Virtual Point-to-Point (Tun) and Ethernet (TAP) devices driver. I got the version 1.1 from <a href="http://vtun.sourceforge.net/tun/">http://vtun.sourceforge.net/tun/</a> in source code form.</li>
<li>LZO version 1.08 compression software from : <a href="http://www.oberhumer.com/opensource/lzo/download/LZO-v1/">http://www.oberhumer.com/opensource/lzo/download/LZO-v1/</a>
</li>
<li>OpenVPN software, I am using the version 2.1RC because I wanted the version to match what I am going to run on the Mac. It can be downloaded from <a href="http://openvpn.net/index.php/open-source/downloads.html">http://openvpn.net/index.php/open-source/downloads.html</a>
</li>
</ol>
<p>Once I got everything downloaded, just compile the LZO, Tun, and OpenVPN:<br />
I decided to have everything related to the vpn installed in /opt/vpn. One thing to note, I tried using the new version 2.x of LZO, and OpenVPN would not find it, so I had to use Version 1 even though 2 is supposed to be supported. So I did the following to compile LZO:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d lzo<span class="nu0">-1.08</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf lzo<span class="nu0">-1.08</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> lzo<span class="nu0">-1.08</span><br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/lzo<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Next was to compile TUN</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d tun<span class="nu0">-1.1</span>.<span class="kw2">tar</span><br />
<span class="kw2">tar</span> -xvf tun<span class="nu0">-1.1</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> tun<span class="nu0">-1.1</span><br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/tun<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Only issue with tun was that it did not use the &#8211;prefix, it puts everything where it needs to be in /usr/kernel/drv on solaris.</p>
<p>Next is openvpn:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d openvpn<span class="nu0">-2</span>.1_rc19.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf openvpn<span class="nu0">-2</span>.1_rc19.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> openvpn<span class="nu0">-2</span>.1_rc19<br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/openvpn &#8211;with-lzo-<span class="re2">headers=</span>/opt/vpn/lzo/include &#8211;with-lzo-<span class="re2">lib=</span>/opt/vpn/lzo/lib<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Once that is installed I did the simple 1 to 1 vpn connection (static key) for just testing to see if it would work. So in the /opt/vpn/openvpn/sbin directory I did this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw3">cd</span> /opt/vpn/openvpn/sbin<br />
./openvpn &#8211;genkey &#8211;secret static.key</div>
</div>
<p>I then copy that key to my client via some &#8220;secure&#8221; means</p>
<p>Then created a server.conf that looks like this:</p>
<pre>
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
keepalive 10 120
</pre>
<p>On my client (MacOSX) I downloaded Tunnelblick from <a href="http://code.google.com/p/tunnelblick/downloads/list">http://code.google.com/p/tunnelblick/downloads/list</a> and installed it. Next I copied that static.key from the server to the client and put it in ~/Library/openvpn. I also created a openvpn.conf in that directory that looked like this:</p>
<pre>
remote a.b.c.d
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret static.key
cipher AES-256-CBC
route 10.0.0.0 255.255.255.0
</pre>
<p>In the above, a.b.c.d represents my public IP address for my solaris server.</p>
<p>Now when you start tunnelblick it will search that directory and find that config file and ask if you want to load it. But we are not quite ready to start yet. The next thing I had to do was forward port 1194 UDP off of my router to my OpenVPN server. I will leave this exercise to you. You will also need to make sure IP forwarding is enabled on the Solaris 10 server (because I only have 1 network card in it, but &#8220;two&#8221; different networks on the box. IP Forwarding will allow your remote machine to be able to see your local network. And since my OpenVPN server is not the router for the entire network, I had to add a static route on my router to say that 10.8.0.0 is available via the openvpn servers local network address, I.e. 10.0.0.1. </p>
<p>You should be able to start the openvpn server now:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">/opt/vpn/openvpn/sbin/openvpn server.conf</div>
</div>
<p>Once it is started you can use tunnelblick to connect. Once you are connected, you should see that is is connected and the icon has changed from this:<br />
<a href="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-3.png"><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-3.png" alt="Picture 3" title="Picture 3" width="26" height="23" class="alignnone size-full wp-image-1180" /></a><br />
to look like this:<br />
<a href="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-2.png"><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-2.png" alt="Picture 2" title="Picture 2" width="40" height="20" class="alignnone size-full wp-image-1179" /></a></p>
<p>You should also see a tun0 device show up:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ifconfig tun0<br />
tun0: <span class="re2">flags=</span><span class="nu0">8851</span> &lt; up ,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST &gt; mtu <span class="nu0">1500</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; inet <span class="nu0">10.8</span><span class="nu0">.0</span><span class="nu0">.2</span> &#8211;&gt; <span class="nu0">10.8</span><span class="nu0">.0</span><span class="nu0">.1</span> netmask 0xffffffff <br />
&nbsp; &nbsp; &nbsp; &nbsp; open <span class="br0">&#40;</span>pid <span class="nu0">608</span><span class="br0">&#41;</span></div>
</div>
<p>You should now be able to see all your hosts on the &#8220;remote&#8221; network. Next up I am going to work on doing the pki infrastructure so I can hopefully link other clients both static and dynamic.</p>
<p>This make is really nice to be able to see your &#8220;home&#8221; network while you are away. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Ray 5 Early Access part 2</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/07/25/sun-ray-5-early-access-part-2/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/07/25/sun-ray-5-early-access-part-2/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 23:48:26 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[Sun Ray]]></category>
		<category><![CDATA[Sun Ray @Home]]></category>
		<category><![CDATA[Fusion]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[MacPro]]></category>
		<category><![CDATA[Sun Ray 5 Early Access]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1168</guid>
		<description><![CDATA[I finally got time again to start playing with Sun Ray 5 Early Access software. Now my current setup probably should not be used for any type of test more than simple single/dual user testing. But I did not want to test the software on the current working server. So I decided to install it [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got time again to start playing with Sun Ray 5 Early Access software. Now my current setup probably should not be used for any type of test more than simple single/dual user testing. But I did not want to test the software on the current working server. So I decided to install it in a VMWare image on my Mac Pro. The Mac Pro is more than suited to handle it and had plenty of free memory/processor/storage to use so there was no contention (I gave the VM 4 processors and 8 gig of ram)..</p>
<p>The kicker was getting VMWare Fusion to actually allocate the network cards the way I needed them. I gave the VM 2 nics (the Mac Pro has 2), however the only options that VMWare Fusion let you do is NAT, Host-Only, and Bridged. None of which will work if I want a private network for the Sun Ray&#8217;s. To fix this you will need to go and edit some files that VMWare Fusion uses. What I had to do was the following:</p>
<p>1. Open up the Terminal app<br />
2. Edit the file /Library/Application Support/VMware Fusion/boot.sh </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">sudo</span> vi /Library/Application\ Support/VMware\ Fusion/boot.<span class="kw2">sh</span></div>
</div>
<p>3. Comment out the following line:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="st0">&quot;$LIBDIR/vmnet-bridge&quot;</span> -d /var/run/vmnet-bridge-vmnet0.pid vmnet0 <span class="st0">&#8221;</span></div>
</div>
<p>And then add 2 lines directly below that line, which tells vmware to bind the en0 physical device to the vmnet0 virtual device, same for en1 to vmnet2. Note you can not use vmnet1 or vmnet8 as those are for NAT and Host-only connections.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="st0">&quot;$LIBDIR/vmnet-bridge&quot;</span> -d /var/run/vmnet-bridge-vmnet0.pid vmnet0 en0<br />
<span class="st0">&quot;$LIBDIR/vmnet-bridge&quot;</span> -d /var/run/vmnet-bridge-vmnet2.pid vmnet2 en1</div>
</div>
<p>Once done, do the following:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">sudo</span> /Library/Application\ Support/VMware\ Fusion/boot.<span class="kw2">sh</span> &#8211;restart</div>
</div>
<p>Now go in to your Mac System Preferences and configure the second network card for a private subnet (i.e. 192.168.128.0/24, and set the IP to be something like 192.168.128.254). </p>
<p>Now make sure that your VM is NOT started and is in a powered off state. Go in to the VM and under the settings for that VM add another network adapter, make sure it is selected as &#8220;Connected&#8221; it doesn&#8217;t matter what the device is configured to as we will change it later to an option that is not shown in that list.</p>
<p>Now you need to change the .VMX file so that it can use the new network device. So go in to the directory where you have your VM&#8217;s at and then cd in to the machine.vmwarevm directory (For example mine is called SolarisDev.vmwarevm)</p>
<p>Once in there you will need to edit the vmx file, mine is called SolarisDev.vmx. The first thing we are going to change is the ethernet0.connectionType property. Right now it could be any of the ones listed (host-only,bridged, nat). But we are going to change this to &#8220;custom&#8221;:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ethernet0.<span class="re2">connectionType=</span><span class="st0">&quot;custom&quot;</span></div>
</div>
<p>Next find the entry for ethernet0.vnet, if it doesn&#8217;t exist create it and make it look like the line below. If it does exist and doesn&#8217;t match that below, make it match that:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ethernet0.vnet = <span class="st0">&quot;vmnet0&quot;</span></div>
</div>
<p>Now we need to do the same for the ethernet1 entries. The only difference to what is above is vmnet0 changes to vmnet2. Once the changes are made you can save the file and start up your Solaris VM. Now what ever network is on your en0 connection on your Mac should be what is connected to the e1000g0 network on the Solaris side. I used the e1000g0 as the &#8220;public&#8221; side of the Sun Ray server. The e1000g1 interface will be what ever is connected on the en1 connection on the Mac side. I used this adapter for the private Sun Ray Lan.</p>
<p>You should be able to finish following the instructions on the Sun Ray wiki now and get everything configured. </p>
<p>To test the soft client, I set up LAN Connections on the Sun Ray Server:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">/opt/SUNWut/sbin/utadm -L on</div>
</div>
<p>I then installed the soft client in another VM on the same machine that only had access to the public network. You then can tell the soft client what the IP of the Sun Ray server is and it will connect. Pretty darn cool that the soft client works with minimal config.</p>
<p>This can probably be done on a MacBook Pro as well, if you use the wireless connection as the public side and the wired as the private side. Nice way to do a little demo in one computer.</p>
<p>For reference here is what my network section of the .vmx file looks like :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ethernet0.addressType = <span class="st0">&quot;generated&quot;</span><br />
ethernet0.connectionType = <span class="st0">&quot;custom&quot;</span><br />
ethernet0.generatedAddress = <span class="st0">&quot;00:0c:29:f8:29:3b&quot;</span><br />
ethernet0.generatedAddressOffset = <span class="st0">&quot;0&quot;</span><br />
ethernet0.linkStatePropagation.<span class="kw3">enable</span> = <span class="st0">&quot;TRUE&quot;</span><br />
ethernet0.pciSlotNumber = <span class="st0">&quot;32&quot;</span><br />
ethernet0.present = <span class="st0">&quot;TRUE&quot;</span><br />
ethernet0.virtualDev = <span class="st0">&quot;e1000&quot;</span><br />
ethernet0.vnet = <span class="st0">&quot;vmnet0&quot;</span><br />
ethernet0.wakeOnPcktRcv = <span class="st0">&quot;FALSE&quot;</span><br />
ethernet1.addressType = <span class="st0">&quot;generated&quot;</span><br />
ethernet1.connectionType = <span class="st0">&quot;custom&quot;</span><br />
ethernet1.generatedAddress = <span class="st0">&quot;00:0c:29:f8:29:45&quot;</span><br />
ethernet1.generatedAddressOffset = <span class="st0">&quot;10&quot;</span><br />
ethernet1.linkStatePropagation.<span class="kw3">enable</span> = <span class="st0">&quot;TRUE&quot;</span><br />
ethernet1.pciSlotNumber = <span class="st0">&quot;35&quot;</span><br />
ethernet1.present = <span class="st0">&quot;TRUE&quot;</span><br />
ethernet1.virtualDev = <span class="st0">&quot;e1000&quot;</span><br />
ethernet1.vnet = <span class="st0">&quot;vmnet2&quot;</span><br />
ethernet1.wakeOnPcktRcv = <span class="st0">&quot;FALSE&quot;</span></div>
</div>
<p>References:<br />
Sun Ray Software 4.2 Wiki:<a href="http://wikis.sun.com/display/SRSS4dot2/Home"> http://wikis.sun.com/display/SRSS4dot2/Home</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/07/25/sun-ray-5-early-access-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fscking a disk under solaris volume manager control</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/07/07/fscking-a-disk-under-solaris-volume-manager-control/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/07/07/fscking-a-disk-under-solaris-volume-manager-control/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 02:03:40 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[metainit]]></category>
		<category><![CDATA[metasync]]></category>
		<category><![CDATA[modload]]></category>
		<category><![CDATA[modunload]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1157</guid>
		<description><![CDATA[Some people may have noticed others may not, but the server went down for a while today. Well the root cause I think is that there were some file system problems. The one thing that lead me to that is this error in /var/adm/messages: ufs: [ID 879645 kern.notice] NOTICE: /: unexpected free inode 48714, run [...]]]></description>
			<content:encoded><![CDATA[<p>Some people may have noticed others may not, but the server went down for a while today. Well the root cause I think is that there were some file system problems. The one thing that lead me to that is this error in /var/adm/messages:</p>
<pre>
ufs: [ID 879645 kern.notice] NOTICE: /: unexpected free inode 48714, run fsck(1M) -o f
</pre>
<p>Well this is a little hard to fix especially if you have root under solaris volume manager control. So how do you do it? Sort of easy, but it assumes you have either a solaris boot cd or a jumpstart server you can boot off of to get the box into single user mode.</p>
<p>Once you have the box in single user mode off of either the CD or the jumpstart server,  you will need to mount in readonly mode one side of the root mirror. Say /dev/dsk/c1t0d0s0. :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">mount</span> -o ro /dev/dsk/c1t0d0s0 /mnt</div>
</div>
<p>Once that is mounted (if it won&#8217;t mount then you will have to fsck that side of the mirror to fix the file system if it is really screwed up to not even mount in read only mode) you need to copy some files from it to the &#8220;temp&#8221; root that you are booted from. But first we need to unload the md driver: </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re3"># modinfo | <span class="kw2">grep</span> md</span><br />
&nbsp;<span class="nu0">25</span> fffffffffbb04b88 &nbsp;<span class="nu0">30608</span> &nbsp;<span class="nu0">85</span> &nbsp; <span class="nu0">1</span> &nbsp;md <span class="br0">&#40;</span>Solaris Volume Manager base mod<span class="br0">&#41;</span><br />
<span class="re3">#modunload -i <span class="nu0">25</span></span></div>
</div>
<p>Now that the md driver is unloaded, you need to copy the following files:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">cp</span> /mnt/etc/lvm/mddb.cf &nbsp;/etc/lvm/mddb.cf <br />
<span class="kw2">cp</span> /mnt/etc/lvm/md.cf &nbsp;/etc/lvm/md.cf<br />
<span class="kw2">cp</span> /mnt/kernel/drv/md.cf /kernel/drv/md.cf</div>
</div>
<p>Now unmount the /mnt </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">umount</span> /mnt</div>
</div>
<p>Now we need to restart the md driver</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">modload /kernel/drv/md</div>
</div>
<p>Now if you run metastat or metadb, you will get a generic error like there is no devices or databases set up. To fix this run a :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">metainit -r</div>
</div>
<p>This does the following:</p>
<pre>
    -r              Only used in a shell script  at  boot  time.
                     Sets up all metadevices that were configured
                     before the system crashed or was shut  down.
                     The  information about previously configured
                     metadevices  is  stored  in  the  metadevice
                     state database (see metadb(1M)).
</pre>
<p>You can now run metastat, but all your devices will say they need maintenance. To fix this run :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">metasync -r</div>
</div>
<p>This will sync all the mirrors back up. Now we are finally able to run an fsck againest a mirrored slice that we weren&#8217;t able to run if the machine is up in full user mode. </p>
<p>So now I ran :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">fsck -o f /dev/md/rdsk/d30</div>
</div>
<p>And I keep running fsck on the device till it comes back clean with no errors. Then lather, rinse, repeat for the other slices.</p>
<p>Now once all the slices are done, make sure to update your boot archive (if on an x86 machine) and then you can restart the machine:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">mount</span> /dev/md/dsk/d30 /mnt<br />
bootadm update-archive -R /mnt<br />
<span class="kw2">umount</span> /mnt<br />
shutdown -g0 -i6 -y</div>
</div>
<p>If on a SPARC box, just make sure all the file systems you mounted off of the disks are unmounted and then restart the machine. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/07/07/fscking-a-disk-under-solaris-volume-manager-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vSphere4i cloning</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/06/27/vsphere4i-cloning/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/06/27/vsphere4i-cloning/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 21:35:20 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[cloning]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1154</guid>
		<description><![CDATA[Have been playing around with VMWare&#8217;s vSphere 4i today. One of the major differences between it and the full version is being able to clone and make templates out of VM images. What I did today was setup a machine with a bunch of Solaris VM&#8217;s. But I did not want to installed them all [...]]]></description>
			<content:encoded><![CDATA[<p>Have been playing around with VMWare&#8217;s vSphere 4i today. One of the major differences between it and the full version is being able to clone and make templates out of VM images. What I did today was setup a machine with a bunch of Solaris VM&#8217;s. But I did not want to installed them all from scratch. On the full version of ESX, cloning is supported for Windows and I believe Linux, but don&#8217;t think it is for Solaris.  So to do the poor mans clone of Solaris was what I needed to do. So how do you do it? Sort of simple:</p>
<p>1. Install one of the VM&#8217;s from scratch from either a CD or ISO Image. (You can upload an ISO image to the server by going in to to the Configuration section of the vSphere Client, and clicking on storage and then browse the datastore. What I did was make a directory for the ISO Images, and then you can click the upload button and find the file on the local machine and it will upload it to the server. It makes it a lot faster to install from an ISO image vs the CDRom).</p>
<p>2. Once the OS is installed, I put the latest Security/Recommended patches on it. I also installed the VMWare Tools. </p>
<p>3. Do any &#8220;configuration&#8221; that you want to be done for all the VM&#8217;s. For example, modify the /etc/issue,/etc/ssh/sshd_config, create non root accounts, enable auditing, disable services, etc.</p>
<p>4. The next thing I did was ran a &#8220;sys-unconfig&#8221;. This will remove the root user&#8217;s password, clear the hostname, clear all IP information and the naming service info. It will leave other local created accounts though.</p>
<p>5. The final step of the sys-unconfig, halts the VM. This will be the &#8220;last&#8221; time you will boot this image.  We will now use it as a poor man&#8217;s template for our other VM&#8217;s. (The reason I say last is unless you are going to update it to be used to &#8220;clone&#8221; new vm&#8217;s, you should never boot it again.) You should also probably rename this virtual machine to be something like &#8220;Solaris &#8211; Template &#8211; DNB&#8221; (DNB=Do Not Boot&#8230; )</p>
<p>6. Back in the Datastore browser, create a new folder for the to be &#8220;cloned&#8221; vm. </p>
<p>7. Now go in to the folder of the original vm you made that is in the &#8220;unconfiged&#8221; state. Once in there, select ALL the files in there and right click and select copy.</p>
<p>8. Now go to the newly created folder, and go in to it and right click and select paste. For a VM with a 20gb disk this takes about a minute or so to copy and paste.</p>
<p>9. Now go in to the cloned directory and right click on the VMX file and select &#8220;Add to Inventory&#8221;. It will pop up a dialog box and will let you &#8220;name&#8221; the new vm. Type in the new name of the new vm. (It won&#8217;t change the name of the files in that directory though.)</p>
<p>10. Next you can power on the new &#8220;cloned&#8221; vm. It will give you a pop up box asking if you have &#8220;moved&#8221; it or &#8220;copied&#8221; it or something else. Just select copied, and it will load the VM. </p>
<p>11. Now when Solaris boots, it will look like a clean machine, it will ask you for the hostname, ip, name service, etc, and then reboot after you enter in the information. </p>
<p>All said I did about 12 of these and had them all running at the same time and didn&#8217;t have a problem with them. If you need some different &#8220;hardware&#8221; for a vm, before you power it on, you can change the settings just as if you had installed it from scratch. One thing with the new vSphere it will support adding more than just a disk if the OS supports it. So you should be able to add processors, disk and possibly memory on the fly to a solaris VM.</p>
<p>Hope that helps people with the i version of ESX&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/06/27/vsphere4i-cloning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mediatomb and Solaris 10</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 03:28:05 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Zones/Containers]]></category>
		<category><![CDATA[mediatomb]]></category>
		<category><![CDATA[ps3]]></category>
		<category><![CDATA[replaytv]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1140</guid>
		<description><![CDATA[Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is from <a href="http://blogs.sun.com/constantin/entry/mediatomb_on_solaris">http://blogs.sun.com/constantin/entry/mediatomb_on_solaris</a> with some additional stuff I had to do:</p>
<p>1. Download the latest version of the &#8220;file&#8221; program from ftp://ftp.astron.com/pub/file/ (my case the current is 5.03)<br />
2. Unzip/untar the file<br />
3. Configure and run make:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d file<span class="nu0">-5.03</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf file<span class="nu0">-5.03</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> file<span class="nu0">-5.03</span><br />
./configure &#8211;<span class="re2">prefix=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span><br />
<span class="kw2">gmake</span><br />
<span class="kw2">su</span> &#8211; root -c <span class="st0">&quot;gmake install&quot;</span></div>
</div>
<p>3. There are a bunch of other requirements for mediatomb, the easiest way to get them is to use www.blastwave.org. The packages that I installed are:<br />
 CSWbdb4<br />
 CSWbzip2<br />
 CSWcurl<br />
 CSWcurlrt<br />
 CSWexpat<br />
 CSWfaac<br />
 CSWfaad2<br />
 CSWfconfig<br />
 CSWffmpeg<br />
 CSWffmpeglib<br />
 CSWftype2<br />
 CSWgcc3corert<br />
 CSWgcc3g++rt<br />
 CSWgcrypt<br />
 CSWggettext<br />
 CSWgpgerr<br />
 CSWiconv<br />
 CSWid3lib<br />
 CSWimlib2<br />
 CSWisaexec<br />
 CSWlame<br />
 CSWliba52<br />
 CSWlibid3tag<br />
 CSWlibidn<br />
 CSWlibnet<br />
 CSWlibogg<br />
 CSWlibsdl<br />
 CSWlibssh2<br />
 CSWlibtool<br />
 CSWlibtoolrt<br />
 CSWlibx11<br />
 CSWlibxau<br />
 CSWlibxcb<br />
 CSWlibxdmcp<br />
 CSWncurses<br />
 CSWoldaprt<br />
 CSWossl<br />
 CSWossldevel<br />
 CSWosslrt<br />
 CSWosslutils<br />
 CSWpixman<br />
 CSWpng<br />
 CSWsasl<br />
 CSWsdlmixer<br />
 CSWsqlite3<br />
 CSWsqlite3dev<br />
 CSWstl4<br />
 CSWsunmath<br />
 CSWtaglibgcc<br />
 CSWtheora<br />
 CSWtiff<br />
 CSWungif<br />
 CSWvorbis<br />
 CSWxvid<br />
 CSWzlib</p>
<p>4. Once these are installed, you can download mediatomb and compile it. <a href="http://mediatomb.cc/pages/download">http://mediatomb.cc/pages/download</a></p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span><br />
./configure &#8211;<span class="re2">prefix=</span>/mediatomb &#8211;enable-iconv-lib &#8211;with-iconv-<span class="re2">h=</span>/opt/csw/include &#8211;with-iconv-<span class="re2">libs=</span>/opt/csw/lib &#8211;enable-libmagic &#8211;with-magic-<span class="re2">h=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/include &#8211;with-magic-<span class="re2">libs=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/lib &#8211;with-taglib-<span class="re2">cfg=</span>/opt/csw/bin/taglib-config &#8211;with-curl-<span class="re2">cfg=</span>/opt/csw/bin/curl-config &#8211;with-sqlite3-<span class="re2">libs=</span>/opt/csw/lib &#8211;with-sqlite3-<span class="re2">h=</span>/opt/csw/include &#8211;with-<span class="re2">search=</span>/opt/csw &#8211;with-id3lib-<span class="re2">h=</span>/opt/csw/include &#8211;with-id3-<span class="re2">libs=</span>/opt/csw/lib<br />
<span class="kw2">gmake</span></div>
</div>
<p>However before you can run gmake, you need to edit a couple of files. One is the src/main.cc, you need to comment out lines 128 through 141. This is not needed for Solaris. The second file to edit is a result of this:</p>
<p>During the compile I got an error that looked like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">../src/url.<span class="kw2">cc</span>:<span class="nu0">78</span>:<span class="nu0">53</span>: macro <span class="st0">&quot;curl_easy_setopt&quot;</span> requires <span class="nu0">3</span> arguments, but only <span class="nu0">2</span> given<br />
../src/url.<span class="kw2">cc</span>: In member <span class="kw1">function</span> `zmm::Ref&lt;zmm ::StringBuffer&gt; URL::download<span class="br0">&#40;</span>zmm::String, long int*, CURL*, bool, bool, bool<span class="br0">&#41;</span><span class="st0">&#8216;:<br />
../src/url.cc:78: warning: statement is a reference, not call, to function `curl_easy_setopt&#8217;</span></div>
</div>
<p>To fix it edit the src/url.cc file and on line 78 change it from this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">curl_easy_setopt<span class="br0">&#40;</span>curl_handle, CURLOPT_NOBODY<span class="br0">&#41;</span>;</div>
</div>
<p>to this :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">curl_easy_setopt<span class="br0">&#40;</span>curl_handle, CURLOPT_NOBODY, <span class="nu0">1</span><span class="br0">&#41;</span>;</div>
</div>
<p>Then rerun gmake . Once the compile is finished, su to root and do a gmake install, it will place all the media tomb stuff in /mediatomb. (I am using a Zone on a Solaris 10 machine so / has plenty of space).</p>
<p>I then created a user for mediatomb to be run under, so a user and group called mediatmb were created, and all the /mediatomb directories and files were changed to be owned by mediatmb</p>
<p>Once that was done, login as the mediatmb user and create a script in /mediatmb/bin with the following in it:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">LD_LIBRARY_PATH=</span>/opt/csw/lib:/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/lib:/usr/sfw/lib<br />
<span class="kw3">export</span> LD_LIBRARY_PATH<br />
./mediatomb &#8211;ip x.x.x.x &#8211;port <span class="nu0">49194</span> &#8211;daemon &#8211;pidfile /tmp/mediatomb.pid &#8211;<span class="re2">logfile=</span>/tmp/mediatomb.log</div>
</div>
<p>where x.x.x.x is the IP address of the machine you are running it on. In Constantin&#8217;s blog, he mentioned also using the interface, but I found that it had problems since this was a zone. So instead of using the interface, I used the IP address of the zone.</p>
<p>The changes I made to the config.xml in the ~/.mediatomb directory are as follows:</p>
<div class="codesnip-container" >-bash-3.00$ diff orig-config.xml config.xml<br />
6a7<br />
&gt;       &lt;account user=&#8221;unixwiz&#8221; password=&#8221;video&#8221;/&gt;<br />
23c24<br />
&lt; &lt;protocolInfo extend=&#8221;no&#8221;/&gt;&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;<br />
&#8212;<br />
&gt;     &lt;protocolinfo extend=&#8221;yes&#8221;/&gt;&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;<br />
44a46<br />
&gt;     &lt;magic -file&gt;/usr/local/file/share/misc/magic.mgc&lt;/magic&gt;<br />
46a49,50<br />
&gt;       &lt;map from=&#8221;mpg&#8221; to=&#8221;video/mpeg&#8221;/&gt;<br />
&gt;       &lt;map from=&#8221;JPG&#8221; to=&#8221;image/jpeg&#8221;/&gt;<br />
61c65<br />
&lt; &lt;!&#8211; &lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt; &#8211;&gt;<br />
&#8212;<br />
&gt;         &lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt;</div>
<p>Now all you have to do is login to the web interface and add the media, following mediatomb&#8217;s documentation.</p>
<p>Some interesting things I have found with it:</p>
<p>1. If your PS3 is on wireless it may have problems streaming mp4, but not mpeg2. Weird I know as the mpeg2 was solid streaming at 370kb/s, but it couldn&#8217;t handle the mp4. Switching to a hardwired connection fixed that problem.</p>
<p>2. If you happen to be a ReplayTV user [cause TiVO is a wanna be replay <img src='http://blogs.sungeek.net/unixwiz/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ] you can use MediaTomb in conjunction with <a href="http://dvarchive.org/">DVArchive</a>, which also runs nicely in my Solaris zone. Just point a media directory at the Local_Guide directory and mediatomb will stream every MPEG2 file in that directory to your PS3. Which is pretty damn cool.</p>
<p>3. The PS3 is very pickly about it&#8217;s mp4 type files. Some that I made with <a href="http://handbrake.fr/">handbrake</a> don&#8217;t work, but ones I did with <a href="http://www.ffmpegx.com/">ffmpegx</a> worked once I put the hardwired connection in. </p>
<p>4. I have not tried any of the transcoding stuff. I would rather do that before and not bog down my server doing that.</p>
<p>5. I need to do a lot of reading on how to make folders and the such so that my collection is organized and not just all under one directory.</p>
<p>For those interested:<br />
My compile environment is setup like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">PATH=</span>/bin:/sbin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/ccs/bin:/usr/<span class="kw3">local</span>/bin:/opt/csw/bin<br />
<span class="re2">SHELL=</span>/bin/tcsh</div>
</div>
<p></zmm></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Solaris on a large harddrive</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/06/12/installing-solaris-on-a-large-harddrive/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/06/12/installing-solaris-on-a-large-harddrive/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 02:11:34 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[big disk]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1138</guid>
		<description><![CDATA[Because of the storms a couple of weeks ago, the harddrives in my one solaris box had failed. I bought a couple of new 500gb harddrives to replace the 80 that was in it. So I downloaded the newest update of Solaris 10 (update 7) and did the install. Everything worked perfect, then it rebooted. [...]]]></description>
			<content:encoded><![CDATA[<p>Because of the storms a couple of weeks ago, the harddrives in my one solaris box had failed. I bought a couple of new 500gb harddrives to replace the 80 that was in it. So I downloaded the newest update of Solaris 10 (update 7) and did the install. Everything worked perfect, then it rebooted. All I got was the &#8220;grub>&#8221; prompt. Nothing would let me boot it. I booted back off of the cdrom and updated the boot-archive, everything seemed fine, but it still would not boot off of the harddrive. So I tried to do it by hand at the grub> prompt:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">grub&gt; kernel /platform/i86pc/multiboot<br />
Error <span class="nu0">18</span>: selected cylinder exceeds maximum supported by bios</div>
</div>
<p>Great.. now what. It appears that you have to have the boot info in the first 1023 cylinders of the harddrive. Well this big 500GB harddrive has over 60,000+ cylinders on it. Guess what, the Solaris installer put the swap on 3-263 and then put the root on 58884 &#8211; some high number.. So obviously grub is going to have a problem. </p>
<p>So how do you fix this. There is 2 possible ways that I can think of and possibly a third.  </p>
<p>The first would be for Sun to change the installer to not automatically place root at the end of the disk. </p>
<p>The second is when you are getting ready to do the install, pre-layout the disks using format from the command line. </p>
<p>The third is what I am trying, since the remaining of the disk has not been used yet, I am going to move the partitions around with dd. The first thing I did was delete the swap partition on slice 1. The second was to create a new temp partition on slice 3 that is the exact same size as slice 0. Now using dd I did the following:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">dd</span> <span class="re2">if=</span>/dev/dsk/c0d0s0 <span class="re2">of=</span>/dev/dsk/c0d0s3 <span class="re2">bs=</span>4096k</div>
</div>
<p>Hopefully this won&#8217;t take too long as the partition is only 15gb in size. You could have done the same thing with tar and have both partitions mounted. Once the dd finishes. I will delete the slice 0 and recreate it starting at cylinder 3 and give it the same size as it was before, and then dd the info back. Once that is done, delete the temp slice and recreate a swap partition. Hopefully this works.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/06/12/installing-solaris-on-a-large-harddrive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
