<?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>Unix Sysadmin &#187; Commands</title>
	<atom:link href="http://www.sysadmindayph.com/blog/category/commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sysadmindayph.com/blog</link>
	<description>SysAdmin Blog, TechTips and Reviews</description>
	<lastBuildDate>Fri, 27 Jan 2012 04:36:08 +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>KSH Script Basics &#124; Special Shell Variables</title>
		<link>http://www.sysadmindayph.com/blog/ksh-script-basics-special-shell-variables/</link>
		<comments>http://www.sysadmindayph.com/blog/ksh-script-basics-special-shell-variables/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 02:57:31 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[if else]]></category>
		<category><![CDATA[if else if]]></category>
		<category><![CDATA[ksh shell]]></category>
		<category><![CDATA[ksh shell script]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[special shell variable]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=221</guid>
		<description><![CDATA[Just deleted tons of stale, unsused user accounts. Here are some KSH shell basics and special shell variable. I need to Google them up myself to get reminded that &#8216;$?&#8217; is the output variable for script execution. That is, it&#8217;s 0 for successful execution and 1 if there is any error. Special shell variables There &#8230; <a href="http://www.sysadmindayph.com/blog/ksh-script-basics-special-shell-variables/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Just deleted tons of stale, unsused user accounts. Here are some KSH shell basics and special shell variable. I need to Google them up myself to get reminded that &#8216;$?&#8217; is the output variable for script execution. That is, it&#8217;s 0 for successful execution and 1 if there is any error.</p>
<p><span id="more-221"></span></p>
<p>Special shell variables<br />
There are some variables which are set internally by the shell and which are available to the user:</p>
<p>Name          Description<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
$1 &#8211; $9       these variables are the positional parameters.</p>
<p>$0            the name of the command currently being executed.</p>
<p>$#            the number of positional arguments given to this<br />
              invocation of the shell.</p>
<p>$?            the exit status of the last command executed is<br />
              given as a decimal string.  When a command<br />
              completes successfully, it returns the exit status<br />
              of 0 (zero), otherwise it returns a non-zero exit<br />
              status.</p>
<p>$$            the process number of this shell &#8211; useful for<br />
              including in filenames, to make them unique.</p>
<p>$!            the process id of the last command run in<br />
              the background.</p>
<p>$-            the current options supplied to this invocation<br />
              of the shell.</p>
<p>$*            a string containing all the arguments to the<br />
              shell, starting at $1.</p>
<p>$@            same as above, except when quoted.</p>
<p><strong>Branching</strong><br />
<code>if then fi<br />
if [[ $value -eq 7 ]];then<br />
   print "$value is 7"<br />
fi</code><br />
or:</p>
<p><code>if [[ $value -eq 7 ]]<br />
then<br />
   print "$value is 7"<br />
fi</code>or:</p>
<p><code>if [[ $value -eq 7 ]];then print "$value is 7";fi</p>
<p>if then else fi<br />
if [[ $name = "John" ]];then<br />
   print "Your welcome, ${name}."<br />
else<br />
   print "Good bye, ${name}!"<br />
fi</code></p>
<p><code>if then elif then else fi<br />
if [[ $name = "John" ]];then<br />
   print "Your welcome, ${name}."<br />
elif [[ $name = "Hanna" ]];then<br />
   print "Hello, ${name}, who are you?"<br />
else<br />
   print "Good bye, ${name}!"<br />
fi</code></p>
<p><code>case esac<br />
case $var in<br />
   john|fred) print $invitation;;<br />
   martin)    print $declination;;<br />
   *)         print "Wrong name...";;<br />
esac</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>Looping Command Syntax for Scripts</strong></p>
<p><code>while do done<br />
while [[ $count -gt 0 ]];do<br />
   print "\$count is $count"<br />
   (( count -= 1 ))<br />
done</code><br />
<code>until do done<br />
until [[ $answer = "yes" ]];do<br />
   print -n "Please enter \"yes\": "<br />
   read answer<br />
   print ""<br />
done</code><br />
<code>for var in list do done<br />
for foo in $(ls);do<br />
   if [[ -d $foo ]];then<br />
      print "$foo is a directory"<br />
   else<br />
      print "$foo is not a directory"<br />
   fi<br />
done</code><br />
continue&#8230;break<br />
One can skip the rest of a loop and directly go to the next iteration with: &#8220;continue&#8221;. </p>
<p><code>while read line<br />
do<br />
   if [[ $line = *.gz ]];then<br />
      continue<br />
   else<br />
      print $line<br />
   fi<br />
done</code><br />
One can also prematurely leave a loop with: &#8220;break&#8221;. </p>
<p><code>while read line;do<br />
   if [[ $line = *!(.c) ]];then<br />
      break<br />
   else<br />
      print $line<br />
   fi<br />
done</code></p>
<p>http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html</p>
<p>Removing accounts from predefine list:</p>
<p><code>#!/bin/ksh</p>
<p>for each in `cat ./list-a`<br />
do<br />
  grep -i $each  /etc/passwd<br />
    if [[ $? -eq 1 ]]; then<br />
        echo "$each does not exists."<br />
        sleep 2<br />
        continue;<br />
    else<br />
        echo "$each exists"<br />
        echo "Deleting account.. "<br />
        sleep 2<br />
        userdel $each<br />
        echo "$each deleted"<br />
        sleep 5<br />
     fi</p>
