<?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; Solaris</title>
	<atom:link href="http://www.sysadmindayph.com/blog/category/solaris/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>(ufsrestore) Make Bootable &#8211; Recovering the Root or /usr File System</title>
		<link>http://www.sysadmindayph.com/blog/ufsrestore-make-bootable-recovering-the-root-or-usr-file-system/</link>
		<comments>http://www.sysadmindayph.com/blog/ufsrestore-make-bootable-recovering-the-root-or-usr-file-system/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 07:11:47 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=283</guid>
		<description><![CDATA[This is some kind of a followup from the first post about ufsdump &#8211; how to backup solaris filesystem 1. Replace and partition the disk if it has failed. 2. Because the system cannot be booted from the boot disk, boot from the CD-ROM and re-create the failed file system by issuing the newfs command: &#8230; <a href="http://www.sysadmindayph.com/blog/ufsrestore-make-bootable-recovering-the-root-or-usr-file-system/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>This is some kind of a followup from the first post about <a href="http://www.sysadmindayph.com/blog/ufsdump-how-to-backup-solarislinux-root-filesystem/">ufsdump &#8211; how to backup solaris filesystem</a> </p>
<p>1.  Replace and partition the disk if it has failed.</p>
<p>2.  Because the system cannot be booted from the boot disk, boot from the CD-ROM and re-create the failed file system by issuing the newfs command:</p>
<p>newfs /dev/rdsk/<disk-partition-name></p>
<p><disk-partition-name> is the name of the raw disk partition that contains the corrupted file system.</p>
<p>3.  Check the new file system by using fsck:</p>
<p>fsck /dev/rdsk/<disk-partiton-name></p>
<p>4.  Mount the new file system on a temporary mount point:</p>
<p>mount /dev/dsk/<disk-partition-name>/mnt</p>
<p>5.  Change to the /mnt directory:</p>
<p>cd /mnt</p>
<p>6.  Write protect the tapes so that you don&#8217;t accidentally overwrite them.</p>
<p>7.  Load the tape and issue the following command:</p>
<p>ufsrestore rf /dev/rmt/0</p>
<p>The entire content of the tape is restored to the file system. All permissions, ownerships, and dates remain as they were when the last incremental tape was created.</p>
<p>8.  Verify that the file system is restored:</p>
<p>ls</p>
<p>9.  Remove the restoresymtable file that is created and used by ufsrestore to checkpoint the restoration:</p>
<p>rm restoresymtable</p>
<p>10.  Change to the root (/) directory:</p>
<p>cd /</p>
<p>11.  Unmount the newly created file system:</p>
<p>umount /mnt</p>
<p>12.  Check the new file system with fsck:</p>
<p>fsck /dev/rdsk/<disk-partition-name></p>
<p>The restored file system is checked for consistency.</p>
<p>13.  If you are recovering the root (/) file system, create the boot blocks on the root partition by using the installboot command:</p>
<p>installboot  /usr/platform/&#8217;uname-I&#8217;/lib/fs/ufs/bootblk\<br />
 /dev/rdsk/<disk-partition-name></p>
<p>The installboot command installs the boot blocks onto the boot disk. Without the boot blocks, the disk cannot boot.</p>
<p>14.  Insert a new tape into the tape drive and back up the new file system:</p>
<p>ufsdump 0uf /dev/rmt/n /dev/rdsk/<device-name></p>
<p>A level 0 backup is performed. You should immediately make a backup of a newly created file system because ufsrestore repositions the files and changes the inode allocation.</p>
<p>15.  Reboot the system with a reconfiguration reboot:</p>
<p># shutdown -y -g0 -i0<br />
ok boot -r</p>
<p>The system is rebooted.</p>
<h2>Extra Notes on UFSrestore</h2>
<p>When you restore files in a directory other than the root directory of the file system, ufsrestore re-creates the file hierarchy in the current directory. For example, if you restore to /home files that were backed up from /users/bcalkins/files, the files are restored in the directory /home/users/bcalkins/files.</p>
<p>When you restore individual files and directories, it&#8217;s a good idea to restore them to a temporary directory such as /var/tmp. After you verify that you&#8217;ve retrieved the correct files, you can move them to their proper locations. You can restore individual files and directories to their original locations; however, if you do so, you should be sure that you do not overwrite newer files with older versions from the backup tape.</p>
<p>You should not forget to make regular backups of your operating system. Losing all the customization you dosuch as adding user accounts, setting up printers, and installing application softwarewould be disastrous. Whenever you make modifications that affect the root (/),/usr, /opt, or other operating system directories, you should bring down the system into single-user mode and perform a level 0 dump.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/ufsrestore-make-bootable-recovering-the-root-or-usr-file-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Stop syslog Messages to Write Console on Solaris</title>
		<link>http://www.sysadmindayph.com/blog/how-to-stop-syslog-messages-to-write-console-on-solaris/</link>
		<comments>http://www.sysadmindayph.com/blog/how-to-stop-syslog-messages-to-write-console-on-solaris/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 01:52:35 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[syslog console message]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=232</guid>
		<description><![CDATA[How to Stop syslog Messages to Write Console on Solaris you can edit the entries in the /etc/syslog.conf to direct to another file eg /var/log/syslog instead of /dev/console. After that, issue kill -HUP to &#8220;reinitialize&#8221; the config or if you want to stop syslog process/daemon in Solaris 10, (not /etc/init.d/syslog stop) it should be svcadm &#8230; <a href="http://www.sysadmindayph.com/blog/how-to-stop-syslog-messages-to-write-console-on-solaris/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>How to Stop syslog Messages to Write Console on Solaris</p>
<p>you can edit the entries in the /etc/syslog.conf to direct to another file eg /var/log/syslog instead of /dev/console. After that, issue kill -HUP
<pid of syslog daemon> to &#8220;reinitialize&#8221; the config</p>
<p>or if you want to stop syslog process/daemon in Solaris 10, (not /etc/init.d/syslog stop)</p>
<p>it should be</p>
<p>svcadm disable svc:/system/system-log:default</p>
<p>svcadm disable svc:/system/system-log:default turned syslog off you need to also run svcadm enable svc:/system/system-log:default to turn it back on, after you made the right changes to /etc/syslog.conf so it does what you want. You can probably just comment out the line as it is also logged to file in /var/adm/messages.log</p>
<p>Turning syslog off is not a good idea.</p>
<p>That&#8217;s is How to Stop syslog Messages to Write Console on Solaris.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/how-to-stop-syslog-messages-to-write-console-on-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Run or Execute Explorer in Solaris</title>
		<link>http://www.sysadmindayph.com/blog/how-to-run-or-execute-explorer-in-solaris/</link>
		<comments>http://www.sysadmindayph.com/blog/how-to-run-or-execute-explorer-in-solaris/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 01:19:19 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[explorer output]]></category>
		<category><![CDATA[how to execute explorer]]></category>
		<category><![CDATA[how to run explorer]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=230</guid>
		<description><![CDATA[Here&#8217;s the common way to run explorer.. first time run this: # /opt/SUNWexplo/bin/explorer -g from then on, run this; # /opt/SUNWexplo/bin/explorer there are many options to explorer for certain things, but just by itself should get you most of what you need. just want to repeat that for retention: You can run /opt/SUNWexplo/bin/explorer. The first &#8230; <a href="http://www.sysadmindayph.com/blog/how-to-run-or-execute-explorer-in-solaris/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the common way to run explorer..</p>
<p>first time run this:</p>
<p># /opt/SUNWexplo/bin/explorer -g</p>
<p>from then on, run this;</p>
<p># /opt/SUNWexplo/bin/explorer</p>
<p>there are many options to explorer for certain things, but just by itself should get you most of what you need.</p>
<p>just want to repeat that for retention:</p>
<p>You can run /opt/SUNWexplo/bin/explorer. The first time you need to input some info (or just press enter). You&#8217;ll find the ouput in /opt/SUNWexplo/output. </p>
<p>Explorer download and installation:</p>
<p><a href="http://docs.sun.com/app/docs/doc/819-6614/6n8k8pjc5?l=en&#038;a=view">http://docs.sun.com/app/docs/doc/819-6614/6n8k8pjc5?l=en&#038;a=view</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/how-to-run-or-execute-explorer-in-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris Kernel Patching Recommended Patch</title>
		<link>http://www.sysadmindayph.com/blog/solaris-kernel-patching-recommended-patch/</link>
		<comments>http://www.sysadmindayph.com/blog/solaris-kernel-patching-recommended-patch/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 05:48:25 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[10_recommended patch]]></category>
		<category><![CDATA[breaking mirror]]></category>
		<category><![CDATA[howto kernel patch]]></category>
		<category><![CDATA[kernel patch]]></category>
		<category><![CDATA[solaris kernel patching]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=223</guid>
		<description><![CDATA[Here&#8217;s another Kernel patching of Solaris. I know there are tons of this type of post in the internet but another reference for the one who needs it, is I guess ok. To be honest, this is the steps that really made me understood the steps and procedure and the concept behind the 10_Recommended patch &#8230; <a href="http://www.sysadmindayph.com/blog/solaris-kernel-patching-recommended-patch/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another Kernel patching of Solaris. I know there are tons of this type of post in the internet but another reference for the one who needs it, is I guess ok.</p>
<p>To be honest, this is the steps that really made me understood the steps and procedure and the concept behind the 10_Recommended patch for solaris kernel.</p>
<p><span id="more-223"></span></p>
<p>So, here it is:</p>
<p><strong>Check Boot Disk</strong></p>
<p>This step is to check which disks are the member of the boot mirror. We can say that this is the check disk mirror / disk membership step</p>
<p><code><br />
# df -h /<br />
Filesystem             size   used  avail capacity  Mounted on<br />
/dev/md/dsk/d0          33G   7.3G    25G    23%    /<br />
#<br />
# metastat -c d0<br />
d0               m   33GB d10 d20<br />
    d10          s   33GB c1t0d0s0<br />
    d20          s   33GB c1t1d0s0</p>
<p></code></p>
<p>As you can see, there are two disk that comprise the boot mirror (d0), 33GB c1t0d0s0 and c1t1d0s0, which is named d10 and d20 respectively</p>
<p><strong>Check which disk is booting up</strong></p>
<p>In this step, we will determine which of the disk are the one being use as the boot default boot disk.</p>
<p>Usually it&#8217;s the default &#8216;disk&#8217; or &#8216;disk0&#8242;, but there are times, very rare, that &#8216;disk1&#8242; is set as the default boot disk.</p>
<p>To know which disk is the one that boot up the system, you can use the eeprom command in the system shell:</p>
<p><code><br />
# eeprom boot-device<br />
boot-device=disk0<br />
</code></p>
<p>In this case, it&#8217;s the most common disk that is used as the boot disk &#8211; disk0. That means, when can detach the other disk as backup just in case the patching screw up.</p>
<p><strong>Check The Bootability of the Backup Disk</strong></p>
<p>Prior to patching, check if the other disk is booting. This is a precaution. Just in case the patching went sour, we know that we can always revert to a good disk, revert to the previous good booting condition of the server.</p>
<p>Since from the previous step, we know that the default boot disk is &#8216;disk0&#8242;, we will switch to &#8216;disk1&#8242; and try to reboot the server and see if it will come up.</p>
<p>Now, there are two ways to set the value of the &#8216;boot-device&#8217; paramter of the server. You can either set it at the system shell, or through the Boot PROM, depending on where you are at the moment.</p>
<p>Now, set the default boot disk to &#8216;disk1&#8242;</p>
<p><code><a href="http://docs.sun.com/app/docs/doc/819-2379/bootdevice-change?a=view">eeprom boot-device=disk1</a></code></p>
<p>or</p>
<p><code><a href="http://docs.sun.com/app/docs/doc/805-7228/6j6q7uepp?a=view">set boot-device=disk1</a></code></p>
<p>After setting it up, reboot the server:</p>
<p>init 0 then boot </p>
<p>or </p>
<p>init 6</p>
<p>If you&#8217;re successfull, you just  booted on the &#8216;other half&#8217; of the bootdisk.</p>
<p>Now, don&#8217;t forget to switch back to disk0 !!!</p>
<p>Next, (optional&#8230; can differ from company to company)</p>
<p><code># untar the patch file<br />
cd /var/tmp<br />
rm -rf PatchDir<br />
mkdir PatchDir<br />
mv S10KernelUpdate4.0.tar.gz PatchDir<br />
cd PatchDir<br />
gunzip -c S10KernelUpdate4.0.tar.gz|tar xf -</code></p>
<p><strong>Splitting the Mirror</strong></p>
<p>The next steps are the meat of the procedure. This is the patching of the kernel itself.. But of course, after checking the boot disk &#8211; whether the both disks are good- it&#8217;s time to break the mirror and patch one disk.</p>
<p>sync;metadeatch</p>
<p>detach the backup disk</p>
<p>metadetach d0 d20</p>
<p># mount the detached root file system to root and modify these</p>
<p>mount /dev/dsk/c1t1d0s0 /mnt</p>
<p>vi /mnt/etc/vfstab<br />
vi /mnt/etc/system</p>
<p>Modifying vsfstab and /etc/system of the detached disk will make sure that if the patching fail, we can alyas boot up to the backup disk.</p>
<p><strong>Start Patching</strong></p>
<p># go to single user mode<br />
sync;sync;init 0</p>
<p>init -s</p>
<p>Rebooting with command: boot -s<br />
Boot device: /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0  File and args: -s<br />
SunOS Release 5.10 Version Generic_141414-02 64-bit<br />
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.<br />
Use is subject to license terms.</p>
<p>&#8230; You then follow the ReadMe document that comes with the Patch here.</p>
<p>Once the patching is done, you&#8217;ll see the difference of the patch level of the kernel.</p>
<p>Boot device: disk0  File and args:<br />
SunOS Release 5.10 Version Generic_<strong>142900</strong>-02 64-bit<br />
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.<br />
Use is subject to license terms.</p>
<p>Optional<br />
=&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
For more installation messages refer to the installation logfile:<br />
  /var/sadm/install_data/PMGT:_TLP-Set_Solaris_10_SOE_S10KernelUpdate4.1_A1_04_27_10</p>
<p>Use &#8216;/usr/bin/showrev -p&#8217; or &#8216;/usr/sbin/patchadd -p&#8217; to verify<br />
installed patch-ids.<br />
Refer to individual patch README files for more patch detail.<br />
Rebooting the system is usually necessary after installation.<br />
svc.startd: The system is coming down.  Please wait.<br />
svc.startd: 20 system services are now being stopped.</p>
<p>!!! Please read the logfile for any required action before rebooting !<br />
&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>reboot:! for the bank, it&#8217;s automatic</p>
<p>If all is good, you can reattach the other disk</p>
<p>metattach d0 d20</p>
<p>And you&#8217;re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/solaris-kernel-patching-recommended-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>SSH Tectia: Setup Public-Key Authentication</title>
		<link>http://www.sysadmindayph.com/blog/ssh-tectia-setup-public-key-authentication/</link>
		<comments>http://www.sysadmindayph.com/blog/ssh-tectia-setup-public-key-authentication/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 03:14:04 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[public key authentication]]></category>
		<category><![CDATA[public-key]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh tectia]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=203</guid>
		<description><![CDATA[A quick post on how to setup a public-key authentication on an SSH client server, product by SSH Tectia. Summary: User instruction on how to setup public-key authentication. In setting up the ssh public-key authentication between servers, local and remote, we have to generate the key pairs and transfer it to the remote/server. Client Side &#8230; <a href="http://www.sysadmindayph.com/blog/ssh-tectia-setup-public-key-authentication/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>A quick post on how to setup a public-key authentication on an SSH client server, product by SSH Tectia.</p>
<p>Summary: User instruction on how to setup public-key authentication.</p>
<p>In setting up the ssh public-key authentication between servers, local and remote, we have to generate the key pairs and transfer it to the remote/server.</p>
<p><strong>Client Side</strong></p>
<p>The publickey authentication method is enabled by the SSHtectia package by default. A functional ID&#8217;s key pair can be generated using the &#8216;generate_keys&#8217; script (may be located in /export/opt/SSHtectia/<version>/util/ or depending on your installation). That script, &#8216;generate_keys&#8217;, is use to generate user key pairs: id_dsa_2048_a and id_dsa_2048_a.pub (default names) in the centralized key location:</p>
<p>/etc/opt/SSHtectia/keys/<login ID></p>
<p>The script also creates an &#8216;identification&#8217; file in /etc/opt/SSHtectial/keys/<login ID> that contains the name of the private keys:</p>
<p># more identification<br />
# SSH Tectia private key<br />
IdKey /etc/opt/SSHtectia/keys/%U/id_dsa_2048_a</p>
<p># OpenSSH private key<br />
IdKey /etc/opt/SSHtectia/keys/%U/id_dsa</p>
<p>Don&#8217;t forget to substitute the private key filename for &#8216;id_dsa_2048_a&#8217; or &#8216;id_dsa&#8217; if you are using a different naming convention. If several key pairs are used, list private keys on a separate lines.</p>
<p><strong>Server Side</strong></p>
<p>The publickey authentication method is enabled for functional IDs ONLY by the SSHtectia package (how do we know if an account is such?). </p>
<p>Copy the public key file (i.e. id_dsa_2048_a.pub) to the server, to the centralized key location. You can use sftp, copy paste or any other method to do this.</p>
<p>Also copy the &#8216;authorization&#8217; file (created by the &#8216;generate_keys&#8217; script) from the cliet to the server&#8217;s centralized key location. </p>
<p>Test the connection.. it should work.. It worked on mine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/ssh-tectia-setup-public-key-authentication/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>Metastat Needs Maintenance Metareplace</title>
		<link>http://www.sysadmindayph.com/blog/metastat-needs-maintenance-metareplace/</link>
		<comments>http://www.sysadmindayph.com/blog/metastat-needs-maintenance-metareplace/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 16:41:57 +0000</pubDate>
		<dc:creator>elizar</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[meta device]]></category>
		<category><![CDATA[metareplace]]></category>
		<category><![CDATA[metastat]]></category>
		<category><![CDATA[svm]]></category>
		<category><![CDATA[volume manager]]></category>

		<guid isPermaLink="false">http://www.sysadmindayph.com/blog/?p=174</guid>
		<description><![CDATA[Guilty! Putting all those Metastat keywords on one subject, that&#8217;s me! ANyway, I don&#8217;t want to stale this blog so once in a while I&#8217;m going to be posting some bits and pieces of Unix tools/tips.. and here&#8217;s a new one about SVM&#8230; Responding to Disk Errors courtesy of BigAdmin! Got a page.. something like &#8230; <a href="http://www.sysadmindayph.com/blog/metastat-needs-maintenance-metareplace/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>Guilty! Putting all those Metastat keywords on one subject, that&#8217;s me! ANyway, I don&#8217;t want to stale this blog so once in a while I&#8217;m going to be posting some bits and pieces of Unix tools/tips.. and here&#8217;s a new one about SVM&#8230; Responding to Disk Errors courtesy of BigAdmin!</p>
<p><span id="more-174"></span></p>
<p>Got a page.. something like &#8220;Fault found by metastat&#8221; in short description in Remedy&#8230; </p>
<p><code># metastat | grep Need<br />
      State: Needs maintenance<br />
    State: Needs maintenance </code></p>
<p>Which disk?</p>
<p><code># metastat d9<br />
d9: Mirror<br />
    Submirror 0: d19<br />
      State: Needs maintenance<br />
    Submirror 1: d29<br />
      State: Okay<br />
    Pass: 1<br />
    Read option: roundrobin (default)<br />
    Write option: parallel (default)<br />
    Size: 134221440 blocks (64 GB)</p>
<p><strong>d19: Submirror of d9</strong><br />
    State: Needs maintenance<br />
    Invoke: metareplace d9 c0t2d0s5 <new device><br />
    Size: 134221440 blocks (64 GB)<br />
    Stripe 0:<br />
        <strong>Device </strong>    Start Block  Dbase        State Reloc Hot Spare<br />
        <strong>c0t2d0s5</strong>          0     No     Maintenance   Yes </p>
<p>d29: Submirror of d9<br />
    State: Okay<br />
    Size: 134221440 blocks (64 GB)<br />
    Stripe 0:<br />
        Device     Start Block  Dbase        State Reloc Hot Spare<br />
        c0t3d0s5          0     No            Okay   Yes </p>
<p>Device Relocation Information:<br />
Device   Reloc  Device ID<br />
c0t2d0   Yes    id1,sd@SSEAGATE_ST373307LSUN72G_3HZ6Y1EN000074312CVW<br />
c0t3d0   Yes    id1,sd@SSEAGATE_ST373307LSUN72G_3HZ6Y46Y0000743249BK<br />
</code></p>
<p>Check for hard errors to verify if this disk can really be replaced&#8230; if it passed (on your criteria), you can try re-syncing it&#8230;</p>
<p><code>c# metareplace -e  d9 c0t2d0s5<br />
d9: device c0t2d0s5 is enabled</code></p>
<p>Verify that it&#8217;s doing what it is expected..</p>
<p><code># metastat d9<br />
d9: Mirror<br />
    Submirror 0: d19<br />
      State: Resyncing<br />
    Submirror 1: d29<br />
      State: Okay<br />
    Resync in progress: 0 % done<br />
    Pass: 1<br />
    Read option: roundrobin (default)<br />
    Write option: parallel (default)<br />
    Size: 134221440 blocks (64 GB)</p>
<p></code></p>
<p>And we wait&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadmindayph.com/blog/metastat-needs-maintenance-metareplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

