<?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/"
	xmlns:georss="http://www.georss.org/georss" >

<channel>
	<title>spiralbound.net &#187; Data and Technology</title>
	<atom:link href="http://spiralbound.net/category/data-technology/feed" rel="self" type="application/rss+xml" />
	<link>http://spiralbound.net</link>
	<description>my digital notebook</description>
	<lastBuildDate>Wed, 27 Jan 2010 02:24:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ZoneType.sh Version 2.0</title>
		<link>http://spiralbound.net/2010/01/26/zonetype-sh-version-2-0</link>
		<comments>http://spiralbound.net/2010/01/26/zonetype-sh-version-2-0#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:29:29 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[global zone]]></category>
		<category><![CDATA[local zone]]></category>
		<category><![CDATA[prtdiag]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris 10]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[zonetype.sh]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1316</guid>
		<description><![CDATA[We just started supporting Solaris 10 in our VMware cluster so I had to update my zone type script to detect if the OS is running there. I&#8217;m not sure how I feel about depending on the output of ptrdiag since the interface is labeled &#8220;unstable&#8221;, but it works for now, and I really don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>We just started supporting Solaris 10 in our VMware cluster so I had to update <a href="http://spiralbound.net/2009/03/03/script-to-determine-solaris-10-zone-type">my zone type script</a> to detect if the OS is running there. I&#8217;m not sure how I feel about depending on the output of <strong>ptrdiag</strong> since the interface is labeled &#8220;unstable&#8221;, but it works for now, and I really don&#8217;t see Sun changing the first line of output where the system configuration is listed. Anyhow, when issued with the -v or &#8211;vmware flag, the script returns 0 if it&#8217;s running on the cluster and 1 if it is not.</p>
<p>Usage:</p>
<p># zonetype.sh -g or &#8211;global<br />
Return 0: The machine is a global zone with 1 or more local zones<br />
Return 1: The machine is not a global zone</p>
<p># zonetype.sh -l or &#8211;local<br />
Return 0: The machine is a local zone<br />
Return 1: The machine is not a not a local zone</p>
<p># zonetype.sh -v or &#8211;vmware<br />
Return 0: The machine is running on a VMware hypervisor<br />
Return 1: The machine is not running in VMware</p>
<pre>
#! /bin/bash
#
# When issued with the -g or --global flag, this script will return:
# 0 if the machine is a global zone and has one or more local zones.
# Otherwise, it will return 1
#
# When issued with the -l or --local flag, this script will return:
# 0 if if is a local zone and 1 if it is not
#
# When issued with the -v or --vmware flag, this script will return:
# 0 if it is a vmware host and 1 if not.
#

list=( `/usr/sbin/zoneadm list -civ | awk '{ print $1 }'`)

  case "$1" in
    -g|--global)
        # If the third element in our array is null, set it to 0
        if [ "${list[2]}" == ""  ]; then
        list[2]=0
        fi
        # This is a global zone only if it has one or more local zones.
        if [ ${list[1]} -eq 0 ] &#038;&#038; [ ${list[2]} -ge 1 ]; then
        # 1 is returned if we have a global and local zone,
        # otherwise, we return 0
                exit 0
            else
                exit 1
        fi
              ;;
    -l|--local)
        # If the second element in our array is = or > 1, it is a local zone.
        if [ ${list[1]} -ge 1 ]; then
        # Return 1 if this is a local zone, otherwise return 0.
                exit 0
            else
                exit 1
        fi

              ;;
   -v|--vmware)
        # Don't run our check on local zones... Prtdiag can't run there
        if [ ${list[1]} != 0 ]; then
                exit 1
           else
                vmhost=( `/usr/sbin/prtdiag | grep System | awk '{ print $5 }'`)
                if [ $vmhost == VMware ]; then
                        #If the host is running on the vmware cluster return 0,
                        # otherwise, return 1
                        exit 0
                else
                        exit 1
                fi
        fi
              ;;
        *)
        echo "Usage: /local/adm/zonetype.sh {-l | --local | -g | --global | -v | --vmware}"
        exit 1
  esac