<p>done</code></p>
<p>Or course, the sleep there is just for aesthetic.. I want to see the screen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/ksh-script-basics-special-shell-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>getfacl and setfacl &#8211; Unix Access Control (acl) Tool</title>
		<link>http://www.sysadmindayph.com/blog/getfacl-and-setfacl-unix-access-control-acl-tool/</link>
		<comments>http://www.sysadmindayph.com/blog/getfacl-and-setfacl-unix-access-control-acl-tool/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 14:12:06 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[access list]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[getfacl]]></category>
		<category><![CDATA[setfacl]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=194</guid>
		<description><![CDATA[Today&#8217;s topic is all about Access List&#8230; For Unix and Unix-like system, the usual command to set the file permission is the &#8216;chmod&#8217; command. However there are instances that we need more flexibility in giving access and control for files and folders. Get it? Access and Control? In this situation, there is a file utility &#8230; <a href="http://www.sysadmindayph.com/blog/getfacl-and-setfacl-unix-access-control-acl-tool/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s topic is all about <strong>Access List</strong>&#8230; For Unix and Unix-like system, the usual command to set the file permission is the &#8216;chmod&#8217; command. However there are instances that we need more flexibility in giving access and control for files and folders. Get it? Access and Control? In this situation, there is a file utility built in Unix called &#8216;<strong>getfacl</strong>&#8216; and &#8216;<strong>setfacl</strong>&#8216;.</p>
<p><strong><br />
getfacl</strong> is a file utility for viewing the access control list information associated with a file or directory.</p>
<p>For a memory aid, you can think of &#8216;getfacl&#8217; as &#8220;<strong>G</strong>et <strong>F</strong>ile <strong>ACL</strong>&#8220;.. ACL being Access Control List.</p>
<p>Access control lists are extended attributes added to most major file systems in the 2.6 kernel to improve ability to control the access of files. They allow permissions to be set for individual groups and users and not just the owning user, owning group, and all other users.</p>
<p><strong>setfacl</strong> is a command that allows you to set the Access Control List information for a file or directory.</p>
<p>Access control lists are extended attributes added to most major file systems in the 2.6 kernel to improve ability to control the access of files. They allow permissions to be set for individual groups and users and not just the owning user, owning group, and all other users.</p>
<p>You can read man pages for both <a href="http://www.unix.com/man-page/All/1/getfacl/">getfacl</a> and <a href="http://www.unix.com/man-page/All/1/setfacl/">setfacl</a> for more information.</p>
<p>getfacl and setfacl example&#8230;.</p>
<p>Here&#8217;s an example of using the basic funtion of getfacl and setfacl</p>
<p># getfacl</p>
<p>#setfacl</p>
<p>setfacl -m default:user::rwx,default:group::r-x,default:other:r-x,default:mask:rwx /u06/OneSource/datapump_dbdump</p>
<p>setfacl -m default:user:rcodapp1:r-x,default:group:r-x,default:other:&#8212;,default:mas:rwx /u06/OneSouce/datapump_dbdump</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/getfacl-and-setfacl-unix-access-control-acl-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Veritas Volume Manager VxVM Basics Commands Cheats</title>
		<link>http://www.sysadmindayph.com/blog/veritas-volume-manager-vxvm-basics-commands-cheats/</link>
		<comments>http://www.sysadmindayph.com/blog/veritas-volume-manager-vxvm-basics-commands-cheats/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 09:11:05 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Veritas Volume Manager]]></category>
		<category><![CDATA[diskgroups]]></category>
		<category><![CDATA[veritas]]></category>
		<category><![CDATA[vxfs]]></category>
		<category><![CDATA[vxvm]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=181</guid>
		<description><![CDATA[Veritas Volume Manager VxVM Basics Commands Cheats.. The authority site for this topic, the VXVM on VXFS, if you do a Google search for any tutorial or command cheat sheet is Cuddletech. I want to post&#8230; say, borrowing, the content of that page to this post for my own personal reference&#8230; Love your own page &#8230; <a href="http://www.sysadmindayph.com/blog/veritas-volume-manager-vxvm-basics-commands-cheats/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Veritas Volume Manager <a href="http://www.sysadmindayph.com/blog/veritas-volume-manager-vxvm-basics-commands-cheats/">VxVM Basics Commands Cheats</a>.. The authority site for this topic, the VXVM on VXFS, if you do a Google search for any tutorial or command cheat sheet is Cuddletech.</p>
<p>I want to post&#8230; say, borrowing, the content of that page to this post for my own personal reference&#8230; Love your own page right? And since I am more likely to open SysadminPH that cuddletech, I thought we not copy the Veritas tutorial page here for my ease of access?</p>
<p><span id="more-181"></span></p>
<p>  The Cuddletech Veritas Cheat Sheet</p>
<p>		by: B. Rockwood<br />
	      benr@cuddletech.com</p>
<p>Overview:<br />
&#8212;&#8212;&#8211;</p>
<p>        The purpose of this paper is to<br />
quickly get you up to speed in Veritas,<br />
and to act as a quick referance.  All new<br />
users to Veritas are HIGHLY encouraged to<br />
first read the Veritas users guides enlucded<br />
with Veritas, and found on docs.sun.com</p>
<p>Remember!: Almost all commands can use several<br />
        diffrent options that are similar<br />
        across all commands.  The most used<br />
        of these is &#8220;-g <diskgroup>&#8221; which<br />
        specifies which Disk Group the command<br />
        will be executed on.  For instance,<br />
        vxinfo will only display volume information<br />
        for volumes in the rootdg, to see<br />
        volumes in the datadg, for instance, use:<br />
        Ex: &#8220;vxinfo -g datadg&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
        DISPLAY and MONITORING<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>vxdisk list<br />
        List all disks used by Veritas (VX).</p>
<p>vxdisk list <diskname><br />
        Display detailed information about a<br />
        single disk, including mutlipathing<br />
        information, size, type, Vx version,<br />
        and more.</p>
<p>vxprint<br />
        Display report style information about<br />
        the current status of all Vx componants,<br />
        including disks, subdisks, plexes, and<br />
        volumes.</p>
<p>vxprint <componant><br />
        Display report style information about<br />
        the current status of ONLY the componant<br />
        you request.  So for instance,<br />
        &#8220;vxprint vol01&#8243; shows information about<br />
        all subcomponants of vol01.  This works<br />
        for plexes, disk groups, etc.</p>
<p>vxprint -hrt<br />
	Display detailed information about all<br />
	Vx componanats, including stwdith,<br />
	ncolumns, offsets, layout type, read-<br />
	policy, and more.  This is best for<br />
	a true picture of your configuration.</p>
<p>vxdg list<br />
        Display listing and state information<br />
        of all Disk Groups.</p>
<p>vxdg list <diskgroup name><br />
        Display detailed information about<br />
        a diskgroup, including flags, version,<br />
        logs status, etc.</p>
<p>vxinfo<br />
        Display volume status and volume type.<br />
        By default, only displays &#8220;rootdg&#8221;,<br />
        to display a diffrent Disk Group,<br />
        use &#8220;vxinfo -g <dgname>&#8220;.</p>
<p>vxassist maxgrow <volume><br />
        This command will output the maximum size<br />
        the volume specified can increased by,<br />
        specified in sectors.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
        DISK TASKS and COMMANDS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>vxdiskadd <devname><br />
        Adds a disk to Vx by Initializing and Encapsolating<br />
        it.  Specified by its device name (ex: c0t1d0s2).<br />
        NOTE: You&#8217;ll need to reboot to finalize the<br />
        disk addition!</p>
<p>        This command, can also be used to add a disk to<br />
        a specified disk group.  Just follow the prompts.<br />
        No reboots needed for changing DG&#8217;s.</p>
<p>vxedit rename
<oldname> <newname><br />
        Rename a Vx disk. Ex: &#8220;vxedit rename disk01 disk05&#8243;</p>
<p>vxedit set reserve=on <diskname><br />
        Sets the &#8220;reserve&#8221; flag to a Vx disk.  This<br />
        is used to keep specific disks from being<br />
        accidentally, or generally used.</p>
<p>vxdisk offline <diskname><br />
        Used to &#8220;offline&#8221; a disk.  The disk should<br />
        be removed from its diskgroup before being<br />
        offlined.</p>
<p>vxdisk rm <devname><br />
        Used to remove disks from Vx control completely.<br />
        Ex: &#8220;vxdisk rm c0t1d0s2&#8243;  Make sure to<br />
        removed the disk from its diskgroup, and offline<br />
        the disk before removing it.</p>
<p>vxedit set spare=on <diskname><br />
        Sets the &#8220;spare&#8221; flag to a Vx disk.  This is used<br />
        to make the specified disk a hot spare, which<br />
        is then added to the &#8220;hot spare pool&#8221;.</p>
<p>vxedit set spare=off <diskname><br />
        Same as above but removes the disk from the<br />
        &#8220;hot spare pool&#8221;.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        DISK GROUPS and COMMANDS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>vxdg init <diskgroup> <diskname>=<devname><br />
        Creates a new disk group, and assigns the naming<br />
        scheme to the first disk added to the group.<br />
        ex: &#8220;vxdg init newdg newdg01=c0t10d0s2&#8243;.<br />
        NOTE: This is kinda tricky because the disk that<br />
        you&#8217;re adding can&#8217;t be a member of ANY DG, but<br />
        must be initialized.  It&#8217;s easier to use<br />
        &#8220;vxdiskadd&#8221;, and add the disk to a newdg by<br />
        specifying a new DG name for the DG field.</p>
<p>vxdg deport <diskgroup><br />
        Disabled a diskgroup, but doesn&#8217;t remove it.  Often<br />
        used as an organized pool of disk to realocate, and<br />
        to moved DG&#8217;s from one system to another.</p>
<p>vxdg import <diskgroup><br />
        Reverse of above.  Enables local access to the specified<br />
        disk group.</p>
<p>vxdg -n <newdgname>
<olddgname>
        Change a Disk Groups name.</p>
<p>vxdg list <dgname><br />
        Use this to check the version numbers of Disk<br />
        Groups.  Shows other details about the DG too.</p>
<p>vxdg destroy <dgname><br />
        Removes the specified DG, and frees all its disks<br />
        back to general use by Vx.</p>
<p>-= Quick Chart!: Disk Group Version Number Translation</p>
<p>        VxVM          Introduced                Supported<br />
        Release         Version                 Versions<br />
        &#8212;&#8212;-       &#8212;&#8212;&#8212;&#8212;              &#8212;&#8212;&#8212;<br />
        1.2             10                        10<br />
        1.3             15                        15<br />
        2.0             20                        20<br />
        2.2             30                        30<br />
        2.3             40                        40<br />
        2.5             50                        50<br />
        3.0             60                       20-60</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
        SUBDISKS and COMMANDS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;                                       </p>
<p>vxmake sd <subdiskname> <disk>,<offset>,<length><br />
        Creates a subdisk with the specified name,<br />
        and by the offset and length specified.<br />
        ex: &#8220;vxmake sd disk02-01 disk02,0,8000&#8243;<br />
        NOTE: If you are going to add this subdisk<br />
        to a plex, its good to check the other<br />
        subdisks in that plex to see what their<br />
        lengths and offsets are, use the command:<br />
        &#8220;vxprint -st&#8221;</p>
<p>vxedit rm <subdiskname><br />
        Removes a subdisk.                       </p>
<p>vxsd assoc
<plexname> <subdiskname>,&#8230;.<br />
        Associates the specified subdisks to<br />
        the specified plex.  Example:<br />
        &#8220;vxsd assoc vol01-03 disk01-01,disk02-01&#8243;<br />
        NOTE: Striped volumes are diffrent,<br />
        you need to specify the column# so<br />
        use the following:                                           </p>
<p>vxsd -l<br />
<col#/offset> assoc
<plexname> <subdiskname>,&#8230;<br />
        Same as above, but used for associating<br />
	subdisks to a striped plex.  Use the command<br />
        &#8220;vxprint -st&#8221; to see what other subdisk<br />
        in the plex look like, and then set the<br />
        new subdisks column number and offset<br />
        (found in the seventh column of output)<br />
        to the appropriate value.</p>
<p>vxsd aslog
<plex> <subdiskname><br />
        Adds a log subdisk to the specified plex.<br />
        Ex: &#8220;vxsd aslog vol01-02 disk03-01&#8243; </p>
<p>vxsd dis <subdiskname><br />
        Disassociates the specified subdisk from its<br />
        current plex.                                                      </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
        PLEXS and COMMANDS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>vxmake plex
<plexname> sd=<subdiskname>,<subdiskname>,&#8230;.<br />
        Creates a new plex by the name specified and<br />
        assigns the specified subdisks to it.</p>
<p>vxmake plex
<plexname> layout=<layout> stwidth=<stwidth> ncolumn=<ncolumn> sd=&#8230;<br />
	Like above command, but specifies layout type<br />
	as defined by <layout>, which is used for creation<br />
	of striped and RAID5 plexes.  The layout is<br />
	constrained by the defined number of columns,<br />
	and stripe width.  Subdisks specified are<br />
	added to the created plex.	</p>
<p>vxplex att <volname>
<plexname>
        Associates specified plex with specified volume.<br />
        (Adds a mirror)<br />
        NOTE: Attachment will take a while.  Watch<br />
        it with Vxtask, or via vxprint</p>
<p>vxplex dis
<plexname>
        Disassociate specified plex from its connected<br />
        volume.</p>
<p>vxedit -r rm
<plexname>
        Remove the plex.</p>
<p>vxmend off
<plexname>
        Offlines a plex for repair to it&#8217;s disks.</p>
<p>vxplex det
<plexname>
        Detaches specified plex from its connected<br />
        volume, but maintians association with it&#8217;s<br />
        volume.  The plex is no longer used<br />
        for I/O untill it is (re)attached.</p>
<p>vxmend fix clean
<plexname>
        Used to clean plexes that are in the<br />
        &#8220;unclean&#8221; state.  Used with unstartable<br />
        volumes.</p>
<p>vxplex mv <originalplex> <newplex><br />
        Moves the data content from the origonal<br />
        plex onto a new plex.<br />
        NOTE: The old plex must be active (ENABLED).<br />
        The new plex should be the same length, or<br />
        larger than the old plex.  The new plex<br />
        must not be associated with another volume.<br />
        (duh)</p>
<p>vxplex cp <volume> <newplex><br />
        Copies the data from the specified volume<br />
        to a new plex.<br />
        NOTE: The new plex cannot be associated<br />
        with any other volume.  The new plex,<br />
        further, will NOT be attached to<br />
        the specified volume.  (Also, see notes<br />
        from above)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        VOLUMES and COMMANDS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>vxassist make <volumename> <length><br />
        Creates a new volume with the name specified<br />
        and is made to the length specified.<br />
        Ex: &#8220;vxassist make newvol 10m&#8221;<br />
        NOTE: This command will pull disk space<br />
        from the generally avalible Vx disk space.</p>
<p>vxassist make <volname> <length> layout=<layouttype> <disk> <disk> &#8230;.<br />
        Like the above command, but with layout specified.<br />
        The most common layouts are: striped and raid5<br />
        ex: &#8220;vxassist make newvol 100m layout=raid5 disk01 disk02 disk03&#8243;<br />
        NOTE: See the vxassist(1M) man page for more information.</p>
<p>vxmake vol <volname> len=<length> plex=
<plexname>,&#8230;<br />
        Creates a new volume of specified length (usually<br />
        in sectors), and attachs the specified plexes to that<br />
        volume.  Useful for creating volumes to house<br />
        copied or moved plexes.<br />
        NOTE: See the vxmake(1M) man page for more information.</p>
<p>vxvol init <state> <volname> [plexname]<br />
        Manually sets the state of a volume.<br />
        NOTE: Not for the squimish.</p>
<p>vxassist maxsize [layout=raid5]<br />
        Returns the maximum size avalible via Vx to create<br />
        a new volume.  By adding &#8220;layout=raid5&#8243; to the command<br />
        the calulations take into account losse due<br />
        to raid5.  Output is in sectors and Megs.</p>
<p>vxassist maxgrow <volname><br />
        Returns the maximum ammount of Vx space that<br />
        can be added to the specified volume.</p>
<p>vxassist mirror <volname><br />
        Creates a mirror for the specified volume.<br />
        NOTE: Think of this as &#8220;handsfree plex creation&#8221;.<br />
        This is fast, but the disks you want used<br />
        may not be used&#8230; often best to do manually.</p>
<p>vxassist addlog <volname><br />
        Adds a Dirty Region Log (DRL) for the specified volume.</p>
<p>vxassist remove log <volname><br />
        Reverse of above.</p>
<p>vxvol start <volname><br />
        Starts a volume</p>
<p>vxvol stop <volname><br />
        Stops a volume.  Alternately you can use command as<br />
        such: &#8220;vxvol stopall&#8221; in order to stop all volumes.</p>
<p>vxassit growto/growby/shrinkto/shrinkby <volname> <length><br />
        Resizes the volume specified.  Use one of the<br />
        following: growto, growby, shrinkto, and shrinkby<br />
        in order to descide what <length> specifies.<br />
        By default length is specified in sectors.<br />
        This does not resize the filesystem inside the volume.<br />
        NOTE: Don&#8217;t shrink volumes to be less that<br />
        its contained filesystem! (duh)</p>
<p>vxvol set len=<length> <volname><br />
        An alternate to above command.  Sets the absolute<br />
        lenths of the specified volume to the length<br />
        specified, by default, in sectors.  This<br />
        does not resize the filesystem inside the volume.</p>
<p>        NOTE: There is also a resize(1M) command, used<br />
        for resizing both volume AND filesytem.  See<br />
        the man page for that one.</p>
<p>vxedit rm <volname><br />
        Removes the specified volume. (poof!)<br />
        NOTE: If the volume specified is in the ENABLED<br />
        state, you will need to use the command<br />
        &#8220;vxedit -f <volname>&#8220;.  Also, using the &#8220;r&#8221;<br />
        with &#8220;f&#8221; will remove all plexes and subdisks<br />
        with the volume.  If you didn&#8217;t guess, &#8220;r&#8221;<br />
        is Recursive, and &#8220;f&#8221; is Force.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Misc Stuff:</p>
<p>To calculate the size of a filesystem inside a volume, use<br />
the command:<br />
	fstyp -v <volume-device-path> | head -30 | grep ncg<br />
Ignore the errors.  Output will look this this:<br />
  # fstyp -v /dev/vx/rdsk/datadg/vol01 | head -30 | grep ncg<br />
  ncg     17152   size    70254592        blocks  65863396<br />
  # Broken Pipe<br />
  Unknown_fstyp (no matches)<br />
The size found after the label &#8220;size&#8221; is presented in kilobytes.<br />
You can convert to sectors by multiplying by 2.</p>
<p>		&#8212;&#8212;&#8212;&#8211;</p>
<p>To calculate the size of a volume, use vxprint, and look for the<br />
&#8220;len&#8221;.  The volume length is in sectors.  Convert to kilobytes<br />
by dividing by 2.</p>
<p>		&#8212;&#8212;&#8212;&#8212;-</p>
<p>Volume Growth Procudure:<br />
1) You can use vxassist to estimate the max size of<br />
a given volume based on the disks you wish to add:<br />
ex: # vxassist -g rootdg maxgrow vol01 disk01 disk02 disk03</p>
<p>2) Next, actually grow the volume (NOT THE FS) via the<br />
command (assuming maxgrow outputed 10639360 as the maxsize):<br />
ex:# vxassist -g rootdg growto vol01 10639360 disk01 disk02 disk03</p>
<p>3) Now VxVM grinds away, monitor with vxtask.</p>
<p>4) Now Grow the Filesystem, for UFS use:<br />
# /usr/lib/fs/ufs/mkfs -F ufs -M /export /dev/vx/rdsk/rootdg/vol01 10639360</p>
<p>for VXFS ufs:<br />
# /usr/lib/fs/vxfs/fsadm -b 10639360 -r /dev/vx/rdsk/rootdg/vol01 /mnt<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>5) Done!</p>
<p>	&#8212;&#8212;&#8212;-</p>
<p>Changing User/Group of a Raw Volume: (ex:)<br />
 vxedit -g xxxdg set group=dba data_vol_123<br />
 vxedit -g xxxdg set user=oracle data_vol_123</p>
<p>Thanks to Ben Rockwood! Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/veritas-volume-manager-vxvm-basics-commands-cheats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVM: Determine Free Space on Soft Partition</title>
		<link>http://www.sysadmindayph.com/blog/svm-determine-free-space-on-soft-partition/</link>
		<comments>http://www.sysadmindayph.com/blog/svm-determine-free-space-on-soft-partition/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 03:28:43 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[metadevice]]></category>
		<category><![CDATA[metastat]]></category>
		<category><![CDATA[soft partition]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=178</guid>
		<description><![CDATA[SVM: Determine Free Space on Soft Partition , we use the metastat -c command&#8230; [root@localhost] /work/users&#62; metastat -c d103 d103 p 32GB d100 d100 m 68GB d101 d102 d101 s 68GB c1t2d0s0 d102 s 68GB c1t3d0s0 [root@localhost] /work/users&#62; metastat -p d103 d103 -p d100 -o 32 -b 58720256 -o 127926432 -b 8388608 d100 -m d101 &#8230; <a href="http://www.sysadmindayph.com/blog/svm-determine-free-space-on-soft-partition/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>SVM: Determine Free Space on Soft Partition , we use the metastat -c  command&#8230;</p>
<p><code>[root@localhost] /work/users&gt; metastat -c d103<br />
d103             p   32GB d100<br />
d100         m   68GB d101 d102<br />
d101     s   68GB c1t2d0s0<br />
d102     s   68GB c1t3d0s0</code></p>
<p>[root@localhost] /work/users&gt; metastat -p d103<br />
d103 -p d100 -o 32 -b 58720256  -o 127926432 -b 8388608<br />
d100 -m d101 d102 1<br />
d101 1 1 c1t2d0s0<br />
d102 1 1 c1t3d0s0</p>
<p>So from the first metastat -c d103.. that&#8217;s a mirrored 68G partition, d100 and a 32G soft partition d103..  We still have around 35G of space.</p>
<p>update: &#8212; someone comment please.. this information is incomplete!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/svm-determine-free-space-on-soft-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Search $PATH csh</title>
		<link>http://www.sysadmindayph.com/blog/setting-search-path-csh/</link>
		<comments>http://www.sysadmindayph.com/blog/setting-search-path-csh/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 02:35:56 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[c shell]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[setting path]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=156</guid>
		<description><![CDATA[Another quikie copy/paste kind of thingy&#8230; You may set your search path automatically each time you log in, by placing the appropriate &#8220;set path&#8221; command in your &#8220;.login&#8221; file. (To learn more about the .login file, type &#8220;help dotlogin&#8221;.) Here is a sample of a command line that you might put in your .login file &#8230; <a href="http://www.sysadmindayph.com/blog/setting-search-path-csh/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Another quikie copy/paste kind of thingy&#8230;</p>
<p>You may set your search path automatically each time you log in, by placing the appropriate &#8220;set path&#8221; command in your &#8220;.login&#8221; file. </p>
<p>(To learn more about the .login file, type &#8220;help dotlogin&#8221;.) Here is a sample of a command line that you might put in your .login file to set a non-standard search path:</p>
<p>       set path = ( $path /usr/ucb /bin /usr/bin /usr/new .)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/setting-search-path-csh/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Top equivalent for AIX &#8211; Topas, Only Better</title>
		<link>http://www.sysadmindayph.com/blog/top-equivalent-for-aix-topas-only-better/</link>
		<comments>http://www.sysadmindayph.com/blog/top-equivalent-for-aix-topas-only-better/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 10:03:41 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[topas]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=155</guid>
		<description><![CDATA[Top equivalent for AIX &#8211; Topas, Only Better&#8230; That&#8217;s what I searched when I got a ticket from one of the AIX boxes here complaining about CPU being 99% used up. Of course, you can use vmstat with interval, but for those sysadmin folks who are use to using Top, its still more comfortable using &#8230; <a href="http://www.sysadmindayph.com/blog/top-equivalent-for-aix-topas-only-better/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Top equivalent for AIX &#8211; Topas, Only Better&#8230; That&#8217;s what I searched when I got a ticket from one of the AIX boxes here complaining about CPU being 99% used up.</p>
<p>Of course, you can use vmstat with interval, but for those sysadmin folks who are use to using Top, its still more comfortable using (and seeing) the top output.</p>
<p>Topas is the equivalent of Top for AIX.. it&#8217;s better than Top as a matter of fact according to some AIX gurus (and Solaris)</p>
<p>If you persists in using top, You&#8217;ll have to build it yourself from the sources at <a href="http://www.unixtop.org/">http://www.unixtop.org/</a> plus probably this fix: </p>
<p>        <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=934590&amp;group_id=72892&amp;atid=536044">http://sourceforge.net/tracker/index.php?func=detail&amp;aid=934590&amp;group_id=72892&amp;atid=536044</a></p>
<p>Good luck!</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/top-equivalent-for-aix-topas-only-better/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Do Not Prompt Password for SUDO: NoPasswd</title>
		<link>http://www.sysadmindayph.com/blog/do-not-prompt-password-for-sudo-nopasswd/</link>
		<comments>http://www.sysadmindayph.com/blog/do-not-prompt-password-for-sudo-nopasswd/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 03:35:17 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[no password]]></category>
		<category><![CDATA[nopasswd]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=132</guid>
		<description><![CDATA[Do Not Prompt Password for SUDO: NoPasswd, here&#8217;s a quikie, quikie post&#8230; How do you setup a sudo for a user without prompting the user for his password? RTFM! Simply add NOPASSWD before the list of commands&#8230;again NOPASSWD goes before the list of commands, after your username and host list. The man page has this &#8230; <a href="http://www.sysadmindayph.com/blog/do-not-prompt-password-for-sudo-nopasswd/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Do Not Prompt Password for SUDO: NoPasswd, here&#8217;s a quikie, quikie post&#8230; How do you setup a sudo for a user without prompting the user for his password?</p>
<p>RTFM! <img src='http://www.sysadmindayph.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Simply add NOPASSWD before the list of commands&#8230;again NOPASSWD goes before the list of commands, after your username and host list. The man page has this example:</p>
<blockquote><p>ray    rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm</p></blockquote>
<p>Where &#8216;ray&#8217; is the username, &#8216;rushmor&#8217; is the host and the rest, you know already&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/do-not-prompt-password-for-sudo-nopasswd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pwd &#8211; Most Used UNIX Command</title>
		<link>http://www.sysadmindayph.com/blog/pwd-most-used-unix-command/</link>
		<comments>http://www.sysadmindayph.com/blog/pwd-most-used-unix-command/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 11:05:37 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[pwd]]></category>
		<category><![CDATA[unix command]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=116</guid>
		<description><![CDATA[pwd is probably the most widely used UNIX (or Unix-like) command! ls (el-es) could also be the most used but we will be talking about pwd here, so let&#8217;s say that &#8216;pwd&#8217; is the most widely used shall we? What is pwd? pwd, when executed at the shell (prompt) will print out the current working &#8230; <a href="http://www.sysadmindayph.com/blog/pwd-most-used-unix-command/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p><strong>pwd</strong> is probably the most widely used UNIX (or Unix-like) command! ls (el-es) could also be the most used but we will be talking <a title="pwd" href="http://www.sysadmindayph.com/blog/pwd-most-used-unix-command/">about pwd</a> here, so let&#8217;s say that &#8216;pwd&#8217; is the most widely used shall we?</p>
<p><strong>What is pwd?</strong></p>
<p>pwd, when executed at the shell (prompt) will print out the current working directory in the standard output of the system, which is the monitor.</p>
<p>pwd could be and abbreviation for &#8216;print working directory&#8217; or &#8216;present working directory&#8217; or make up your own definition.. there&#8217;s no rule.</p>
<p>WIkipedia says:</p>
<p>In Unix-like and some other operating systems the pwd command (print working directory) is used to output the path of the current working directory.</p>
<p>The command is a shell builtin in certain Unix shells such as sh, and bash. It can be implemented easily with the POSIX C functions getcwd() and/or getwd().</p>
<p>The equivalent on DOS (COMMAND.COM) and Microsoft Windows (cmd.exe) is the &#8220;cd&#8221; command with no arguments. Windows PowerShell provides the equivalent &#8220;Get-Location&#8221; cmdlet with the standard aliases &#8220;gl&#8221; and &#8220;pwd&#8221;. The OpenVMS equivalent is &#8220;show default&#8221;.</p>
<p>Example:</p>
<p>$ pwd<br />
/home/foobar</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/pwd-most-used-unix-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing a Failed Disk in Solaris Mirror (SVM)</title>
		<link>http://www.sysadmindayph.com/blog/replacing-a-failed-disk-in-solaris-mirror-svm/</link>
		<comments>http://www.sysadmindayph.com/blog/replacing-a-failed-disk-in-solaris-mirror-svm/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 00:53:50 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[metaclear]]></category>
		<category><![CDATA[metadb]]></category>
		<category><![CDATA[metadettach]]></category>
		<category><![CDATA[metadevice]]></category>
		<category><![CDATA[metattache]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[svm]]></category>
		<category><![CDATA[volume manager]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=108</guid>
		<description><![CDATA[This one is about Solaris Volume Manager and all those meta commands you can think of.. (metadb, metadettach, metattach, metaclear etc)&#8230; Yesterday we had to replace a failed disk that belongs to a mirror. The disk is running in a Sparc Solaris 10 box. It&#8217;s a 72GB from Fujitsu c1t1d0           Soft Errors: 440 Hard Errors: &#8230; <a href="http://www.sysadmindayph.com/blog/replacing-a-failed-disk-in-solaris-mirror-svm/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>This one is about Solaris Volume Manager and all those meta commands you can think of.. (metadb, metadettach, metattach, metaclear etc)&#8230;</p>
<p>Yesterday we had to replace a failed disk that belongs to a mirror. The disk is running in a Sparc Solaris 10 box. It&#8217;s a 72GB from Fujitsu</p>
<p>c1t1d0           Soft Errors: 440 Hard Errors: 12 Transport Errors: 124<br />
Vendor: FUJITSU  Product: MAY2073RCSUN72G  Revision: 0501 Serial No: 0711S0935R<br />
Size: 73.40GB &lt;73400057856 bytes&gt;</p>
<p>As you can see from the iostat -En command, the disk is spitting hard errors and must be replaced before it can cause a lot more headache. It&#8217;s in c1t1, right.</p>
<p>Here&#8217;s what we&#8217;re supposed to do:</p>
<ul>
<li>we could delete the meta data base that corresponds to the failed disk</li>
<li>detached the failed disk/slices to the mirror</li>
<li>clear it</li>
<li>unconfigure the disk</li>
<li>replace the disk</li>
<li>configure the disk</li>
<li>create new meta device database</li>
<li>Initialize the disk</li>
<li>Attached it to mirror</li>
<li>and sync</li>
</ul>
<p>Here&#8217;s the detailed job:</p>
<p><span id="more-108"></span></p>
<p>Info:<br />
metadb | grep c1t1<br />
metadb –d c1t1d0s7</p>
<p>Detach:<br />
metadetach d30 d32<br />
metadetach d40 d42<br />
metadetach d20 d22<br />
metadetach d10 d12</p>
<p>metaclear d32<br />
metaclear d42<br />
metaclear d22<br />
metaclear d12</p>
<p>Verify:<br />
metastat -p | grep c1t1d0<br />
metadb  | grep c1t1d0<br />
[root@localhost] /&gt; cfgadm -al<br />
Ap_Id                          Type         Receptacle   Occupant     Condition<br />
c0                             scsi-bus     connected    configured   unknown<br />
c0::dsk/c0t0d0                 CD-ROM       connected    configured   unknown<br />
c1                             scsi-bus     connected    configured   unknown<br />
c1::dsk/c1t0d0                 disk         connected    configured   unknown<br />
c1::dsk/c1t1d0                 disk         connected    configured   unknown<br />
c1::dsk/c1t2d0                 disk         connected    configured   unknown<br />
c1::dsk/c1t3d0                 disk         connected    configured   unknown<br />
usb0/1                         unknown      empty        unconfigured ok<br />
usb0/2                         unknown      empty        unconfigured ok<br />
usb1/1.1                       unknown      empty        unconfigured ok<br />
usb1/1.2                       unknown      empty        unconfigured ok<br />
usb1/1.3                       unknown      empty        unconfigured ok<br />
usb1/1.4                       unknown      empty        unconfigured ok<br />
usb1/2                         unknown      empty        unconfigured ok</p>
<p>Unconfigure:<br />
cfgadm -c unconfigure c1::dsk/c1t1d0</p>
<p>Verify ulit, note the red text above:<br />
cfgadm –al<br />
SWAP DISK</p>
<p>Undo what has been done….</p>
<p>Configure:<br />
cfgadm -c configure c1::dsk/c1t1d0</p>
<p>format (to label disk)</p>
<p>prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s &#8211; /dev/rdsk/c1t1d0s2</p>
<p>metadb -a –c 2 c1t1d0s7</p>
<p>Attach!!</p>
<p>metainit d32 1 1 c1t1d0s6<br />
metainit d42 1 1 c1t1d0s4<br />
metainit d22 1 1 c1t1d0s1<br />
metainit d12 1 1 c1t1d0s0<br />
metattach d30 d32<br />
metattach d40 d42<br />
metattach d20 d22<br />
metattach d10 d12<br />
metastat -p<br />
metadevadm -u c1t1d0</p>
<p>And you&#8217;re done! Grab a cup of coffee and wait till the synchronization is done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/replacing-a-failed-disk-in-solaris-mirror-svm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Restoring File From UFSdump Backup</title>
		<link>http://www.sysadmindayph.com/blog/restoring-file-from-ufsdump-backup/</link>
		<comments>http://www.sysadmindayph.com/blog/restoring-file-from-ufsdump-backup/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:51:58 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[passwd]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[ufs]]></category>
		<category><![CDATA[ufsbackup]]></category>
		<category><![CDATA[ufsrestore]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=104</guid>
		<description><![CDATA[Here&#8217;s what we did today on one of our Solaris box that is worth mentioning on this cool super system administrator&#8217;s blog &#8216;o mine! (Don&#8217;t you find it cool that SysAds are so funny?!) Anyhoo, today we re-jumpstarted a laboratory box because the &#8216;owner&#8217; of it wants it back. Since we pretty much messed it &#8230; <a href="http://www.sysadmindayph.com/blog/restoring-file-from-ufsdump-backup/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what we did today on one of our Solaris box that is worth mentioning on this cool super system administrator&#8217;s blog &#8216;o mine! (Don&#8217;t you find it cool that SysAds are so funny?!)</p>
<p>Anyhoo, today we re-jumpstarted a laboratory box because the &#8216;owner&#8217; of it wants it back. Since we pretty much messed it up, I have to jumpstarted a fresh copy.</p>
<p>After installing returned the original /etc/shadow and /etc/passwd back from backup (had a backup file on the laptop).. but unfortunately, the /etc/shadow file is &#8216;null&#8217;.</p>
<p><strong>Restoring File From UFSdump Backup</strong></p>
<p>Here&#8217;s the procedure in restoring a particular file from ufs dump backup&#8230; Of course if you&#8217;re restoring from ufs backup you probably made a ufs backup in the first place, right? Right!</p>
<p>In this example, the files backup.examples and junk are restored from the pubs directory:</p>
<p><span id="more-104"></span></p>
<p># cd /var/tmp<br />
# ufsrestore if /dev/rmt/Ø<br />
ufsrestore &gt; ls<br />
.:<br />
lost+found/   pubs/</p>
<p>ufsrestore &gt; cd pubs<br />
ufsrestore &gt; ls<br />
./pubs:<br />
.Xauthority        .login              .profile          backup.examples%<br />
.Xdefaults         .mtdeletelog        .wastebasket/     core<br />
.cshrc             .openwin-init       Junk/             dead.letter<br />
.desksetdefaults   .openwin-init.BAK   backup.examples   junk</p>
<p>ufsrestore &gt; add backup.examples<br />
ufsrestore &gt; add junk<br />
ufsrestore &gt; setmodes<br />
set owner/mode for &#8216;.&#8217;? [yn] n<br />
ufsrestore &gt; extract<br />
You have not read any volumes yet.<br />
Unless you know which volume your file(s) are on you should start<br />
with the last volume and work towards the first.<br />
Specify next volume #: 1<br />
set owner/mode for &#8216;.&#8217;? [yn] n<br />
ufsrestore &gt; quit<br />
# ls -l<br />
total 6<br />
drwxrwxrwt   3 sys      sys          512 Mar 11 1Ø:36 ./<br />
drwxrwxr-x  18 root     sys          512 Mar 1Ø 16:43 ../<br />
drwxr-xr-x   2 pubs     staff        512 Mar 11 1Ø:11 pubs/<br />
# pwd<br />
/var/tmp<br />
# cd pubs<br />
# ls<br />
./                ../               backup.examples   junk<br />
#</p>
<p>There you go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/restoring-file-from-ufsdump-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

