<?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>UtahSysAdmin.com &#187; Technical</title>
	<atom:link href="http://www.utahsysadmin.com/category/Technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.utahsysadmin.com</link>
	<description>Ramblings of a Utah System Administrator</description>
	<lastBuildDate>Mon, 25 Jan 2010 18:16:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add hard drive to extend existing LVM volume</title>
		<link>http://www.utahsysadmin.com/2009/12/08/add-hard-drive-to-extend-lvm/</link>
		<comments>http://www.utahsysadmin.com/2009/12/08/add-hard-drive-to-extend-lvm/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 18:09:05 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=204</guid>
		<description><![CDATA[Previously I posted how to add a hard drive and create a new volume in LVM.  This time we&#8217;ll add a new hard drive and then increase or extend the size of an existing volume or partition.  This is an example using an RHEL 5 derivative, OEL 5.  The server is really [...]]]></description>
			<content:encoded><![CDATA[<p>Previously I posted <a href="http://www.utahsysadmin.com/2008/10/10/add-a-hard-drive-in-linux-with-lvm/">how to add a hard drive and create a new volume in LVM</a>.  This time we&#8217;ll add a new hard drive and then increase or extend the size of an existing volume or partition.  This is an example using an RHEL 5 derivative, OEL 5.  The server is really a VM inside VMware vSphere 4, but that is of no consequence to what we are doing.</p>
<p>In this example, we have an existing /data partition of 350 GB.  Well, it&#8217;s just not big enough, so we&#8217;ll add another 100 GB hard drive and give it to the /data partition.</p>
<p>After adding the 100 GB hard drive to the VM through vCenter, connect to the server through SSH or the console.  Here&#8217;s the existing setup:</p>
<blockquote><p># df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00<br />
7.7G  2.2G  5.2G  30% /<br />
/dev/sda1              99M   24M   71M  26% /boot<br />
tmpfs                 1.5G     0  1.5G   0% /dev/shm<br />
<strong>/dev/mapper/VolGroup01-LogVol00<br />
345G   15G  313G   5% /data</strong></p></blockquote>
<blockquote><p># cat /proc/scsi/scsi<br />
Attached devices:<br />
Host: scsi0 Channel: 00 Id: 00 Lun: 00<br />
Vendor: VMware   Model: Virtual disk     Rev: 1.0<br />
Type:   Direct-Access                    ANSI SCSI revision: 02<br />
Host: scsi0 Channel: 00 Id: 01 Lun: 00<br />
Vendor: VMware   Model: Virtual disk     Rev: 1.0<br />
Type:   Direct-Access                    ANSI SCSI revision: 02</p></blockquote>
<p>First we tell Linux to find the new drive in the correct location:</p>
<blockquote><p># echo &#8220;scsi add-single-device 0 0 2 0&#8243; &gt; /proc/scsi/scsi</p></blockquote>
<p>Now we see the new drive has been detected:</p>
<blockquote><p># cat /proc/scsi/scsi<br />
Attached devices:<br />
Host: scsi0 Channel: 00 Id: 00 Lun: 00<br />
Vendor: VMware   Model: Virtual disk     Rev: 1.0<br />
Type:   Direct-Access                    ANSI SCSI revision: 02<br />
Host: scsi0 Channel: 00 Id: 01 Lun: 00<br />
Vendor: VMware   Model: Virtual disk     Rev: 1.0<br />
Type:   Direct-Access                    ANSI SCSI revision: 02<br />
Host: scsi0 Channel: 00 Id: 02 Lun: 00<br />
Vendor: VMware   Model: Virtual disk     Rev: 1.0<br />
Type:   Direct-Access                    ANSI SCSI revision: 02</p></blockquote>
<p>If we check fdisk, we see the new drive is blank like we expect:</p>
<blockquote><p># fdisk -l</p>
<p>Disk /dev/sda: 12.8 GB, 12884901888 bytes<br />
255 heads, 63 sectors/track, 1566 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14        1566    12474472+  8e  Linux LVM</p>
<p>Disk /dev/sdb: 375.8 GB, 375809638400 bytes<br />
255 heads, 63 sectors/track, 45689 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1       45689   366996861   83  Linux</p>
<p>Disk /dev/sdc: 107.3 GB, 107374182400 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p><strong>Disk /dev/sdc doesn&#8217;t contain a valid partition table</strong></p></blockquote>
<p>So let&#8217;s give it a partition:</p>
<blockquote><p># fdisk /dev/sdc<br />
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel<br />
Building a new DOS disklabel. Changes will remain in memory only,<br />
until you decide to write them. After that, of course, the previous<br />
content won&#8217;t be recoverable.</p>
<p>The number of cylinders for this disk is set to 13054.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
(e.g., DOS FDISK, OS/2 FDISK)<br />
Warning: invalid flag 0&#215;0000 of partition table 4 will be corrected by w(rite)</p>
<p>Command (m for help): <strong>n</strong><br />
Command action<br />
e   extended<br />
p   primary partition (1-4)<br />
<strong>p</strong><br />
Partition number (1-4): <strong>1</strong><br />
First cylinder (1-13054, <strong>default 1</strong>):<br />
Using default value 1<br />
Last cylinder or +size or +sizeM or +sizeK (1-13054, <strong>default 13054</strong>):<br />
Using default value 13054</p>
<p>Command (m for help): <strong>p</strong></p>
<p>Disk /dev/sdc: 107.3 GB, 107374182400 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdc1               1       13054   104856223+  83  Linux</p>
<p>Command (m for help): <strong>w</strong><br />
The partition table has been altered!</p>
<p>Calling ioctl() to re-read partition table.<br />
Syncing disks.</p></blockquote>
<p>Fdisk now confirms that everything looks good:</p>
<blockquote><p># fdisk -l</p>
<p>Disk /dev/sda: 12.8 GB, 12884901888 bytes<br />
255 heads, 63 sectors/track, 1566 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14        1566    12474472+  8e  Linux LVM</p>
<p>Disk /dev/sdb: 375.8 GB, 375809638400 bytes<br />
255 heads, 63 sectors/track, 45689 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1       45689   366996861   83  Linux</p>
<p><strong>Disk /dev/sdc: 107.3 GB, 107374182400 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</strong></p>
<p><strong> Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdc1               1       13054   104856223+  83  Linux</strong></p></blockquote>
<p>Verify that LVM can see the drive:</p>
<blockquote><p># lvmdiskscan<br />
&#8230;skip&#8230;<br />
/dev/sdc1                [      100.00 GB]<br />
&#8230;skip&#8230;</p></blockquote>
<p>Create a physical volume within LVM:</p>
<blockquote><p># pvcreate /dev/sdc1<br />
Physical volume &#8220;/dev/sdc1&#8243; successfully created</p></blockquote>
<p>Add/Extend this physical volume to the volume group:</p>
<blockquote><p># vgextend VolGroup01 /dev/sdc1<br />
Volume group &#8220;VolGroup01&#8243; successfully extended</p></blockquote>
<p>Extend the logical volume to use the full size of the volume group:</p>
<blockquote><p># lvm lvextend -l +100%FREE /dev/VolGroup01/LogVol00<br />
Extending logical volume LogVol00 to 449.99 GB<br />
Logical volume LogVol00 successfully resized</p></blockquote>
<p>Actually resize the partition for the OS to recognize the new size:</p>
<blockquote><p># resize2fs -p /dev/mapper/VolGroup01-LogVol00<br />
resize2fs 1.39 (29-May-2006)<br />
Filesystem at /dev/mapper/VolGroup01-LogVol00 is mounted on /data; on-line resizing required<br />
Performing an on-line resize of /dev/mapper/VolGroup01-LogVol00 to 117961728 (4k) blocks.<br />
The filesystem on /dev/mapper/VolGroup01-LogVol00 is now 117961728 blocks long.</p></blockquote>
<p>And the new drive space is now available to the user, who is already busy filling it:</p>
<blockquote><p># df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00<br />
7.7G  2.2G  5.2G  30% /<br />
/dev/sda1              99M   24M   71M  26% /boot<br />
tmpfs                 1.5G     0  1.5G   0% /dev/shm<br />
/dev/mapper/VolGroup01-LogVol00<br />
443G   48G  373G  12% /data</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/12/08/add-hard-drive-to-extend-lvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Windows Telnet</title>
		<link>http://www.utahsysadmin.com/2009/09/24/fixing-windows-telnet/</link>
		<comments>http://www.utahsysadmin.com/2009/09/24/fixing-windows-telnet/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 04:20:19 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=195</guid>
		<description><![CDATA[Breaking with tradition and posting something about Windows again&#8230;.
One thing that I have always hated about using a Windows PC is when I pull up a command prompt to telnet to a mail server or something to test.  If you&#8217;ve ever tried this you know what I&#8217;m talking about &#8211; you can&#8217;t see what you [...]]]></description>
			<content:encoded><![CDATA[<p>Breaking with tradition and posting something about Windows again&#8230;.</p>
<p>One thing that I have always hated about using a Windows PC is when I pull up a command prompt to telnet to a mail server or something to test.  If you&#8217;ve ever tried this you know what I&#8217;m talking about &#8211; you can&#8217;t see what you are typing!  It&#8217;s not that bad, if you type perfectly all the time, but I do not.  Well, I was looking something up on MSDN today and happened to stumble upon this gem:  &#8220;set localecho&#8221;.  You have to specify it within the telnet prompt &#8211; you can&#8217;t specify it in one line on the command prompt, but at least it&#8217;s something.</p>
<p>From the command prompt, type just telnet, instead of the full line:</p>
<blockquote><p>&gt; telnet</p></blockquote>
<p>Type in set localecho and then open the server port that you want:</p>
<blockquote><p>telnet&gt; set localecho<br />
telnet&gt; open mailserver.domainname.com 25</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/09/24/fixing-windows-telnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete multiple files that contain spaces based on age</title>
		<link>http://www.utahsysadmin.com/2009/07/17/delete-multiple-files-that-contain-spaces-based-on-age/</link>
		<comments>http://www.utahsysadmin.com/2009/07/17/delete-multiple-files-that-contain-spaces-based-on-age/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 08:36:58 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=191</guid>
		<description><![CDATA[I had a problem on a FTP server running Solaris 9 that had tons of old files and many of them had spaces in the names.  How do you automate removing the old files (the real concern being the spaces in the filenames)?  Most solutions recommend using -print0 in find or xargs -0, [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem on a FTP server running Solaris 9 that had tons of old files and many of them had spaces in the names.  How do you automate removing the old files (the real concern being the spaces in the filenames)?  Most solutions recommend using -print0 in find or xargs -0, neither of which are options in Solaris 9.</p>
<p>This command removes any files older then 2 years old in the current directory:</p>
<blockquote><p>find . -type f -mtime +730 | while read filename; do rm -f &#8220;$filename&#8221;; done</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/07/17/delete-multiple-files-that-contain-spaces-based-on-age/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Drive to a Veritas Disk Group</title>
		<link>http://www.utahsysadmin.com/2009/05/25/adding-drive-veritas-disk-group/</link>
		<comments>http://www.utahsysadmin.com/2009/05/25/adding-drive-veritas-disk-group/#comments</comments>
		<pubDate>Mon, 25 May 2009 15:25:37 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=180</guid>
		<description><![CDATA[Last time I showed you how to add a new drive to make a new disk group.  Well, what if you already have a disk group, with just one drive on it and you want to mirror that data across another drive?  The process is easy and here&#8217;s how:
Let&#8217;s start off with a [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I showed you how to <a href="http://www.utahsysadmin.com/2009/05/24/create-new-veritas-disk-group/">add a new drive to make a new disk group</a>.  Well, what if you already have a disk group, with just one drive on it and you want to mirror that data across another drive?  The process is easy and here&#8217;s how:</p>
<p>Let&#8217;s start off with a simple disk group:</p>
<blockquote><p># vxprint<br />
Disk group: tempdg-tmp</p>
<p>TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0<br />
dg tempdg-tmp   tempdg-tmp   &#8211;        &#8211;        &#8211;        &#8211;        &#8211;       -</p>
<p>dm tempdg-tmp02 emcpower1s2  &#8211;        733975296 &#8211;       &#8211;        &#8211;       -</p>
<p>v  templv-tmp   fsgen        ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
pl templv-tmp-02 templv-tmp  ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
sd tempdg-tmp02-01 templv-tmp-02 ENABLED 733975296 0    &#8211;        &#8211;       -</p></blockquote>
<p>This shows the disk group&#8217;s name is tempdg-tmp, the original disk in the group is called tempdg-tmp02, the logical volume is called templv-tmp, which is made up of one plex called templv-tmp-02, which has one subdisk called tempdg-tmp02-01.</p>
<p>So, let&#8217;s add an additional disk tempdg-tmp01 and use it to mirror the data on tempdg-tmp02.  If we look first at how the device is setup for the original drive we see that it is using cdsdisk format:</p>
<p># vxdisk -o alldgs list<br />
DEVICE       TYPE            DISK         GROUP        STATUS<br />
emcpower1s2  auto:cdsdisk    tempdg-tmp02  tempdg-tmp   online</p>
<p>So let&#8217;s make our new device cdsdisk formatted as well:</p>
<blockquote><p># vxdisk -o alldgs list<br />
DEVICE       TYPE            DISK         GROUP        STATUS<br />
emcpower6s2  auto:none       &#8211;            &#8211;            online invalid</p>
<p># /etc/vx/bin/vxdisksetup -i emcpower6 format=cdsdisk</p>
<p># vxdisk -o alldgs list<br />
DEVICE       TYPE            DISK         GROUP        STATUS<br />
emcpower6s2  auto:cdsdisk    &#8211;            &#8211;            online</p></blockquote>
<p>Now to add the new disk to the disk group.  Note that since the original drive was called 02, the one we are adding is 01:</p>
<blockquote><p># vxdg -g tempdg-tmp adddisk tempdg-tmp01=emcpower6</p></blockquote>
<p>Now we can see the new drive in the disk group (and that it isn&#8217;t currently doing anything):</p>
<blockquote><p># vxprint<br />
Disk group: tempdg-tmp</p>
<p>TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0<br />
dg tempdg-tmp   tempdg-tmp   &#8211;        &#8211;        &#8211;        &#8211;        &#8211;       -</p>
<p>dm tempdg-tmp01 emcpower6s2  &#8211;        733975296 &#8211;       &#8211;        &#8211;       -<br />
dm tempdg-tmp02 emcpower1s2  &#8211;        733975296 &#8211;       &#8211;        &#8211;       -</p>
<p>v  templv-tmp   fsgen        ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
pl templv-tmp-02 templv-tmp  ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
sd tempdg-tmp02-01 templv-tmp-02 ENABLED 733975296 0    &#8211;        &#8211;       -</p></blockquote>
<p>So let&#8217;s tell the disk group to set tempdg-tmp01 up as a mirror of tempdg-tmp02:</p>
<blockquote><p># vxassist -g tempdg-tmp mirror templv-tmp tempdg-tmp01 &#038;</p></blockquote>
<p>I ran it in the background because it can take a long time depending on how big it is (about 2 hours for 350 GB).  To watch the mirroring process, use vxtask.  (You can also use vxprint to see what it is doing.)</p>
<blockquote><p># vxtask list<br />
TASKID  PTID TYPE/STATE    PCT   PROGRESS<br />
   177           ATCOPY/R 04.89% 0/733975296/35921920 PLXATT templv-tmp templv-tmp-01 tempdg-tmp</p></blockquote>
<p>Once it completes, you will see your new drive setup as a mirror:</p>
<blockquote><p># vxprint<br />
Disk group: tempdg-tmp</p>
<p>TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0<br />
dg tempdg-tmp   tempdg-tmp   &#8211;        &#8211;        &#8211;        &#8211;        &#8211;       -</p>
<p>dm tempdg-tmp01 emcpower6s2  &#8211;        733975296 &#8211;       &#8211;        &#8211;       -<br />
dm tempdg-tmp02 emcpower1s2  &#8211;        733975296 &#8211;       &#8211;        &#8211;       -</p>
<p>v  templv-tmp   fsgen        ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
pl templv-tmp-02 templv-tmp  ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
sd tempdg-tmp02-01 templv-tmp-02 ENABLED 733975296 0    &#8211;        &#8211;       -<br />
pl templv-tmp-01 templv-tmp  ENABLED  733975296 &#8211;       ACTIVE   &#8211;       -<br />
sd tempdg-tmp01-01 templv-tmp-01 ENABLED 733975296 0    &#8211;        &#8211;       -</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/05/25/adding-drive-veritas-disk-group/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create new Veritas Disk Group</title>
		<link>http://www.utahsysadmin.com/2009/05/24/create-new-veritas-disk-group/</link>
		<comments>http://www.utahsysadmin.com/2009/05/24/create-new-veritas-disk-group/#comments</comments>
		<pubDate>Mon, 25 May 2009 04:48:16 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=170</guid>
		<description><![CDATA[Earlier I posted about how to add a new LUN to a Solaris 9 server.  Today I&#8217;ll go through the process of adding that disk (emcpower6) to a new disk group and making it usable with a file system.  This server has EMC Powerpath installed as well as the Veritas Storage Foundation running [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier I posted about how to <a href="http://www.utahsysadmin.com/2009/05/15/new-lun-solaris9-vxfs-powerpath/">add a new LUN to a Solaris 9 server</a>.  Today I&#8217;ll go through the process of adding that disk (emcpower6) to a new disk group and making it usable with a file system.  This server has EMC Powerpath installed as well as the Veritas Storage Foundation running on it.</p>
<p>First, setup the disk inside Veritas, in this example I&#8217;ll use the sliced format (emcpower6 is the Veritas Device name &#8211; not the PowerPath pseudo name &#8211; use vxdisk list to see the name):</p>
<blockquote><p># /etc/vx/bin/vxdisksetup -i emcpower6 format=sliced</p></blockquote>
<p>Initiate the disk group by adding the disk to a new group (tempdg-tmp).  The device name is emcpower6 and the name of the disk inside the disk group will be called tempdg-tmp01:</p>
<blockquote><p># vxdg init tempdg-tmp cds=off tempdg-tmp01=emcpower6</p></blockquote>
<p>See how big we can make the disk group:</p>
<blockquote><p># vxassist -g tempdg-tmp maxsize<br />
Maximum volume size: 733952000 (358375Mb)</p></blockquote>
<p>Setup the disk group to the maximum size (templv-tmp is the logical volume name):</p>
<blockquote><p># vxassist -g tempdg-tmp -b make templv-tmp 733952000 tempdg-tmp01 layout=nostripe</p></blockquote>
<p>At this point you can take a look at what you created with vxprint:</p>
<blockquote><p># vxprint<br />
Disk group: tempdg-tmp</p>
<p>TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0<br />
dg tempdg-tmp    tempdg-tmp    &#8211;        &#8211;        &#8211;        &#8211;        &#8211;       -</p>
<p>dm tempdg-tmp01  emcpower6s2  &#8211;        733952000 &#8211;       &#8211;        &#8211;       -</p>
<p>v  templv-tmp    fsgen        ENABLED  733952000 &#8211;       ACTIVE   &#8211;       -<br />
pl templv-tmp-01 templv-tmp    ENABLED  733952000 &#8211;       ACTIVE   &#8211;       -<br />
sd tempdg-tmp01-01 templv-tmp-01 ENABLED 733952000 0      &#8211;        &#8211;       -</p></blockquote>
<p>Create a file system on the logical volume, using VXFS:</p>
<blockquote><p># /opt/VRTS/bin/mkfs -F vxfs /dev/vx/rdsk/tempdg-tmp/templv-tmp<br />
    version 6 layout<br />
    733952000 sectors, 366976000 blocks of size 1024, log size 65536 blocks<br />
    largefiles supported</p></blockquote>
<p>Create a mount point, mount it, see it mounted:</p>
<blockquote><p># mkdir /u2</p>
<p># mount -F vxfs /dev/vx/dsk/tempdg-tmp/templv-tmp /u2</p>
<p># df -h /u2<br />
Filesystem             size   used  avail capacity  Mounted on<br />
/dev/vx/dsk/tempdg-tmp/templv-tmp                       350G   153M   328G     1%    /u2</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/05/24/create-new-veritas-disk-group/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding a new LUN on Solaris 9 with VXFS and PowerPath</title>
		<link>http://www.utahsysadmin.com/2009/05/15/new-lun-solaris9-vxfs-powerpath/</link>
		<comments>http://www.utahsysadmin.com/2009/05/15/new-lun-solaris9-vxfs-powerpath/#comments</comments>
		<pubDate>Fri, 15 May 2009 21:41:37 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=159</guid>
		<description><![CDATA[There&#8217;s not a lot of documentation out there on working with LUNs on servers that use both Veritas Storage Foundation and EMC PowerPath.  I have spent the last few weeks perfecting the process of Dynamic LUN Expansion and will be adding more posts about that process in the near future.  Most recently I [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s not a lot of documentation out there on working with LUNs on servers that use both Veritas Storage Foundation and EMC PowerPath.  I have spent the last few weeks perfecting the process of Dynamic LUN Expansion and will be adding more posts about that process in the near future.  Most recently I have been working on Solaris 9 servers connected to an EMC Clariion CX500 SAN that have LUNs mounted using the VXFS (Veritas) file system (version 4.1,REV=4.1B18_sol_GA_s10b74L2a) using EMC PowerPath (version 4.5.0_b169).  The servers have Qlogic HBAs so I use their utilities to scan the Fibre Channel paths.  If you have a different HBA, use that vendor&#8217;s tools.</p>
<p>This setup, although not unusual, does make it more complicated.  When a new LUN is connected to the host, by default, Veritas will see it first and claim the drive.  This is a bad thing, because we want PowerPath to find the drive, setup the pseudo drive and encapsulate the multipathing.</p>
<p>Previous administrators with this setup were unable to get PowerPath to recognize the drive before Veritas without rebooting the server.  They would connect the LUN and reboot the server.  If Veritas detected the drive first, they would remove the disk from Veritas and reboot until PowerPath claimed the drive.  This, of course, to me was unacceptable, so I have decided to document the procedure I follow for properly connecting a new LUN to a host with this configuration.  (Note:  If you have already got yourself in this situation, you will still need to reboot to cleanup Veritas&#8217; hold on the drive.  The alternative to rebooting would be to allocate another LUN for the host and worry about cleaning up the previous one later.)</p>
<p>So how do you get Veritas to not claim the drive when you connect the LUN to the host?  Simple, turn off the service that discovers the drive!  If you dig into the init scripts for Veritas (/etc/init.d/vxvm-startup2), you&#8217;ll see starting on line 193 the following lines:</p>
<blockquote><p># Start Event Source Daemon, to enable dynamic device discovery<br />
# Empty the lock file before starting the daemon<br />
> /etc/vx/.vxesd.lock</p>
<p>vxddladm start eventsource
</p></blockquote>
<p>This dynamic device discovery service must be turned off by executing the following command:</p>
<blockquote><p># vxddladm stop eventsource</p></blockquote>
<p>Of course, if you don&#8217;t want dynamic discovery service running, you should also comment out line 197 so that it is never started in the first place.  I have found that it is necessary to run the stop command multiple times to make sure it is off.  Even if I have stopped it on a particular server before, I run it again before connecting any LUNs, just to make sure.</p>
<p>So here are the steps with sample output if any was generated:</p>
<p>Turn off Veritas dynamic discovery <strong>(IMPORTANT!!)</strong>:</p>
<blockquote><p># vxddladm stop eventsource</p></blockquote>
<p>Rescan your fibre connections, optionally verify that you can see the new LUN:</p>
<blockquote><p># /opt/QLogic_Corporation/SANsurferCLI/scli -do all rescan<br />
Driver rescan completed on HBA instance 0.<br />
Driver rescan completed on HBA instance 1.</p></blockquote>
<p>Tell Solaris you&#8217;ve made some changes and let it make the proper devices:</p>
<blockquote><p># devfsadm -v -C</p></blockquote>
<p>Configure PowerPath to work with the new LUN:</p>
<blockquote><p># /etc/powercf -q<br />
# /etc/powermt config<br />
# /etc/powermt save</p></blockquote>
<p>Check that your new LUN is properly configured in PowerPath:</p>
<blockquote><p># /etc/powermt display dev=all<br />
&#8211; cut &#8211;<br />
Pseudo name=emcpower6a<br />
CLARiiON ID=APM00012345678 [Test Storage Group]<br />
Logical device ID=60060160A42611000A2B03D123456789 [LUN - TEMP LUN]<br />
state=alive; policy=CLAROpt; priority=0; queued-IOs=0<br />
Owner: default=SP A, current=SP A<br />
===============================================<br />
&#8212;&#8212;&#8212;&#8212;&#8212;- Host &#8212;&#8212;&#8212;&#8212;&#8212;   &#8211; Stor &#8211;   &#8212; I/O Path &#8211;  &#8212; Stats &#8212;<br />
### HW Path                 I/O Paths    Interf.   Mode    State  Q-IOs Errors<br />
===============================================<br />
1280 pci@9/fibre-channel@2     c4t1d6s0  SP B0     active  alive      0      0<br />
1280 pci@9/fibre-channel@2     c4t2d6s0  SP A0     active  alive      0      0<br />
1281 pci@9/fibre-channel@2     c5t1d6s0  SP B1     active  alive      0      0<br />
1281 pci@9/fibre-channel@2     c5t2d6s0  SP A1     active  alive      0      0<br />
&#8211; cut &#8211;</p></blockquote>
<p>Now we need to create a label on the drive, use the PowerPath pseudo name:</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>c4t1d6: configured with capacity of 349.99GB<br />
c4t2d6: configured with capacity of 349.99GB<br />
c5t1d6: configured with capacity of 349.99GB<br />
c5t2d6: configured with capacity of 349.99GB<br />
emcpower6a: configured with capacity of 349.99GB</p>
<p>AVAILABLE DISK SELECTIONS:<br />
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424><br />
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w210000008710a5b2,0<br />
&#8211; cut &#8211;<br />
      40. emcpower6a <DGC-RAID5-0224 cyl 57342 alt 2 hd 256 sec 50><br />
          /pseudo/emcp@6<br />
Specify disk (enter its number): 40<br />
selecting emcpower6a<br />
[disk formatted]<br />
Disk not labeled.  Label it now? yes<br />
format> q</p></blockquote>
<p>Get rid of the default partitions created by the label command:</p>
<blockquote><p># fmthard -d 0:00:00:0:0 /dev/rdsk/emcpower6a<br />
# fmthard -d 1:00:00:0:0 /dev/rdsk/emcpower6a<br />
# fmthard -d 6:00:00:0:0 /dev/rdsk/emcpower6a</p></blockquote>
<p>Verify that everything looks the way you want it:</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424><br />
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w210000008710a5b2,0<br />
&#8211; cut &#8211;<br />
      40. emcpower6a <DGC-RAID5-0224 cyl 57342 alt 2 hd 256 sec 50><br />
          /pseudo/emcp@6<br />
Specify disk (enter its number): 40<br />
selecting emcpower6a<br />
[disk formatted]<br />
format> verify</p>
<p>Primary label contents:</p>
<p>Volume name = <        ><br />
ascii name  = <DGC-RAID5-0224 cyl 57342 alt 2 hd 256 sec 50><br />
pcyl        = 57344<br />
ncyl        = 57342<br />
acyl        =    2<br />
nhead       =  256<br />
nsect       =   50<br />
Part      Tag    Flag     Cylinders         Size            Blocks<br />
  0 unassigned    wm       0                0         (0/0/0)             0<br />
  1 unassigned    wm       0                0         (0/0/0)             0<br />
  2     backup    wu       0 &#8211; 57341      349.99GB    (57342/0/0) 733977600<br />
  3 unassigned    wm       0                0         (0/0/0)             0<br />
  4 unassigned    wm       0                0         (0/0/0)             0<br />
  5 unassigned    wm       0                0         (0/0/0)             0<br />
  6 unassigned    wm       0                0         (0/0/0)             0<br />
  7 unassigned    wm       0                0         (0/0/0)             0</p>
<p>format> q</p></blockquote>
<p>If you&#8217;ve done everything right, Veritas should not see your new drive yet.  Verify:</p>
<blockquote><p># vxdisk -o alldgs list<br />
DEVICE       TYPE            DISK         GROUP        STATUS<br />
emcpower0s2  auto:sliced     devdg-erp02  devdg-erp    online<br />
emcpower1s2  auto:cdsdisk    testdg-erp02  testdg-erp   online<br />
emcpower2s2  auto:sliced     devdg-dw02   devdg-dw     online<br />
emcpower3s2  auto:sliced     devdg-tle01  devdg-tle    online<br />
emcpower4s2  auto:sliced     dbadg-erp01  dbadg-erp    online</p></blockquote>
<p>Now that everything is setup right, go ahead and tell Veritas to look for new drives.  <strong>Important Note:  If it is not setup right at this point, Veritas will claim the raw device and it&#8217;s a pain to cleanup!</strong></p>
<blockquote><p># vxdctl enable</p></blockquote>
<p>Now, you will see the pseudo drive in the list.  If it&#8217;s a raw device name, you messed up:</p>
<blockquote><p># vxdisk -o alldgs list<br />
DEVICE       TYPE            DISK         GROUP        STATUS<br />
emcpower0s2  auto:sliced     devdg-erp02  devdg-erp    online<br />
emcpower1s2  auto:cdsdisk    testdg-erp02  testdg-erp   online<br />
emcpower2s2  auto:sliced     devdg-dw02   devdg-dw     online<br />
emcpower3s2  auto:sliced     devdg-tle01  devdg-tle    online<br />
emcpower4s2  auto:sliced     dbadg-erp01  dbadg-erp    online<br />
<strong>emcpower6s2  auto:none       &#8211;            &#8211;            online invalid</strong>
</p></blockquote>
<p>You should now see new devices in /dev/vx/dmp and /dev/vx/rdmp.  What&#8217;s next?  Well, that&#8217;s entirely up to you.  Now that you&#8217;ve got the right drive in Veritas, you can set it up anyway you want &#8211; <a href="http://www.utahsysadmin.com/2009/05/25/adding-drive-veritas-disk-group/">add it to an existing disk group</a>, <a href="http://www.utahsysadmin.com/2009/05/25/adding-drive-veritas-disk-group/">mirror a disk group for some added redundancy</a>, <a href="http://www.utahsysadmin.com/2009/05/24/create-new-veritas-disk-group/">create a new disk group</a>, etc.  In upcoming posts, I&#8217;ll detail how to create a new disk group with this LUN and then start digging into dynamically resizing file systems while everything is still online and available to the users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/05/15/new-lun-solaris9-vxfs-powerpath/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Random Perl Snippet</title>
		<link>http://www.utahsysadmin.com/2009/04/11/random-perl-snippet/</link>
		<comments>http://www.utahsysadmin.com/2009/04/11/random-perl-snippet/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 03:51:37 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=152</guid>
		<description><![CDATA[Something that I get to do occasionally at work is review old code to fix some random bug.  I actually enjoy doing this because I rarely get to program anymore (since I have never been a developer) and it&#8217;s nice to brush up on it again.  The other day, I ran into some [...]]]></description>
			<content:encoded><![CDATA[<p>Something that I get to do occasionally at work is review old code to fix some random bug.  I actually enjoy doing this because I rarely get to program anymore (since I have never been a developer) and it&#8217;s nice to brush up on it again.  The other day, I ran into some code I hadn&#8217;t seen before, that is valid Perl, but is much more C like:</p>
<blockquote><p><code>return ($n < 0) ? 0 : $n;</code></p></blockquote>
<p>The biggest problem with trying to figure out what this does if you've never seen it before is that you have no idea what to search for.  Do you look up "?:", no, because that actually means something else.  <a href="http://www.google.com/codesearch/">Google Code Search</a> has been my friend in the past on things like this, because it can handle all the special characters.  I highly recommend trying it out.  This time I figured out it was an old C construct, so I just went over and asked a developer what it meant.</p>
<p>So, for those who didn't know already, this is what it means:</p>
<p><code>($n < 0)</code> - this is the statement that is being checked (like in an if statement).</p>
<p>The part between the ? and the : is what is returned if the statement is true.  The part after the : is what is returned if the statement is false.</p>
<p>So in this case, the author was making sure that the number returned was positive.  If $n was less than zero (or negative), it would return zero.  If it was zero or some positive number, it just returned that number.</p>
<p>Now, why would you do this?  Well, it would all depend on how the variable was derived in the subroutine above it.  In my case, the author was using a creative method to find the total number of a specific character in a string (in this case the slash):</p>
<blockquote><p>
<code>my $str = shift(@_);<br />
my $n = split('/', $str) - 1;</code></p></blockquote>
<p>Now, although this works, Perl will complain about it because you are clobbering the array @_ and consequently your subroutine arguments.  So I ended up changing the code to use the translate command "tr", which returns the number of matches:</p>
<blockquote><p><code>my $n = ($str =~ tr/\///);</code></p></blockquote>
<p>Of course, now the return code is irrelevant, but not causing any harm...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/04/11/random-perl-snippet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find open ports in Solaris 9</title>
		<link>http://www.utahsysadmin.com/2009/04/02/find-open-ports-in-solaris-9/</link>
		<comments>http://www.utahsysadmin.com/2009/04/02/find-open-ports-in-solaris-9/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:00:25 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=149</guid>
		<description><![CDATA[In many operating systems, you can find the connection between a specific process and an open port using lsof as I mentioned here.  What if you don&#8217;t have lsof, like in Solaris 9?  Well, if you have pfiles, you can do the same thing by looping through the current processes and checking what [...]]]></description>
			<content:encoded><![CDATA[<p>In many operating systems, you can find the connection between a specific process and an open port using lsof as I mentioned <a href="http://www.utahsysadmin.com/2007/04/19/list-open-files/">here</a>.  What if you don&#8217;t have lsof, like in Solaris 9?  Well, if you have pfiles, you can do the same thing by looping through the current processes and checking what port they have open:</p>
<blockquote><p><code>for i in `ps -A | grep -v PID |  awk '{print $1}'`; do echo PID:$i; pfiles $i | grep port; done</code></p></blockquote>
<p>To break it down:</p>
<p>This gives you all the PIDs of running processes:</p>
<blockquote><p><code>ps -A | grep -v PID |  awk '{print $1}'</code></p></blockquote>
<p>Loop through them with the for loop, and then print the PID and the open ports of that PID to the screen:</p>
<blockquote><p><code>echo PID:$i; pfiles $i | grep port;</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/04/02/find-open-ports-in-solaris-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updated design</title>
		<link>http://www.utahsysadmin.com/2009/01/30/updated-design/</link>
		<comments>http://www.utahsysadmin.com/2009/01/30/updated-design/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 08:41:13 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2009/01/30/updated-design/</guid>
		<description><![CDATA[I got tired of the small width columns of the original template that I used to build this blog, so I finally went in and modified the CSS to make the columns bigger.  This should make it so that the code is easier to read and copy.  According to Google Analytics, 99.7% of [...]]]></description>
			<content:encoded><![CDATA[<p>I got tired of the small width columns of the original template that I used to build this blog, so I finally went in and modified the CSS to make the columns bigger.  This should make it so that the code is easier to read and copy.  According to Google Analytics, 99.7% of my visitors have a wider screen then 800 pixels, so I felt safe expanding it a bit.  Let me know if something doesn&#8217;t look right with the new layout.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2009/01/30/updated-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solaris 8: Bad Superblock at block 16</title>
		<link>http://www.utahsysadmin.com/2008/12/29/solaris-8-bad-superblock/</link>
		<comments>http://www.utahsysadmin.com/2008/12/29/solaris-8-bad-superblock/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 04:59:45 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=127</guid>
		<description><![CDATA[This weekend I got the joy of rebuilding a Solaris 8 server from scratch with backups.  I had another server of the same hardware available to use for the restore, except it had Solaris 9 mirrored across 2 hard drives.  Someday, I&#8217;ll go through and document the whole process, but basically I broke [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I got the joy of rebuilding a Solaris 8 server from scratch with backups.  I had another server of the same hardware available to use for the restore, except it had Solaris 9 mirrored across 2 hard drives.  Someday, I&#8217;ll go through and document the whole process, but basically I broke the mirror, repartitioned the second drive, mounted the new partitions inside of the Solaris 9 environment, restored the data and rebooted off the drive with the restored data.</p>
<p>The interesting thing that I found that I wanted to post about was the corruption of the Solaris 8 superblock that was caused by mounting the partitions within Solaris 9.  There were changes made in fsck on Solaris 9 that made the superblock incompatible with Solaris 8.  When you boot off of a Solaris 8 partition that has been mounted by Solaris 9, you&#8217;ll get the following errors:</p>
<blockquote><p>The / file system (/dev/rdsk/c0t2d0s0) is being checked.<br />
/dev/rdsk/c0t2d0s0: BAD SUPERBLOCK AT BLOCK 16: BAD VALUES IN SUPER BLOCK<br />
/dev/rdsk/c0t2d0s0: USE AN ALTERNATE SUPERBLOCK TO SUPPLY NEEDED INFORMATION;<br />
/dev/rdsk/c0t2d0s0: e.g. fsck [-F ufs] -o b=# [special ...]<br />
/dev/rdsk/c0t2d0s0: where # is the alternate super block. SEE fsck_ufs(1M).</p>
<p>/dev/rdsk/c0t2d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.</p>
<p>WARNING &#8211; Unable to repair the / filesystem. Run fsck<br />
manually (fsck -F ufs /dev/rdsk/c0t2d0s0). Exit the shell when<br />
done to continue the boot process.</p></blockquote>
<p>Of course, the drive path may be different, etc.  The solution to this is simple, run fsck and restore the superblock from one of it&#8217;s backups &#8211; in this case I restored from block 32:</p>
<blockquote><p>fsck -F ufs -y -o b=32 /dev/rdsk/c0t2d0s0</p></blockquote>
<p>Run this on each of the affected partitions (all the partitions that you mounted) and you are good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/12/29/solaris-8-bad-superblock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