</pre>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2010/01/26/zonetype-sh-version-2-0/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Error: The data could not be converted to UTF-8</title>
		<link>http://spiralbound.net/2009/12/22/wp-error-the-data-could-not-be-converted-to-utf-8</link>
		<comments>http://spiralbound.net/2009/12/22/wp-error-the-data-could-not-be-converted-to-utf-8#comments</comments>
		<pubDate>Wed, 23 Dec 2009 01:27:23 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[coolstack]]></category>
		<category><![CDATA[iconv. mbstring]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[The data could not be converted to UTF-8]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1330</guid>
		<description><![CDATA[If you&#8217;ve just upgraded to WordPress 2.9 and you are now getting UTF 8 conversion errors on your dashboard, you&#8217;ll need to take a look at WordPress Trac Ticket #11219.

RSS Error: The data could not be converted to UTF-8

The bottom line is that you&#8217;ll need to enable either iconv or mbstring in your PHP configuration. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve just upgraded to WordPress 2.9 and you are now getting UTF 8 conversion errors on your dashboard, you&#8217;ll need to take a look at <a href="http://core.trac.wordpress.org/ticket/11219">WordPress Trac Ticket #11219</a>.<br />
<code><br />
RSS Error: The data could not be converted to UTF-8<br />
</code><br />
The bottom line is that you&#8217;ll need to enable either <a href="http://php.net/manual/en/book.iconv.php">iconv</a> or <a href="http://php.net/manual/en/book.mbstring.php">mbstring</a> in your PHP configuration. I&#8217;m using CoolStack on Solaris 10, so it was a simple matter of uncommenting the following lines from <code>/opt/coolstack/php5/lib/php.ini</code> and restarting apache. While you&#8217;re at it, may as well uncomment ctype as well since the new image uploader needs it.</p>
<p>Uncommnet the following lines in /opt/coolstack/php5/lib/php.ini.<br />
<code><br />
extension=iconv.so<br />
extension=mbstring.so<br />
extension=ctype.so<br />
</code></p>
<p>Finally, restart apache:<br />
<code><br />
svcadm restart apache22-csk<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/12/22/wp-error-the-data-could-not-be-converted-to-utf-8/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UNIX &#8211; Find Files that Changed Within Time Window</title>
		<link>http://spiralbound.net/2009/11/02/unix-find-files-that-changed-within-time-window</link>
		<comments>http://spiralbound.net/2009/11/02/unix-find-files-that-changed-within-time-window#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:57:56 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[newer]]></category>
		<category><![CDATA[posix]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=373</guid>
		<description><![CDATA[Every so often us lowly UNIX admins find ourselves needing to search a file system for files that have been created or changed within a certain time window. In other words, those files that are newer than time &#8220;X&#8221;, but not newer than time &#8220;Y&#8221;. There are a number of ways to accomplish this, but [...]]]></description>
			<content:encoded><![CDATA[<p>Every so often us lowly UNIX admins find ourselves needing to search a file system for files that have been created or changed within a certain time window. In other words, those files that are newer than time &#8220;X&#8221;, but not newer than time &#8220;Y&#8221;. There are a number of ways to accomplish this, but my preferred method is to create two reference files to indicate the beginning and end of my window and use the &#8220;-newer&#8221; and &#8220;! -newer&#8221; flags to search for files that changed within that window.<br />
<code><br />
# touch -amt 200910260000 /tmp/starttime<br />
# touch -amt 200910262359 /tmp/endtime<br />
# find / -type f -newer /tmp/starttime -a ! -newer /tmp/endtime<br />
</code><br />
The guys at  virtuelvis.com <a href="http://virtuelvis.com/archives/2008/10/finding-files-modified-on-a-certain-date">point out</a> that it is more elegant to accomplish this without creating two files, but their solution does not work with operating systems that use strict <a href="http://en.wikipedia.org/wiki/POSIX">POSIX</a> compliant &#8220;find&#8221; implementations, making it of little use in some cases. For the curious, here is their example:<br />
<code><br />
# find . -type f -newermt 2009-10-26 ! -newermt 2009-10-27<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/11/02/unix-find-files-that-changed-within-time-window/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Resources for the n00b</title>
		<link>http://spiralbound.net/2009/10/14/arduino-resources-for-the-n00b</link>
		<comments>http://spiralbound.net/2009/10/14/arduino-resources-for-the-n00b#comments</comments>
		<pubDate>Wed, 14 Oct 2009 21:08:16 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[Highlights]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1321</guid>
		<description><![CDATA[Lately I&#8217;ve been entertaining myself by building a rebreather loop controller using the Arduino micro controller. This little open source board is really nice to work with for a number of reasons. Unlike many of the alternatives which employ proprietary programming languages, the Arduino simply uses &#8220;C&#8221;. It also has an IDE that runs the [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been entertaining myself by building a rebreather loop controller using the <a href="http://www.arduino.cc/">Arduino</a> micro controller. This little open source board is really nice to work with for a number of reasons. Unlike many of the <a href="http://www.parallax.com/propeller/">alternatives</a> which employ proprietary programming languages, the Arduino simply uses &#8220;C&#8221;. It also has an IDE that runs the my Mac, and it enjoys an enormous development community.</p>
<p>I&#8217;m pretty new to this kind of thing, so I&#8217;ve been using web tutorials to work my way up from the most basic blinking LED to something that actually monitors oxygen sensors and populates an LCD with information. Some of the more valuable resources I have used are as follows:</p>
<ul>
<li><a href="http://www.ladyada.net/learn/arduino/lesson0.html">A really good five-part tutorial to get started</a></li>
<li><a href="http://www.arduino.cc/en/Tutorial/AnalogInput">A tutorial to get started with analog input</a></li>
<li><a href="http://www.arduino.cc/playground/Learning/SparkFunSerLCD">Guide to using serial LCD&#8217;s from Spark Fun Electronics</a></li>
<li><a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1172808516/1">A solution to some common problems with interupts</a></li>
<li><a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233535986/7">Some good examples of code using an LCD menu with three buttons</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/10/14/arduino-resources-for-the-n00b/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Useful MySQL Commands</title>
		<link>http://spiralbound.net/2009/04/30/useful-mysql-commands</link>
		<comments>http://spiralbound.net/2009/04/30/useful-mysql-commands#comments</comments>
		<pubDate>Fri, 01 May 2009 02:45:21 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[bootable]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database optomization]]></category>
		<category><![CDATA[database password]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqlcheck]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[root password]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh tunneling]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1221</guid>
		<description><![CDATA[There are a lot of usefully MySQL commands that I either don&#8217;t run enough to remember or just end up using some GUI to accomplish. Nothing against Navicat, but what kind of sysadmin would I be if I couldn&#8217;t do it at the command line as well. Anyhow, I had to do a bunch of [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of usefully MySQL commands that I either don&#8217;t run enough to remember or just end up using some GUI to accomplish. Nothing against Navicat, but what kind of sysadmin would I be if I couldn&#8217;t do it at the command line as well. Anyhow, I had to do a bunch of this kind of work lately, so I thought I would write the more common commands down here so I would have them to reference.</p>
<p>It is generally a good idea to firewall off your MySQL port (3306) unless you are on a secure network. The downside to this is that it prevents you from using GUI tools like Navicat to connect to your database server. No problem, just use this command to SSH tunnel a connection. After doing this, you can connect to your database on localhost port 8888:<br />
<code><br />
ssh -fNg -L 8888:127.0.0.1:3306 login@mysql-server<br />
</code></p>
<p>Once you have installed a new instance of MySQL, you have to change the root password:<br />
<code><br />
# mysql -u root<br />
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');<br />
mysql> SET PASSWORD FOR 'root'@'yourhostname' = PASSWORD('newpwd');<br />
mysql> exit<br />
</code></p>
<p>Depending on the way you handle your MySQL installation, you will most likely have to run the mysql_upgrade script after upgrades to use all the new features:<br />
<code><br />
mysql_upgrade -u root –password=yourpassword<br />
</code></p>
<p>Do a thorough check to see if your tables are corrupted:<br />
<code><br />
mysqlcheck -u root -p --check --extended --all-databases<br />
</code></p>
<p>Repair any corruption if it exists:<br />
<code><br />
mysqlcheck -u root -p --repair --all-databases<br />
</code></p>
<p>Look at all your tables and optomize them if necessary:<br />
<code><br />
mysqlcheck -u root -p --optimize --all-databases<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/04/30/useful-mysql-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to Determine Solaris 10 Zone Type</title>
		<link>http://spiralbound.net/2009/03/03/script-to-determine-solaris-10-zone-type</link>
		<comments>http://spiralbound.net/2009/03/03/script-to-determine-solaris-10-zone-type#comments</comments>
		<pubDate>Tue, 03 Mar 2009 22:46:27 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[global zone]]></category>
		<category><![CDATA[local zone]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[zoneadm]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1203</guid>
		<description><![CDATA[We use a lot of local zones in our Solaris 10 environment. We also use cfengine pretty heavily and there are some instances when we need to include or exclude certain automated tasks based on what type of zone we are working with. I wrote this little script that checks to see what type of [...]]]></description>
			<content:encoded><![CDATA[<p>We use a lot of local zones in our Solaris 10 environment. We also use cfengine pretty heavily and there are some instances when we need to include or exclude certain automated tasks based on what type of zone we are working with. I wrote this little script that checks to see what type of zone we are dealing with. Based on the return value, I can set a cfengine class and control what gets run and where.</p>
<ul>
<li>Return 0 if the machine is a global zone with 1 or more local zones</li>
<li>Return 1 if the machine is either a local zone or a global zone with 0 local zones</li>
</ul>
<pre>
#! /bin/bash
#
# When issued with the -g or --global flag, this script will return:
# 0 if the machine is a global zone and has one or more local zones.
# Otherwise, it will return 1
#
# Wen issued with the -l or --local flag, this script will return:
# 0 if if is a local zone and 1 if it is not
#

list=( `/usr/sbin/zoneadm list -civ | awk '{ print $1 }'`)
  case "$1" in
    -g|--global)
        # If the third element in our array is null, set it to 0
        if [ "${list[2]}" == ""  ]; then
        list[2]=0
        fi
        # This is a global zone only if it has one or more local zones.
        if [ ${list[1]} -eq 0 ] &#038;&#038; [ ${list[2]} -ge 1 ]; then
        # 1 is returned if we have a global and local zone, otherwise, we return 0
                exit 0
            else
                exit 1
        fi
              ;;
    -l|--local)
        # If the second element in our array is = or > 1, it is a local zone.
        if [ ${list[1]} -ge 1 ]; then
        # Return 1 if this is a local zone, otherwise return 0.
                exit 0
            else
                exit 1
        fi
              ;;
        *)
        echo "Usage: /local/adm/zonetype.sh {-l | --local | -g | --global}"
        exit 1
  esac
</pre>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/03/03/script-to-determine-solaris-10-zone-type/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Check Speed / Duplex on Solaris 10</title>
		<link>http://spiralbound.net/2009/03/02/check-speed-duplex-on-solaris-10</link>
		<comments>http://spiralbound.net/2009/03/02/check-speed-duplex-on-solaris-10#comments</comments>
		<pubDate>Mon, 02 Mar 2009 23:52:54 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[dladm]]></category>
		<category><![CDATA[duplex]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[link speed]]></category>
		<category><![CDATA[ndd]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1198</guid>
		<description><![CDATA[In the past, I always had to use the ndd &#8211; get command to figure out what my link speed and duplex settings were. In Solaris 10, Sun now gives us the handy dladm command, which makes it a whole lot easier. 

# dladm show-dev
e1000g2         link: up [...]]]></description>
			<content:encoded><![CDATA[<p>In the past, I always had to use the ndd &#8211; get command to figure out what my link speed and duplex settings were. In Solaris 10, Sun now gives us the handy dladm command, which makes it a whole lot easier. <br clear="left"/><br />
<code><br />
# dladm show-dev<br />
e1000g2         link: up        speed: 1000  Mbps       duplex: full<br />
e1000g3         link: up        speed: 1000  Mbps       duplex: full<br />
e1000g0         link: up        speed: 1000  Mbps       duplex: full<br />
e1000g1         link: up        speed: 1000  Mbps       duplex: full<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/03/02/check-speed-duplex-on-solaris-10/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Replace Failed SVM Mirror Drive</title>
		<link>http://spiralbound.net/2009/02/16/replace-failed-svm-mirror-drive</link>
		<comments>http://spiralbound.net/2009/02/16/replace-failed-svm-mirror-drive#comments</comments>
		<pubDate>Mon, 16 Feb 2009 05:45:42 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[cfgadm]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[disk suite]]></category>
		<category><![CDATA[failed drive]]></category>
		<category><![CDATA[metadb]]></category>
		<category><![CDATA[metareplace]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1141</guid>
		<description><![CDATA[So you have used SVM to mirror your disk, and one of the two drives fails. Aren&#8217;t you glad you mirrored them! You don&#8217;t have to do a restore from tape, but you are going have to replace the failed drive.
Many modern RAID arrays just require you to take out the bad drive and plug [...]]]></description>
			<content:encoded><![CDATA[<p>So you have used SVM to mirror your disk, and one of the two drives fails. Aren&#8217;t you glad you mirrored them! You don&#8217;t have to do a restore from tape, but you are going have to replace the failed drive.</p>
<p>Many modern RAID arrays just require you to take out the bad drive and plug in the new one, while everything else is taken care of automatically. It&#8217;s not quite that easy on a Sun server, but it&#8217;s really just a few simple steps.  I just had to do this, so I thought I would write down the procedure here.</p>
<p>Basically, the process boils down to the following steps:</p>
<ul>
<li>Detach the failed meta devices from the failed drive</li>
<li>Delete the meta devices from the failed drive</li>
<li>Delete the meta databases from the failed drive</li>
<li>Unconfigure the failed drive</li>
<li>Remove and replace the failed drive</li>
<li>Configure the new drive</li>
<li>Copy the remaining drive&#8217;s partition table to the new drive</li>
<li>Re-create the meta databases on the new drive</li>
<li>Install the bootblocks on the new drive</li>
<li>Recreate the meta devices</li>
<li>Attach the meta devices</li>
</ul>
<p>Let&#8217;s look at each step individually. In my case, c0t1d0 has failed, so, I detach all meta devices on that disk and then delete them:</p>
<p><code><br />
# metadetach -f d0 d2<br />
# metadetach -f d10 d12<br />
# metadetach -f d40 d42<br />
# metaclear d2<br />
# metaclear d12<br />
# metaclear d42<br />
</code></p>
<p>Next I take a look at the status of my meta databases. Below we can see the the replicas on that disk have write errors:</p>
<pre>
# metadb -i
        flags           first blk       block count
     a m  p  luo        16               8192            /dev/dsk/c0t0d0s3
     a    p  luo        8208             8192            /dev/dsk/c0t0d0s3
     W    p  luo        16                8192            /dev/dsk/c0t1d0s3
     W    p  luo        8208            8192            /dev/dsk/c0t1d0s3
 r - replica does not have device relocation information
 o - replica active prior to last mddb configuration change
 u - replica is up to date
 l - locator for this replica was read successfully
 c - replica's location was in /etc/lvm/mddb.cf
 p - replica's location was patched in kernel
 m - replica is master, this is replica selected as input
 W - replica has device write errors
 a - replica is active, commits are occurring to this replica
 M - replica had problem with master blocks
 D - replica had problem with data blocks
 F - replica had format problems
 S - replica is too small to hold current data base
 R - replica had device read errors
</pre>
<p>The replicas on c0t1d0s3 are dead to us, so let&#8217;s wipe them out!</p>
<p><code><br />
# metadb -d c0t1d0s3<br />
# metadb -i<br />
</code></p>
<pre>
        flags           first blk       block count
     a m  p  luo        16               8192            /dev/dsk/c0t0d0s3
     a    p  luo        8208             8192            /dev/dsk/c0t0d0s3
</pre>
<p>The only replicas we have left are on c0t0d0s3, so I&#8217;m all clear to unconfigure the device. I run cfgadm to get the c0 path:</p>
<p><code><br />
# cfgadm -al<br />
</code></p>
<pre>
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0                 disk         connected    configured   unknown
c0::dsk/c0t1d0                 disk         connected    configured   unknown
c0::dsk/c0t2d0                 disk         connected    configured   unknown
c0::dsk/c0t3d0                 disk         connected    configured   unknown
c1                             scsi-bus     connected    configured   unknown
c1::dsk/c1t0d0                 CD-ROM       connected    configured   unknown
usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb1/1.1                       unknown      empty        unconfigured ok
usb1/1.2                       unknown      empty        unconfigured ok
usb1/1.3                       unknown      empty        unconfigured ok
usb1/1.4                       unknown      empty        unconfigured ok
usb1/2                         unknown      empty        unconfigured ok
</pre>
<p>I run the following command to unconfigure the failed drive:</p>
<p><code><br />
# cfgadm -c unconfigure c0::dsk/c0t1d0<br />
</code></p>
<p>The drive light turns blue<br />
Pull the failed drive out<br />
Insert the new drive</p>
<p>Configure the new drive:</p>
<p><code><br />
# cfgadm -c configure c0::dsk/c0t1d0<br />
</code></p>
<p>Now that the drive is configured and visible from within the format command, we can copy the partition table from the remaining mirror member:</p>
<p><code><br />
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2<br />
</code></p>
<p>Next, I install the bootblocks onto the new drive:</p>
<p><code><br />
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s2<br />
</code></p>
<p>Create the state replicas:</p>
<p><code><br />
metadb -a -c 2 c0t1d0s3<br />
</code></p>
<p>Recreate the meta devices:<br />
<code><br />
metainit -f d2 1 1 c0t1d0s0<br />
metainit -f d12 1 1 c0t1d0s1<br />
metainit -f d42 1 1 c0t1d0s4<br />
</code></p>
<p>And finally, reattach the metadevices which will sync them up with the mirror.</p>
<p><code><br />
metattach d0 d2<br />
metattach d10 d12<br />
metattach d40 d42<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/02/16/replace-failed-svm-mirror-drive/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Happy 1234567890&#8242;th Second UNIX!</title>
		<link>http://spiralbound.net/2009/01/27/happy-1234567890-second-unix</link>
		<comments>http://spiralbound.net/2009/01/27/happy-1234567890-second-unix#comments</comments>
		<pubDate>Tue, 27 Jan 2009 19:31:24 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[1234567890]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[epoch]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[UNIX time]]></category>
		<category><![CDATA[UTC]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=1144</guid>
		<description><![CDATA[Today, Friday February 13, at 3:31 PM (PST), the UNIX time will read exactly 1234567890. So exacly what is all this excitement about UNIX being able to count to 10? Surely, the operating system that is slowly but steadily putting Microsoft out of business must be able to do that. Well, it&#8217;s actually the UNIX [...]]]></description>
			<content:encoded><![CDATA[<p>Today, Friday February 13, at 3:31 PM (PST), the UNIX time will read exactly 1234567890. So exacly what is all this excitement about UNIX being able to count to 10? Surely, the operating system that is slowly but steadily <a href="http://www.talkibie.com/technology/606/">putting Microsoft out of business</a> must be able to do that. Well, it&#8217;s actually the UNIX time stamp, and what has all of us nerds talking is really just the fact that the numbers have never lined up in sequence like this before.</p>
<p>So what the heck is this UNIX time anyhow? Well, simply put, it&#8217;s actually the exact number of seconds since the the Unix epoch. This was 00:00:00 UTC on January 1, 1970.</p>
<p>From <a href="http://en.wikipedia.org/wiki/Unix_time">Wikipedia</a>:</p>
<blockquote><p>
It is not a linear representation of time nor a true representation of UTC (though it is frequently mistaken for both) as the times it represents are UTC but it has no way of representing UTC leap seconds (e.g. 1998-12-31 23:59:60).
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2009/01/27/happy-1234567890-second-unix/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/gijoe-firealarm.mpg" length="1179652" type="video/mpeg" />
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/deep6-11.mpg" length="1472516" type="video/mpeg" />
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/gijoe-porksand.mpg" length="1947652" type="video/mpeg" />
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/gijoebodymassage.mov" length="1074176" type="video/quicktime" />
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/gijoe-reggae.mov" length="1801785" type="video/quicktime" />
<enclosure url="http://spiralbound.net/wp-content/uploads/2009/01/deep6-1.mpg" length="1472516" type="video/mpeg" />
		</item>
		<item>
		<title>Basic iptables Configuration</title>
		<link>http://spiralbound.net/2008/12/31/basic-iptables-configuration</link>
		<comments>http://spiralbound.net/2008/12/31/basic-iptables-configuration#comments</comments>
		<pubDate>Thu, 01 Jan 2009 00:05:54 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysl]]></category>
		<category><![CDATA[port forward]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=388</guid>
		<description><![CDATA[It&#8217;s always a good idea to setup a local firewall on hosts that are on unprotected networks. The internet &#8220;winds&#8221; blow harder and harder each day, and it&#8217;s only a matter of time before some daemon has an exploit that gets taken advantage of. I use CentOS 5 for all my web servers, and here [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always a good idea to setup a local firewall on hosts that are on unprotected networks. The internet &#8220;winds&#8221; blow harder and harder each day, and it&#8217;s only a matter of time before some daemon has an exploit that gets taken advantage of. I use <a href="http://centos.org">CentOS</a> 5 for all my web servers, and here is an example of the script I use to create a DEFAULT TO DENY set of firewall rules. This script generates a file called iptables in /etc/sysconfig.</p>
<p>I used to create a special rule for MySQL that only allowed connections from my own network, but lately I have been omitting this rule and <a href="http://spiralbound.net/2007/01/31/mysql-connection-over-an-ssl-tunnel">tunneling the connection through ssh instead</a>. That is why it is commented out in the script below.</p>
<p><code><br />
### SCRIPT ###<br />
#!/bin/sh<br />
# Drop all incoming traffic<br />
/sbin/iptables -P INPUT DROP<br />
# Drop all forwarded traffic<br />
/sbin/iptables -P FORWARD DROP<br />
# Allow all outgoing traffic<br />
/sbin/iptables -P OUTPUT ACCEPT<br />
# Allow returning packets<br />
/sbin/iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
# Allow incoming traffic on port 80 for web server<br />
/sbin/iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT<br />
# Allow MySQL only from a certain network<br />
/sbin/iptables -A INPUT -p tcp -m tcp -s XXX.XXX.XXX.0/24 --dport 3306 -j ACCEPT<br />
# Allow local traffic<br />
/sbin/iptables -A INPUT -i lo -j ACCEPT<br />
# Allow incoming SSH on port 22<br />
#/sbin/iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT<br />
# Allow ping<br />
/sbin/iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT<br />
/sbin/iptables-save > /etc/sysconfig/iptables<br />
chmod go-r /etc/sysconfig/iptables<br />
/sbin/sudo service iptables restart<br />
### /SCRIPT ###<br />
</code></p>
<p>Here is what /etc/sysconfig/iptables looks like after running this script:</p>
<p><code><br />
# Generated by iptables-save v1.3.5 on Wed Dec 31 13:47:40 2008<br />
*filter<br />
:INPUT DROP [0:0]<br />
:FORWARD DROP [0:0]<br />
:OUTPUT ACCEPT [12:8972]<br />
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT<br />
-A INPUT -i lo -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT<br />
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT<br />
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT<br />
-A INPUT -i lo -j ACCEPT<br />
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT<br />
COMMIT<br />
# Completed on Wed Dec 31 13:47:40 2008<br />
</code></p>
<p>After you are done, make sure you have iptables setup to start when the system boots.</p>
<p><code><br />
# /sbin/chkconfig --list | grep iptables</p>
<pre>iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off</pre>
<p></code></p>
<p>If it&#8217;s not on, just run:<br />
<code><br />
/sbin/chkconfig iptables on<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/12/31/basic-iptables-configuration/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install Solaris Package in Alternate Base Directory</title>
		<link>http://spiralbound.net/2008/12/28/install-solaris-package-in-alternate-base-directory</link>
		<comments>http://spiralbound.net/2008/12/28/install-solaris-package-in-alternate-base-directory#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:25:59 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[admin file]]></category>
		<category><![CDATA[basedir]]></category>
		<category><![CDATA[defaults]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[pkgadd]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=376</guid>
		<description><![CDATA[Unless you specify a different administrative file, the pkgadd command reads &#8220;/var/sadm/install/admin/default&#8221;, which specifies the base directory as &#8220;/opt&#8221;. Do not change the settings in this file, but rather create a custom admin file and enter an alternate &#8220;basedir&#8221; directive if you want to install your package into a different directory. We are going to [...]]]></description>
			<content:encoded><![CDATA[<p>Unless you specify a different administrative file, the pkgadd command reads &#8220;/var/sadm/install/admin/default&#8221;, which specifies the base directory as &#8220;/opt&#8221;. Do not change the settings in this file, but rather create a custom admin file and enter an alternate &#8220;basedir&#8221; directive if you want to install your package into a different directory. We are going to install our package into &#8220;/var/applications&#8221;, and call our custom admin file &#8220;custom&#8221;.</p>
<p>First, create and edit &#8220;/var/sadm/install/admin/custom&#8221;, adding a line similar to this:<br />
basedir=/var/applications/$PKGINST</p>
<p>Next, issue the pkgadd command with the &#8220;-a&#8221; flag to call you alternative admin file:</p>
<p>pkgadd -d device -a custom PackageName</p>
<p>This really comes in handy when your customers want to retain control over their packages, but you don&#8217;t want to give them access to write packages into the system area. More detailed instructions can be found <a href="http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch13/286-288.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/12/28/install-solaris-package-in-alternate-base-directory/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>World&#8217;s Coolest Datacenter</title>
		<link>http://spiralbound.net/2008/12/07/worlds-coolest-datacenter</link>
		<comments>http://spiralbound.net/2008/12/07/worlds-coolest-datacenter#comments</comments>
		<pubDate>Sun, 07 Dec 2008 23:10:11 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[Highlights]]></category>
		<category><![CDATA[bahnhof]]></category>
		<category><![CDATA[datacenter]]></category>
		<category><![CDATA[james bond]]></category>
		<category><![CDATA[pionen]]></category>
		<category><![CDATA[stockholm]]></category>
		<category><![CDATA[sweden]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[underground]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=310</guid>
		<description><![CDATA[Ever since coming to work at UC Santa Cruz, I have been feeling pretty lucky to work in a well engineered and managed datacenter. So lucky, in fact, that I&#8217;ve been cultivating hatred towards me in my former coworkers by regaling them with stories about how wonderfully designed everything is here. The problem with thinking [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since coming to work at <a href="http://its.ucsc.edu/core_tech/operations/">UC Santa Cruz</a>, I have been feeling pretty lucky to work in a well engineered and managed datacenter. So lucky, in fact, that I&#8217;ve been cultivating hatred towards me in my <a href="http://plymouth.edu/infotech/">former coworkers</a> by regaling them with stories about how wonderfully designed everything is here. The problem with thinking you have it made though, is that someone will always point out some greener grass in another field.</p>
<p>This is exactly what happened when I saw <a href="http://royal.pingdom.com/2008/11/14/the-worlds-most-super-designed-data-center-fit-for-a-james-bond-villain/">this article</a> about the <a href="http://www.bahnhof.se/colocation.php">Pionen datacenter</a>, owned by Bahnhof in Sweden. Located nearly 100 feet beneath the city of Stockholm, this epic datacenter has been compared (fairly I might add) to the secret layer of a James Bond villian. It&#8217;s got backup power provided by twin submarine engines, triple-redundant internet backbone connections, and can reportedly stand up to a Hydrogen bomb. We spend so much time and effort trying to make our servers comfortable when designing datacenters, we often forget about the Human element. Even though these guys are literally working in a cave, it&#8217;s nice to see that <a href="http://www.bahnhof.se/index.php">Bahnhof</a> is trying to make its people comfortable as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/12/07/worlds-coolest-datacenter/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bare Metal Linux Restore</title>
		<link>http://spiralbound.net/2008/08/05/bare-metal-linux-restore</link>
		<comments>http://spiralbound.net/2008/08/05/bare-metal-linux-restore#comments</comments>
		<pubDate>Tue, 05 Aug 2008 16:14:34 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[Highlights]]></category>
		<category><![CDATA[bare metal]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[RHEL4]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=344</guid>
		<description><![CDATA[Several weeks ago we started seeing some pretty scary errors showing up on the main system disk for our Blackboard server. We had an extra server hanging around, so we decided to move all the data off the failing disk and onto our spare server. The only question was how to make the new server [...]]]></description>
			<content:encoded><![CDATA[<p>Several weeks ago we started seeing some pretty scary errors showing up on the main system disk for our Blackboard server. We had an extra server hanging around, so we decided to move all the data off the failing disk and onto our spare server. The only question was how to make the new server as close to a perfect copy of the old one as possible. Simply restoring all the filesystems failed for a variety of reasons, mostly related to GRUB and the kernel, so I had to find a way of excluding only the files and directories that were tied to the specific model of server.</p>
<p>To do this, I started by installing a minimal copy of RHEL 4, making sure to lay the filesystems out in exactly the same way as they were on the old server. I then went through several experiments, leaving just the bare minimum files and directories required for the hardware and booting, but formatting all other filesystems and restoring the data from our old server. In the end, the below process resulted in system that worked perfectly, and very closely mirrored the original server.<br />
<span id="more-344"></span></p>
<ul>
<li>I conducted a minimal OS install on the new server, replicating the filesystem layout on the old server.</li>
<li>I booted the new server from DVD in rescue mode, allowing it to mount the filesystems in /mnt/sysimage</li>
<li>I removed EVERYTHING in every filesystem and directory EXCEPT the following:</li>
</ul>
<ul>
<li>Everything in /sys</li>
<li>Everything in /dev</li>
<li>Everything in /proc</li>
<li>Everything in /boot</li>
<li>/lib/modules</li>
<li>/etc/grub.conf</li>
<li>/etc/sysconficg/grub</li>
<li>/etc/modules.conf</li>
<li>/etc/fstab</li>
</ul>
<p>Next, I went to my backups and restored the entire system to /mnt/sysimage, making sure not to overwrite existing files. We use NetBackup, which defaults to not overwrite, but other systems are not so careful. If you accidentally overwrite the files we excluded from deletion above, your restored system will not boot.</p>
<p>Once the restore was complete, I rebooted the system and it came up pretty much as a carbon copy of the old server. Once it was up and on the network, I ran &#8220;up2date -uf&#8221; to install the latest version of the kernel and I was done.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/08/05/bare-metal-linux-restore/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Installing APC on CentOS</title>
		<link>http://spiralbound.net/2008/07/14/installing-apc-on-centos</link>
		<comments>http://spiralbound.net/2008/07/14/installing-apc-on-centos#comments</comments>
		<pubDate>Mon, 14 Jul 2008 19:06:12 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=324</guid>
		<description><![CDATA[Casey needed me to install APC cache for the Scriblio project. It&#8217;s a PECL module, and pecl install apc gives an error. Here are some great instructions for getting it all to work.
UPDATE: Casey actually has some instructions that provide a more elegant method of installing APC on CentOS or RHEL. Both methods will work, [...]]]></description>
			<content:encoded><![CDATA[<p>Casey needed me to install APC cache for the <a href="http://about.scriblio.net/">Scriblio project</a>. It&#8217;s a PECL module, and <code>pecl install apc</code> gives an error. <a href="http://www.agileapproach.com/blog-entry/howto-install-pecl-apc-cache-centos-without-xampp">Here are some great instructions</a> for getting it all to work.</p>
<p>UPDATE: Casey actually has <a href="http://maisonbisson.com/blog/post/12589/installing-php-apc-on-rhel-centos/">some instructions</a> that provide a more elegant method of installing APC on CentOS or RHEL. Both methods will work, but Casey&#8217;s instructions will get you around the package management problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/07/14/installing-apc-on-centos/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RMAN 10G NFS Mount Options</title>
		<link>http://spiralbound.net/2008/06/11/rman-10g-nfs-mount-options</link>
		<comments>http://spiralbound.net/2008/06/11/rman-10g-nfs-mount-options#comments</comments>
		<pubDate>Wed, 11 Jun 2008 15:51:18 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[10G]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[mount options]]></category>
		<category><![CDATA[mountpoint]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oralce 10G]]></category>
		<category><![CDATA[rman]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=323</guid>
		<description><![CDATA[We backup our Oracle databases using RMAN and then write the backup pieces out to an NFS share. This has always worked well, but RMAN started complaining that the NFS share was not mounted with the correct options when we upgraded to Oracle 10G. After some poking around in the docs I finally came up [...]]]></description>
			<content:encoded><![CDATA[<p>We backup our Oracle databases using RMAN and then write the backup pieces out to an NFS share. This has always worked well, but RMAN started complaining that the NFS share was not mounted with the correct options when we upgraded to Oracle 10G. After some poking around in the docs I finally came up with a set of mount options that work.</p>
<p>Vfstab entry on a Solaria 8 box:<br />
<code>nfsserver.domain.com:/path/to/remote/mountpoint  /local-mountpoint nfs 0 yes rw,bg,intr,hard,timeo=600,wsize=32768,rsize=32768</code><br />
Manual mount on a Solaris 8 box:<br />
<code>mount -o rw,bg,intr,hard,timeo=600,wsize=32768,rsize=32768 nfsserver.domain.com:/path/to/remote/mountpoint /local-mountpoint</code></p>
<p>According to the docs, the options on a Linux box are pretty much the same, except you would add the following:<br />
<code>nfsver=3,tcp</code></p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/06/11/rman-10g-nfs-mount-options/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Linux Partitions for CLARiiON</title>
		<link>http://spiralbound.net/2008/06/09/creating-linux-partitions-for-clariion</link>
		<comments>http://spiralbound.net/2008/06/09/creating-linux-partitions-for-clariion#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:50:39 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[alignment]]></category>
		<category><![CDATA[CLARiiON]]></category>
		<category><![CDATA[disk alignment]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[partition alignment]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[sector]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=322</guid>
		<description><![CDATA[Creating a properly offset slab of disk for Linux systems on your CLARiiON is not just a matter of creating a partition using the default fdisk values. The reason for this is that disk management utilities for Intel based systems generally write 63 sectors of metadata directly at the beginning of the LUN. The addressable [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a properly offset slab of disk for Linux systems on your CLARiiON is not just a matter of creating a partition using the default <code>fdisk</code> values. The reason for this is that disk management utilities for Intel based systems generally write 63 sectors of metadata directly at the beginning of the LUN. The addressable space begins immediately after these initial sectors causing the CLARiiON to cross disks, especially when writing larger IO because it doesn&#8217;t match up with the stripe element size (usually 64k).</p>
<p>To get around this, you have to align the partition in such a way that it will start writing data on a sector that will mesh up nicely with the stripe element size. In this case, 128. Below is an example of how I create partitions on our CLARiiON for Linux systems. Check out the <a href="http://www.virtual.com/whitepapers/EMC_Best_Practices_FC.pdf">EMC Best Practices for Fibre Chanel storage</a> white paper for more detail.</p>
<pre>
/sbin/fdisk /dev/emcpowera
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 39162.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-39162, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-39162, default 39162):
Using default value 39162

Command (m for help): x

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (63-629137529, default 63): 128

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/06/09/creating-linux-partitions-for-clariion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X11 Forwarding Broken on Solaris</title>
		<link>http://spiralbound.net/2008/06/03/x11-forwarding-broken-on-solaris</link>
		<comments>http://spiralbound.net/2008/06/03/x11-forwarding-broken-on-solaris#comments</comments>
		<pubDate>Tue, 03 Jun 2008 14:39:31 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[socfs]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[X11]]></category>
		<category><![CDATA[X11 forwarding]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=321</guid>
		<description><![CDATA[If you&#8217;re running Solaris 8 or 9 and an upgrade results in broken SSH X11 forwarding, the problem may be Sun&#8217;s socfs bug. The symptom will be SSH&#8217;s failure to set the $DISPLAY variable and an error in your system log looking something like this:

Jun  3 09:40:24 servername sshd[26432]: [ID 800057 auth.error] error: Failed [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running Solaris 8 or 9 and an upgrade results in broken SSH X11 forwarding, the problem may be <a href="http://sunsolve.sun.com/search/document.do?assetkey=1-26-101834-1">Sun&#8217;s socfs bug</a>. The symptom will be SSH&#8217;s failure to set the <code>$DISPLAY</code> variable and an error in your system log looking something like this:<br />
<br clear="left" /></p>
<p><code>Jun  3 09:40:24 servername sshd[26432]: [ID 800057 auth.error] error: Failed to allocate internet-domain X11 display socket.</code></p>
<p>To fix this, you can either install Sun&#8217;s latest socfs patch for your version of the OS, or simply force sshd into IPv4 mode by doing the following:</p>
<p>Edit you sshd_config file, adding the following:<br />
<code><br />
# IPv4 only<br />
ListenAddress 0.0.0.0<br />
</code></p>
<p>Edit your sshd startup script to issue a &#8220;-4&#8243; to sshd on start:<br />
<code><br />
case "$1" in<br />
'start')<br />
echo 'starting ssh daemon'<br />
/usr/local/sbin/sshd -4<br />
;;<br />
</code></p>
<p>Restart sshd, and that should pretty much do it&#8230; Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/06/03/x11-forwarding-broken-on-solaris/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>VMware ESX 3.5 ntpdate strangeness</title>
		<link>http://spiralbound.net/2008/04/09/vmware-esx-35-ntpdate-strangeness</link>
		<comments>http://spiralbound.net/2008/04/09/vmware-esx-35-ntpdate-strangeness#comments</comments>
		<pubDate>Wed, 09 Apr 2008 14:07:50 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[esx. esx server]]></category>
		<category><![CDATA[firewall esxcfg-firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[nptdate]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[ntpClient]]></category>
		<category><![CDATA[ntpd]]></category>
		<category><![CDATA[outbound UDP]]></category>
		<category><![CDATA[port 123]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[time servr]]></category>
		<category><![CDATA[udp]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://spiralbound.net/?p=319</guid>
		<description><![CDATA[We just noticed that the time was very far off on our sparkly new VMware EXS 3.5 server. When I went to run ntpdate to bring it up to sync, I was suprised to find that it could not make a connection to the time server because outbound UDP 123 traffic was blocked by the [...]]]></description>
			<content:encoded><![CDATA[<p>We just noticed that the time was very far off on our sparkly new VMware EXS 3.5 server. When I went to run ntpdate to bring it up to sync, I was suprised to find that it could not make a connection to the time server because outbound UDP 123 traffic was blocked by the internal firewall. Here is what I got:<br />
<br clear="let" /></p>
<p># /usr/sbin/ntpdate -u time.nist.gov<br />
 9 Apr 03:47:53 ntpdate[20245]: sendto(192.43.244.18): Operation not permitted<br />
 9 Apr 03:47:54 ntpdate[20245]: sendto(192.43.244.18): Operation not permitted<br />
 9 Apr 03:47:55 ntpdate[20245]: sendto(192.43.244.18): Operation not permitted<br />
 9 Apr 03:47:56 ntpdate[20245]: sendto(192.43.244.18): Operation not permitted<br />
 9 Apr 03:47:57 ntpdate[20245]: no server suitable for synchronization found</p>
<p>Normally I would just add a rule to the &#8220;/etc/sysconfig/iptables&#8221; file to allow traffic out on this port, but Vmware ESX server does not use iptables&#8230; It uses its own firewall, so I had to figure out how to change it. Happily, it turns out that there is a handy &#8220;esxcfg-firewall&#8221; command built just for such things.</p>
<p>Running this:<br />
/usr/sbin/esxcfg-firewall -q | grep 123</p>
<pre>12300 1803K valid-tcp-flags  tcp  --  *   *     0.0.0.0/0        0.0.0.0/0</pre>
<p>Confirmed that UDP port 123 outbound was disallowed.</p>
<p>Running this opened it up:<br />
/usr/sbin/esxcfg-firewall -e ntpClient</p>
<p>Grep out &#8220;123&#8243; again just to be sure:<br />
/usr/sbin/esxcfg-firewall -q | grep 123</p>
<pre>1  76 ACCEPT  udp  --  *    *    0.0.0.0/0      0.0.0.0/0     udp dpt:123</pre>
<p>And you can now run ntpdate to sync up the time:<br />
/usr/sbin/ntpdate -u time.nist.gov</p>
<pre>9 Apr 09:52:54 ntpdate[20319]: step time server 192.43.244.18 offset 21689.039217 sec</pre>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/04/09/vmware-esx-35-ntpdate-strangeness/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL System Configuration Changes for Oracle 10G</title>
		<link>http://spiralbound.net/2008/03/17/rhel-system-configuration-changes-for-oracle-10g</link>
		<comments>http://spiralbound.net/2008/03/17/rhel-system-configuration-changes-for-oracle-10g#comments</comments>
		<pubDate>Mon, 17 Mar 2008 17:25:12 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[10G]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[preinstall]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2008/03/17/rhel-system-configuration-changes-for-oracle-10g</guid>
		<description><![CDATA[Below is a list of RHEL system configuration changes that Oracle 10G requires before  it is installed.
First, check the following kernel parameters using the commands below:



/sbin/sysctl -a &#124; grep kernel.shmall
/sbin/sysctl -a &#124; grep kernel.shmmax
/sbin/sysctl -a &#124; grep kernel.shmmni
/sbin/sysctl -a &#124; grep kernel.sem
/sbin/sysctl -a &#124; grep fs.file-max
/sbin/sysctl -a &#124; grep net.ipv4.ip_local_port_range
/sbin/sysctl -a &#124; grep net.core.rmem_default
/sbin/sysctl [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a list of RHEL system configuration changes that Oracle 10G requires before  it is installed.</p>
<p>First, check the following kernel parameters using the commands below:<br />
<br clear="left" /><br />
<code>
<pre>
/sbin/sysctl -a | grep kernel.shmall
/sbin/sysctl -a | grep kernel.shmmax
/sbin/sysctl -a | grep kernel.shmmni
/sbin/sysctl -a | grep kernel.sem
/sbin/sysctl -a | grep fs.file-max
/sbin/sysctl -a | grep net.ipv4.ip_local_port_range
/sbin/sysctl -a | grep net.core.rmem_default
/sbin/sysctl -a | grep net.core.rmem_max
/sbin/sysctl -a | grep net.core.wmem_default
/sbin/sysctl -a | grep net.core.wmem_max
</pre>
<p></code></p>
<p>If any parameters are lower than the examples below, you will have to increase them by editing &#8220;<strong>/etc/sysctl.conf</strong>&#8221; file, adding the appropriate lines as expressed below. If the current value is higher, leave it as is.<br />
<code>
<pre>
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
</pre>
<p></code></p>
<p>Next, edit your &#8220;<strong>/etc/security/limits.conf</strong>&#8221; file, adding the following lines:<br />
<code>
<pre>
oracle          soft    nproc           2047
oracle          hard    nproc           16384
oracle          soft    nofile          1024
oracle          hard    nofile          65536
</pre>
<p></code></p>
<p>If your current &#8220;/etc/pam.d/login&#8221; file does not already contain the following line, add it:</p>
<p><code>
<pre>
session    required     pam_limits.so
</pre>
<p>Finally, add the following lines to your "<strong>/etc/profile</strong>" file:</p>
<p></code><code>
<pre>
#Tweaks for Oracle
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
fi
</pre>
<p></code></p>
<p>These are just the basic steps I take. See the &#8220;Oracle Database Installation Guide&#8221; for more complete instructions.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/03/17/rhel-system-configuration-changes-for-oracle-10g/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When Mac OSX SMB Connections Fail</title>
		<link>http://spiralbound.net/2008/03/14/when-mac-osx-smb-connections-fail</link>
		<comments>http://spiralbound.net/2008/03/14/when-mac-osx-smb-connections-fail#comments</comments>
		<pubDate>Fri, 14 Mar 2008 19:02:15 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[datagram pinwheel]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[name service]]></category>
		<category><![CDATA[netbios]]></category>
		<category><![CDATA[nmb]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[smb]]></category>
		<category><![CDATA[smbclient]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[udp]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2008/03/14/when-mac-osx-smb-connections-fail</guid>
		<description><![CDATA[Earlier today I had a problem with some Macs that could not establish SMB connections to our Windows File Server. There was no quick error, so the problem really &#8220;felt&#8221; like a firewall issue but strangely I was able to make a CLI connection to the file server using smbclient:

smbclient //server/share -U domain/username
Password:*******
Domain=[DOMAIN] OS=[Windows Server [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today I had a problem with some Macs that could not establish SMB connections to our Windows File Server. There was no quick error, so the problem really &#8220;felt&#8221; like a firewall issue but strangely I was able to make a CLI connection to the file server using smbclient:<br />
<br clear="left" /><br />
<code>smbclient //server/share -U domain/username<br />
Password:*******<br />
Domain=[DOMAIN] OS=[Windows Server x] Server=[Windows Server x]<br />
smb: \> exit<br />
</code></p>
<p>I started thinking that perhaps the Mac was doing NETBIOS name lookups and that <code>nmbd</code> might be knocking on the firewall. Turns out this was the problem. Opening up the following ports on the Windows File Server did the trick:</p>
<p>SMB uses ports:<br />
UDP 137 (NETBIOS Name Service)<br />
UDP 138 (NETBIOS Datagram Service)<br />
TCP/UDP 139 (NETBIOS Session Service)</p>
<p>WARNING: Only open these ports to your trusted networks. Statistical data indicates that UDP ports 135 &#8211; 139 and TCP port 137 &#8211; 139 are amongst the most commonly scanned ports on remote computers.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/03/14/when-mac-osx-smb-connections-fail/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Project Blackbox &#8211; Datacenter in a Can</title>
		<link>http://spiralbound.net/2008/02/26/sun-project-blackbox-datacenter-in-a-can</link>
		<comments>http://spiralbound.net/2008/02/26/sun-project-blackbox-datacenter-in-a-can#comments</comments>
		<pubDate>Tue, 26 Feb 2008 21:16:39 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[air conditioning]]></category>
		<category><![CDATA[blackbox]]></category>
		<category><![CDATA[cooling]]></category>
		<category><![CDATA[datacenter]]></category>
		<category><![CDATA[earthquake]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[it department]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[redundant]]></category>
		<category><![CDATA[shipping container]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2008/02/26/sun-project-blackbox-datacenter-in-a-can</guid>
		<description><![CDATA[Lots of small companies want to hire an IT department in a can&#8230; You know, the ones who hire only one person to run their Linux servers, code their websites, architect their networks, support their users and order more printer toner. It&#8217;s a hard job, but it&#8217;s pretty common to see them advertised. What I [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of small companies want to hire an IT department in a can&#8230; You know, the ones who hire only one person to run their Linux servers, code their websites, architect their networks, support their users and order more printer toner. It&#8217;s a hard job, but it&#8217;s pretty common to see them advertised. What I never dreamed I would see is an entire data center in a can&#8230; Literally, in a can&#8230; Or at least a shipping container, which is really not that far off.</p>
<p>Leave it to Sun though. Not only have they packed an <a href="http://www.sun.com/products/sunmd/s20/index.jsp">entire datacenter into a shipping container</a>, they have packed a really good datacenter into a shipping container. Complete with integrated power, cooling, fire suppression, cable managment and redundant everything, this little <a href="http://www.sun.com/products/sunmd/s20/features.jsp">server room-in-a-box has it all</a>. They even showed off how tough it is by <a href="http://www.sun.com/products/sunmd/s20/gallery/index.xml?p=2&#038;s=1">putting it through an earthquake</a>!  </p>
<p>All told, I really like the idea of my brand new datacenter rolling in on the back of a tractor-trailer truck. It kinda reminds me of the setup the bad guys had in latest Die Hard movie. I just hope nobody buys one and hires only one person to run it.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/02/26/sun-project-blackbox-datacenter-in-a-can/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RHEL3 Upgrade to RHEL4 Breaks up2date</title>
		<link>http://spiralbound.net/2008/01/22/rhel3-upgrade-to-rhel4-breaks-up2date</link>
		<comments>http://spiralbound.net/2008/01/22/rhel3-upgrade-to-rhel4-breaks-up2date#comments</comments>
		<pubDate>Tue, 22 Jan 2008 15:03:19 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[broken]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[REHL3]]></category>
		<category><![CDATA[RHEL4]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[rpm -e --nodeps]]></category>
		<category><![CDATA[up2date]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2008/01/22/rhel3-upgrade-to-rhel4-breaks-up2date</guid>
		<description><![CDATA[Last week I had to upgrade one of our old RHEL3 servers in order to get it to address disks larger than 2TB. I did the upgrade from CD, and it went fairly smoothly, except up2date would not run after the box came back up.
It gave me the following error:
[root@x up2date]# Traceback (most recent call [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I had to upgrade one of our old RHEL3 servers in order to get it to address disks larger than 2TB. I did the upgrade from CD, and it went fairly smoothly, except <code>up2date</code> would not run after the box came back up.</p>
<p>It gave me the following error:</p>
<pre><code>[root@x up2date]# Traceback (most recent call last):
  File "/usr/sbin/up2date", line 27, in ?
    from up2date_client import repoDirector
  File "/usr/share/rhn/up2date_client/repoDirector.py", line 5, in ?
    import rhnChannel
  File "/usr/share/rhn/up2date_client/rhnChannel.py", line 10, in ?
    import up2dateAuth
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 5, in ?
    import rpcServer
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 23, in ?
    from rhn import rpclib
ImportError: No module named rhn</code></pre>
<p>It turns out that there is no &#8220;really easy&#8221; way to fix it, but <a href="http://spacepants.org/blog/up2date-still-in-beta">these directions on spaceblog do work</a>. Basically it involves removing a lot of packages and re-adding them. The problem is related to python, so rather than remove the <a href="http://spacepants.org/blog/up2date-still-in-beta">entire list</a> of packages, I focused only on those relating to python and up2date:</p>
<p><code><br />
libxml2-python<br />
popt<br />
pyOpenSSL<br />
python<br />
rhnlib<br />
rhpl<br />
up2date<br />
</code></p>
<p>Make sure not to remove these packages:</p>
<p><code><br />
rpm<br />
rpm-libs<br />
rpm-python<br />
</code></p>
<p>Or you will break <code>rpm</code> and not be able to add the packages back after you remove them. All told, this is a grisly process, and you will have to use <code>rpm -e --nodeps</code> in order to get it done. This sucks, but up2date will work everything out once you can get it running again.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/01/22/rhel3-upgrade-to-rhel4-breaks-up2date/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Make Gnarly Big Linux Filesystems</title>
		<link>http://spiralbound.net/2008/01/11/how-to-make-gnarly-big-linux-filesystems</link>
		<comments>http://spiralbound.net/2008/01/11/how-to-make-gnarly-big-linux-filesystems#comments</comments>
		<pubDate>Fri, 11 Jan 2008 15:48:41 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mkfs]]></category>
		<category><![CDATA[parted]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2008/01/11/how-to-make-gnarly-big-linux-filesystems</guid>
		<description><![CDATA[At least in RHEL 4, the fdisk command does not support the creation of filesystems larger than 2TB. In order to get around it, you have to use the parted command. I found the basic info here, but this is the long and short of how to cut off a big ol&#8217; slice of disk [...]]]></description>
			<content:encoded><![CDATA[<p>At least in RHEL 4, the <code>fdisk</code> command does not support the creation of filesystems larger than 2TB. In order to get around it, you have to use the <code>parted</code> command. I found the basic info <a href="http://www.knowplace.org/pages/howtos/linux_large_filesystems_support.php">here</a>, but this is the long and short of how to cut off a big ol&#8217; slice of disk using <code>parted</code>:</p>
<p>Run <code>parted</code></p>
<p><code># /sbin/parted</code></p>
<p>It&#8217;s interactive, so the following commands are issued within the utility.</p>
<p>1) Make the disk label</p>
<p><code>(parted) mklabel gpt</code></p>
<p>2) Create the partition</p>
<p><code>(parted) mkpart primary 0 -1</code></p>
<p>3) Verify</p>
<p><code>(parted) print</code></p>
<pre><code>
Disk geometry for /dev/sda: 0.000-38146.972 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975  38146.530  primary               lvm
</code></pre>
<p>4) Exit the GNU Parted command shell</p>
<p><code>(parted) quit</code></p>
<p>5) Finally, make the filesystem:</p>
<p><code># mkfs.ext3 -m0 -F /dev/sdb1</code></p>
<p>6)Finally, you don&#8217;t want to wait for that big filesystem to fsck from time to time, so make sure it does not get checked unless you run the command yourself:</p>
<p><code># tune2fs -c0 -i0 /dev/sdb1</code></p>
<p>That should just about do it. Remember that only RHEL 4 and higher can support filesystems larger than 2TB. If I remember correctly RHEL 3 can go up to 2TB, RHEL4 can handle 8TB, and RHEL 5 can make a whopping 16TB chunk of disk. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2008/01/11/how-to-make-gnarly-big-linux-filesystems/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Strange X11 Forwarding Problem</title>
		<link>http://spiralbound.net/2007/12/17/strange-x11-forwarding-problem</link>
		<comments>http://spiralbound.net/2007/12/17/strange-x11-forwarding-problem#comments</comments>
		<pubDate>Mon, 17 Dec 2007 20:33:43 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[forward]]></category>
		<category><![CDATA[full]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rejected]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[wrong authentication]]></category>
		<category><![CDATA[X11]]></category>
		<category><![CDATA[XWindows]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2007/12/17/strange-x11-forwarding-problem</guid>
		<description><![CDATA[I started getting this error:
X11 connection rejected because of wrong authentication
when trying to forward X11 applications from a Linux server to my Mac. I had been forwarding the display on this server for years, so I was a little unsure what could be causing it. In the end, it turned out that I had filled [...]]]></description>
			<content:encoded><![CDATA[<p>I started getting this error:<br />
<code>X11 connection rejected because of wrong authentication</code><br />
when trying to forward X11 applications from a Linux server to my Mac. I had been forwarding the display on this server for years, so I was a little unsure what could be causing it. In the end, it turned out that I had filled up /var, and X11 could not write to &#8220;/var/log/XFree86.0.log&#8221;. It was an easy fix, but the error was certainly no help.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2007/12/17/strange-x11-forwarding-problem/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and Sed for String Substitution</title>
		<link>http://spiralbound.net/2007/12/12/php-and-sed-for-string-substitution</link>
		<comments>http://spiralbound.net/2007/12/12/php-and-sed-for-string-substitution#comments</comments>
		<pubDate>Wed, 12 Dec 2007 19:17:51 +0000</pubDate>
		<dc:creator>cliff</dc:creator>
				<category><![CDATA[Data and Technology]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[spaces]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[str_replace]]></category>
		<category><![CDATA[substitution]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unix find]]></category>

		<guid isPermaLink="false">http://spiralbound.net/2007/12/12/php-and-sed-for-string-substitution</guid>
		<description><![CDATA[I needed to replace a string in several thousand files scattered all over the filesystem on one of our servers. I used find to create a list of files that needed to be changed, along with their complete path and called it "list.txt". It looked something like this:

/path/to/file/one/fileone.html
/path/to/file/two/filetwo.php
/path/to/file/three/filethree.htm
/path/to/directory with spaces/filefour.txt
and so on...

I worked out the [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to replace a string in several thousand files scattered all over the filesystem on one of our servers. I used find to create a list of files that needed to be changed, along with their complete path and called it "list.txt". It looked something like this:</p>
<p><code><br />
/path/to/file/one/fileone.html<br />
/path/to/file/two/filetwo.php<br />
/path/to/file/three/filethree.htm<br />
/path/to/directory with spaces/filefour.txt<br />
and so on...<br />
</code></p>
<p>I worked out the "sed" command to do the in place editing, and <a href="http://nosheep.net">Zach</a> helped me whip up a quick PHP script to read the contents of "list.txt" into an array and iterate through it. He was also nice enough to show me how to use "str_replace" to escape any annoying spaces that happened to find their way into the names of directories.</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$files</span>=<a href="http://www.php.net/file"><span style="color:#000066;">file</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'list.txt'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$files</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$command</span>=<span style="color:#FF0000;">'/bin/sed -i <span style="color:#000099; font-weight:bold;">\'</span>s/old-string/new-string/g<span style="color:#000099; font-weight:bold;">\'</span> '</span>.<a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>,<span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\ </span>'</span>,<span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exec"><span style="color:#000066;">exec</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$command</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>It's a handy little script that I'm sure I will find a use for later, so I thought I would put it up here.</p>
]]></content:encoded>
			<wfw:commentRss>http://spiralbound.net/2007/12/12/php-and-sed-for-string-substitution/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
