Search This Blog

Saturday 16 July 2011

Adding new mount point with Suncluster

 

Hostname:node1

Resource Group Name:db-rg

Resource Name: apps-res

Requirement: Need to add two new mount points /oracle/redo1   and /oracle/redo2.

1. List the existing mountpoint related to db-res
root@node1 # scrgadm -vvp|egrep 'FilesystemMountPoints'|grep 'db-res'|grep 'Res property value'
      (db-rg:db-res:FilesystemMountPoints) Res property value: /oracle/archive /oracle/data01 /oracle/data02 /oracle/export /oracle/index01 /oracle/index02 /oracle/redologa /oracle/redologb /oracle/redologc /oracle/redologd /oracle/data03 /oracle/data04 /oracle/index03 /oracle/data05 /oracle/data06

2. Create the required Filesystesm and update /etc/vfstab for newly created mountpoint as below.
/dev/md/db-ms/dsk/d380     /dev/md/db-ms/rdsk/d380    /oracle/redo1   ufs     2       no      logging
/dev/md/db-ms/dsk/d390     /dev/md/db-ms/rdsk/d390    /oracle/redo2   ufs     2       no      logging

3. Mount the FS and set proper permission
root@node1 # mount /oracle/redo1
root@node1 # mount /oracle/redo2
root@node1 # chown oracle:dba /oracle/redo1
root@node1 # chown oracle:dba /oracle/redo2

4. Verify that new mountpoints (/oracle/redo1 and /oracle/redo2) mounted properly
root@node1 #df -h|grep redo
/dev/md/db-ms/dsk/d380   10G   100M   9.8G    1%    /oracle/redo1
/dev/md/db-ms/dsk/d390   10G   100M   9.8G    1%    /oracle/redo2

5. Update the cluster configuration with new mountpoints (/oracle/redo1 and /oracle/redo2) inluding all old mountpoints.
root@node1 # scrgadm -c -j db-res –x \
FilesystemMountPoints="/oracle/archive,/oracle/data01,/oracle/data02,/oracle/export,/oracle/index01,/oracle/index02,/oracle/redologa,/oracle/redologb,/oracle/redologc,/oracle/redologd,/oracle/data03,/oracle/data04,/oracle/index03,/oracle/data05,/oracle/data06,/oracle/redo1,/oracle/redo2"

6. Verify the new mountpoints (/oracle/redo1 and /oracle/redo2) are available in configuration
root@node1 # scrgadm -vvp|egrep 'FilesystemMountPoints'|grep 'db-res'|grep 'Res property value'
      (db-rg:db-res:FilesystemMountPoints) Res property value: /oracle/archive /oracle/data01 /oracle/data02 /oracle/export /oracle/index01 /oracle/index02 /oracle/redologa /oracle/redologb /oracle/redologc /oracle/redologd /oracle/data03 /oracle/data04 /oracle/index03 /oracle/data05 /oracle/data06 /oracle/redo2 /oracle/redo2

Tuesday 19 April 2011

Extending VMWARE guest linux OS Filesystem

1.Rescan SCSI Bus to detect newly added disk using below command.

[root@RHEL ~]# echo "- - -">/sys/class/scsi_host/host*/scan

2. Tail system message file for checking the newly added disk is probed.
[root@RHEL ~]# tail -f /var/log/messages
Mar  6 16:34:56 RHEL kernel: SCSI device sdc: 545259520 512-byte hdwr sectors (279173 MB)
Mar  6 16:34:56 RHEL kernel: sdc: cache data unavailable
Mar  6 16:34:56 RHEL kernel: sdc: assuming drive cache: write through
Mar  6 16:34:56 RHEL kernel: SCSI device sdc: 545259520 512-byte hdwr sectors (279173 MB)
Mar  6 16:34:56 RHEL kernel: sdc: cache data unavailable
Mar  6 16:34:56 RHEL kernel: sdc: assuming drive cache: write through
Mar  6 16:34:57 RHEL kernel:  sdc: unknown partition table
Mar  6 16:34:57 RHEL kernel: Attached scsi disk sdc at scsi0, channel 0, id 2, lun 0
Mar  6 16:34:57 RHEL scsi.agent[31318]: disk at /devices/pci0000:00/0000:00:10.0/host0/target0:0:2/0:0:2:0
Mar  6 16:34:57 RHEL udevd[1418]: udev done!

3. Now the new disk (/dev/sdc) is  visible in fdisk output (With a invalid disk label for new disks)
[root@RHEL ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        3916    31350847+  8e  Linux LVM

Disk /dev/sdb: 75.1 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        9138    73400319+  8e  Linux LVM

Disk /dev/sdc: 279.1 GB, 279172874240 bytes
255 heads, 63 sectors/track, 33940 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table

4. Create physical volume on new disk
#pvcreate /dev/sdc
5. Extend the VG(VgBSL) to new disk (/dev/sdc)
[root@RHEL ~]# vgextend VgBSL /dev/sdc
  /dev/cdrom: open failed: No medium found
  Volume group "VgBSL" successfully extended
5. List the existing Physical Volumes
[root@RHEL ~]# pvs
  PV         VG         Fmt  Attr PSize   PFree
  /dev/sda2  VolGroup00 lvm2 a-    29.88G      0
  /dev/sdb1  VgBSL     lvm2 a-    69.97G   1.53G
  /dev/sdc   VgBSL     lvm2 a-   259.97G 259.97G

6. Extend logical Volume to new size (old size + newly available)
[root@RHEL ~]# lvextend -L 299G /dev/mapper/VgBSL-LogVol02
  Extending logical volume LogVol02 to 299.00 GB
  Logical volume LogVol02 successfully resized

7. Extend the Volume using ext2online command.
[root@RHEL ~]# ext2online /dev/mapper/VgBSL-LogVol02
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
8. Now the Volume is resized to new size
[root@RHEL ~]# df -h /apps
Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VgBSL-LogVol02
                      295G   37G  247G  13% /apps

Saturday 16 April 2011

Colon Separated WWPN in Soalris

The script prints the WWPN of Solaris 10 HBA cards WWPN in a familiar colon separated format that Storage Admin can use easily in SAN devices.

root@solaris-10 # fcinfo hba-port|grep 'HBA Port WWN'|awk {'print $4'}|perl -pe 's/(..)/\1:/g'|cut -c 1-23
21:00:00:1b:32:95:56:2c
21:01:00:1b:32:b5:56:2c
21:00:00:1b:32:95:66:2c
21:01:00:1b:32:b5:66:2c

Tuesday 12 April 2011

Script for Deleting a Specific day older files

 

#Source Directory
SRC=/apps/temp
#Specify size of file system in percentage when the script work. Nothing will happen if the FS utilization is below this.
CUTOFF=15
#Specify the age of file to be moved (older than this)
OLD=14
TS=`date "+%Y_%m_%d_%H:%M:%S"`
#location of Logfile
LOG=/tmp/mvfile.$TS
X=`df $SRC |grep -v Used|awk '{print $4}'|cut -c1-2|grep -v ^$`

if [ -f  $LOG ]
        then
        rm  $LOG
fi

if [[ $X -gt $CUTOFF ]]
then
        echo "/usr/bin/find $SRC -mtime +$OLD -print >>/tmp/mvfiles.$TS"
        /usr/bin/find $SRC -mtime +$OLD -print >>$LOG
                for i in `cat $LOG`
                do
                rm $i
                done
                echo "Log file Available:  $LOG"
fi

Monday 11 April 2011

sudo configuration on Solaris shared zones

 

Since /usr is will be read-only on zone, its not possible to do any changes on sudo configuration from shared zones. Use visudo command from global zone for below tasks.

1. Create alias for each zones with corresponding hostnames.

Host_Alias ZONE1=zone1.example.com
Host_Alias ZONE1=zone2.example.com

2. Use above alias for each line as below (user1 has privileges for below command on zone1 and user2 has zone2. Its is mandatory the user should exists on global zone.)

user1 ZONE1=NOPASSWD:/usr/bin/passwd, /usr/sbin/useradd, /usr/sbin/usermod
user2 ZONE2=NOPASSWD:/usr/bin/passwd, /usr/sbin/useradd, /usr/sbin/usermod

Saturday 26 March 2011

Sunfire 20K/25K Dynamic Reconfiguration

 

Here is the procedure for detaching one system board (SB13 from one domain (say Domain A) and adding the the same with another Domain (Domain F).

1. Make sure the board is available in Domain A

root@Domain-A # cfgadm -al|grep SB13
Ap_Id                          Type         Receptacle   Occupant     Condition
SB13                           V3CPU        connected    configured   ok
SB13::cpu0                     cpu          connected    configured   ok
SB13::cpu1                     cpu          connected    configured   ok
SB13::cpu2                     cpu          connected    configured   ok
SB13::cpu3                     cpu          connected    configured   ok
SB13::memory                   memory       connected    configured   ok

2. Disconnect the board from Domain A using below command.

root@Domain-A # cfgadm -c disconnect SB13

Below messages may be visible in system log while doing above activity.

root@Domain-A # tail -15 /var/adm/messages
Mar 26 15:13:47 Domain-A unix: [ID 177789 kern.info] kphysm_delete: mem = 67108864K (0x1000000000)
Mar 26 15:13:47 Domain-A unix: [ID 585997 kern.info] kphysm_delete: avail mem = 57300893696
Mar 26 15:13:47 Domain-A dr: [ID 427603 kern.notice] OS unconfigure dr@0:SB13::cpu0
Mar 26 15:13:58 Domain-A dr: [ID 427603 kern.notice] OS unconfigure dr@0:SB13::cpu1
Mar 26 15:14:19 Domain-A dr: [ID 427603 kern.notice] OS unconfigure dr@0:SB13::cpu2
Mar 26 15:14:31 Domain-A dr: [ID 427603 kern.notice] OS unconfigure dr@0:SB13::cpu3
Mar 26 15:14:52 Domain-A dr: [ID 427603 kern.notice] OS unconfigure dr@0:SB13::memory
Mar 26 15:19:00 Domain-A genunix: [ID 408114 kern.info] /memory-controller@1a0,400000 (mc-us38) offline
Mar 26 15:19:00 Domain-A genunix: [ID 408114 kern.info] /memory-controller@1a1,400000 (mc-us39) offline
Mar 26 15:19:00 Domain-A genunix: [ID 408114 kern.info] /memory-controller@1a2,400000 (mc-us310) offline
Mar 26 15:19:00 Domain-A genunix: [ID 408114 kern.info] /memory-controller@1a3,400000 (mc-us311) offline
Mar 26 15:19:00 Domain-A genunix: [ID 408114 kern.info] /address-extender-queue@1be,0 (axq4) offline

3. Once the disconnect command is finished, check the SB status is showing as disconnected.

root@Domain-A # cfgadm -al|grep SB13
SB13                           V3CPU        disconnected unconfigured unknown

4. Now SB13 can be deleted from domain A and attached to domain F (from system controller)
sms-svc@25k-SC1$ showboards
Retrieving board information. Please wait.
..................
Location    Pwr    Type of Board   Board Status  Test Status   Domain
--------    ---    -------------   ------------  -----------   ------
SB13        Off    V3CPU           Assigned      Unknown       Domain-F

 Deleting SB13  from Domain A
sms-svc@25k-SC1$ deleteboard SB13
SB13 successfully unassigned.
sms-svc@25k-SC1$ showboards |grep SB13
SB13        Off    V3CPU           Available     Unknown       Isolated

Attaching SB13 with Domain F

sms-svc@25k-SC1$ addboard -d F SB13
assign SB13
.
assign SB13 done
poweron SB13
..........
poweron SB13 done
test SB13                                                                                                                                         .......    test SB13 done
connect SB13                                                                                                                                          ....   connect SB13 done
configure SB13
.......
configure SB13 done
..
notify online SUNW_cpu/cpu416
notify online SUNW_cpu/cpu420
notify online SUNW_cpu/cpu417
notify online SUNW_cpu/cpu421
notify online SUNW_cpu/cpu418
notify online SUNW_cpu/cpu422
notify online SUNW_cpu/cpu419
notify online SUNW_cpu/cpu423
.
notify add capacity (8 cpus)
notify add capacity (4194304 pages)
notify add capacity SB13 done
.

Once the above commands finished successfully, the SB13 can be visible in Domain F

sms-svc@25k-SC1$ showboards |egrep 'Domain-A|Domain-F'

SB0         On     V3CPU           Active        Passed        Domain-A
SB1         On     V3CPU           Active        Passed        Domain-A
SB10        On     V3CPU           Active        Passed        Domain-F
SB11        On     V3CPU           Active        Passed        Domain-F
SB13        On     V3CPU           Active        Passed        Domain-F
SB17        On     V3CPU           Active        Passed        Domain-F
IO0         On     V2HPCIX         Active        Passed        Domain-A
IO1         On     V2HPCIX         Active        Passed        Domain-A
IO10        On     V2HPCIX         Active        Passed        Domain-F
IO11        On     V2HPCIX         Active        Passed        Domain-F

Below messages can be seen while attaching the SB with domain F

root@Domain-F #tail -f /var/adm/messages

Mar 26 15:38:51 Domain-F rootnex: [ID 349649 kern.info] axq5 at root: SAFARI 0x1be 0x0
Mar 26 15:38:51 Domain-F genunix: [ID 936769 kern.info] axq5 is /address-extender-queue@1be,0
Mar 26 15:38:51 Domain-F genunix: [ID 408114 kern.info] /address-extender-queue@1be,0 (axq5) online
Mar 26 15:38:51 Domain-F dr: [ID 606818 kern.notice] OS configure dr@0:SB13::cpu0
Mar 26 15:38:51 Domain-F dr: [ID 606818 kern.notice] OS configure dr@0:SB13::cpu1
Mar 26 15:38:51 Domain-F dr: [ID 606818 kern.notice] OS configure dr@0:SB13::cpu2
Mar 26 15:38:51 Domain-F dr: [ID 606818 kern.notice] OS configure dr@0:SB13::cpu3
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu416: UltraSPARC-IV+ (portid 416 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu420: UltraSPARC-IV+ (portid 416 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu417: UltraSPARC-IV+ (portid 417 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu421: UltraSPARC-IV+ (portid 417 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu418: UltraSPARC-IV+ (portid 418 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu422: UltraSPARC-IV+ (portid 418 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu419: UltraSPARC-IV+ (portid 419 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 270833 kern.info] cpu423: UltraSPARC-IV+ (portid 419 impl 0x19 ver 0x22 clock 1800 MHz)
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 416 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 420 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 417 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 421 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 418 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 422 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 419 initialization complete - restarted
Mar 26 15:38:51 Domain-F unix: [ID 519443 kern.info] cpu 423 initialization complete - restarted
Mar 26 15:38:51 Domain-F dr: [ID 606818 kern.notice] OS configure dr@0:SB13::memory
Mar 26 15:38:51 Domain-F rootnex: [ID 349649 kern.info] mc-us312 at root: SAFARI 0x1a0 0x400000 ...
Mar 26 15:38:51 Domain-F genunix: [ID 936769 kern.info] mc-us312 is /memory-controller@1a0,400000
Mar 26 15:38:51 Domain-F genunix: [ID 408114 kern.info] /memory-controller@1a0,400000 (mc-us312) online
Mar 26 15:38:51 Domain-F rootnex: [ID 349649 kern.info] mc-us313 at root: SAFARI 0x1a1 0x400000 ...
Mar 26 15:38:51 Domain-F genunix: [ID 936769 kern.info] mc-us313 is /memory-controller@1a1,400000
Mar 26 15:38:51 Domain-F genunix: [ID 408114 kern.info] /memory-controller@1a1,400000 (mc-us313) online
Mar 26 15:38:51 Domain-F rootnex: [ID 349649 kern.info] mc-us314 at root: SAFARI 0x1a2 0x400000 ...
Mar 26 15:38:51 Domain-F genunix: [ID 936769 kern.info] mc-us314 is /memory-controller@1a2,400000
Mar 26 15:38:51 Domain-F genunix: [ID 408114 kern.info] /memory-controller@1a2,400000 (mc-us314) online
Mar 26 15:38:51 Domain-F rootnex: [ID 349649 kern.info] mc-us315 at root: SAFARI 0x1a3 0x400000 ...
Mar 26 15:38:51 Domain-F genunix: [ID 936769 kern.info] mc-us315 is /memory-controller@1a3,400000
Mar 26 15:38:51 Domain-F genunix: [ID 408114 kern.info] /memory-controller@1a3,400000 (mc-us315) online
Mar 26 15:38:51 Domain-F unix: [ID 700753 kern.info] kphysm_add_memory_dynamic: adding 33554432K at 0x1e000000000
Mar 26 15:39:13 Domain-F unix: [ID 323408 kern.info] kphysm_add_memory_dynamic: mem = 125829120K (0x1e00000000)
Mar 26 15:39:13 Domain-F unix: [ID 401001 kern.info] kphysm_add_memory_dynamic: avail mem = 35283116032

New the new board is available in Domain F.

root@Domain-F # cfgadm -al|grep SB13
SB13                           V3CPU        connected    configured   ok
SB13::cpu0                     cpu          connected    configured   ok
SB13::cpu1                     cpu          connected    configured   ok
SB13::cpu2                     cpu          connected    configured   ok
SB13::cpu3                     cpu          connected    configured   ok
SB13::memory                   memory       connected    configured   ok

Saturday 19 March 2011

Configuring Zpool with Solaris Zone

Set up details: 
Server: globalzone
Zone name: testzone
1. Creating testpool named testpool with two disks in global zone

root@global # testpool create testpool  c4t60050768018E8327B800000000000005d0s0 
c4t60050768018E8327B800000000000008d0s0 

2. Checking the status of created pool testpool 

root@global # zpool status -v testpool
  pool: testpool
 state: ONLINE
 scrub: none requested
config:


        NAME                                       STATE     READ WRITE CKSUM
        testpool                                      ONLINE       0     0     0
          c4t60050768018E8327B800000000000005d0s0  ONLINE       0     0     0
          c4t60050768018E8327B800000000000008d0s0  ONLINE       0     0     0


errors: No known data errors
3. Adding the pool to zone
root@global # zoneadm -z testpool halt
root@global # zonecfg -z testpool
zonecfg:testzone> add dataset
zonecfg:testzone:dataset> set name="testpool"
zonecfg:testzone:dataset> end
zonecfg:testzone> commit
zonecfg:testzone> exit
root@global # zoneadm -z testzone boot

4. Creating first filesystem named mqm 
root@testzone# zfs create testpool/mqm
5. Setting quota for each file sy stem
root@testzone# zfs set quota=110G testpool/apps
root@testzone# zfs set quota=1G testpool/oraapps          
root@testzone# zfs set quota= 4G testpool/mqm  
6. Changing  mount point from non-global zone
bash-3.00# zfs set mountpoint=/apps testpool/apps
bash-3.00# zfs set mountpoint=/var/mqm  testpool/mqm
bash-3.00# zfs set mountpoint=/oracle/orapp testpool/oraapps
7. Since we don’t  need to pool to mounted,  removing pool from mounting
bash-3.00# zfs set mountpoint=legacy testpool

EMC powerpath Solaris Map list script.

This is script is for printing the EMC psedo device with corresponding LUN ID and physical device path.
Make sure, powermt command is in your env path.


Download the script Click Here
#!/usr/bin/perl
#Auther : Latheefp@gmail.com
#Purpose: Printing the Emc Power Devices With LUN ID
my $PSUE;
my $LUN;
my $DISK;
my @array;
my $PHY;
my $OldPSUE;
my $count;
my $LEN;
print "=================================================\n Pseudo name     :LUN ID:PhysicalDIsks\n=================================================\n";
open(FILE, "/etc/powermt display dev=all|");
while () {
  chomp;
  if ( /Pseudo name/ )
   {
     $_=~s/name=|Pseudo//g;
     $PSUE=$_;
     $LEN=`echo $PSUE|wc -c`;
     if ($LEN < 15)
     {
                     for ($count=$LEN; $count<=15; $count++)
                     {
                     $PSUE="$PSUE ";
                     }
     }
   }
  if ( /Logical device/ ) {
                                  $_=~s/Logical device ID=//g;
                                  $LUN=$_;
    }
  if ( /pci/ ) {
                     $_=~s/Logical device ID=//g;
                                  @array = split (/\s+/, $_);
                     $PHY="$array[2] :  $PHY";
    }
  if (/^$/) {
      if ($OldPSUE ne $PSUE)
      {
      print "$PSUE : $LUN: $PHY \n";
      }
   $PHY="";
   $OldPSUE=$PSUE;
  }
  }
close(FILE);

Download the script Click Here


This script can pint an output as below.
root@Host1# ./EMCtoLUN.pl
=================================================
 Pseudo name     :LUN ID:PhysicalDIsks
=================================================
 emcpower22a     : 0547: c2t5006048452A5C208d414s0 :  c1t5006048452A5C207d414s0 :
 emcpower21a     : 054D: c2t5006048452A5C208d415s0 :  c1t5006048452A5C207d415s0 :
 emcpower9a      : 058C: c2t5006048452A5C208d220s0 :  c1t5006048452A5C207d220s0 :
 emcpower8a      : 0592: c2t5006048452A5C208d221s0 :  c1t5006048452A5C207d221s0 :
 emcpower7a      : 0598: c2t5006048452A5C208d222s0 :  c1t5006048452A5C207d222s0 :
 emcpower4a      : 094D: c2t5006048452A5C208d321s0 :  c1t5006048452A5C207d340s0 :
 emcpower17a     : 095C: c2t5006048452A5C208d295s0 :  c1t5006048452A5C207d295s0 :
 emcpower16a     : 0962: c2t5006048452A5C208d389s0 :  c1t5006048452A5C207d389s0 :
 emcpower15a     : 09EE: c2t5006048452A5C208d390s0 :  c1t5006048452A5C207d390s0 :
 emcpower20a     : 0B78: c2t5006048452A5C208d403s0 :  c1t5006048452A5C207d403s0 :
 emcpower18a     : 0BA0: c2t5006048452A5C208d405s0 :  c1t5006048452A5C207d405s0 :
 emcpower19a     : 0EC7: c2t5006048452A5C208d404s0 :  c1t5006048452A5C207d404s0 :
 emcpower30a     : 0EDF: c2t5006048452A5C208d406s0 :  c1t5006048452A5C207d406s0 :
 emcpower29a     : 0EF7: c2t5006048452A5C208d407s0 :  c1t5006048452A5C207d407s0 :
 emcpower28a     : 0F0F: c2t5006048452A5C208d408s0 :  c1t5006048452A5C207d408s0 :
 emcpower27a     : 0F2B: c2t5006048452A5C208d409s0 :  c1t5006048452A5C207d409s0 :
 emcpower26a     : 0F43: c2t5006048452A5C208d410s0 :  c1t5006048452A5C207d410s0 :
 emcpower25a     : 0F5B: c2t5006048452A5C208d411s0 :  c1t5006048452A5C207d411s0 :
 emcpower24a     : 0F73: c2t5006048452A5C208d412s0 :  c1t5006048452A5C207d412s0 :
 emcpower23a     : 0F8B: c2t5006048452A5C208d413s0 :  c1t5006048452A5C207d413s0 :
 emcpower14a     : 1023: c2t5006048452A5C208d391s0 :  c1t5006048452A5C207d391s0 :
 emcpower13a     : 1029: c2t5006048452A5C208d392s0 :  c1t5006048452A5C207d392s0 :
 emcpower12a     : 102F: c2t5006048452A5C208d393s0 :  c1t5006048452A5C207d393s0 :
 emcpower3a      : 10EF: c2t5006048452A5C208d322s0 :  c1t5006048452A5C207d341s0 :
 emcpower2a      : 10F3: c2t5006048452A5C208d323s0 :  c1t5006048452A5C207d342s0 :
 emcpower1a      : 10F7: c2t5006048452A5C208d340s0 :  c1t5006048452A5C207d343s0 :
 emcpower0a      : 10F9: c2t5006048452A5C208d341s0 :  c1t5006048452A5C207d344s0 :
 emcpower11a     : 120E: c2t5006048452A5C208d394s0 :  c1t5006048452A5C207d394s0 :
 emcpower10a     : 1215: c2t5006048452A5C208d395s0 :  c1t5006048452A5C207d395s0 :
 emcpower6a      : 136C: c2t5006048452A5C208d343s0 :  c1t5006048452A5C207d351s0 :
 emcpower5a      : 1372: c2t5006048452A5C208d344s0 :  c1t5006048452A5C207d352s0 :


Download the script Click Here

Wednesday 2 March 2011

Useful rpm commands

Listing files Related to one installed RPM.
Command: rpm --query --filesbypkg 
Eg:to list all the files related to installed rpm mysql-5.1.51-2.fc14.i686
[root@latheefTest /]# rpm --query --filesbypkg  mysql-5.1.51-2.fc14.i686|more
mysql                     /usr/bin/msql2mysql
mysql                     /usr/bin/my_print_defaults
mysql                     /usr/bin/mysql
mysql                     /usr/bin/mysql_config
mysql                     /usr/bin/mysql_find_rows
mysql                     /usr/bin/mysql_waitpid
mysql                     /usr/bin/mysqlaccess
mysql                     /usr/bin/mysqladmin
mysql                     /usr/bin/mysqlbinlog
mysql                     /usr/bin/mysqlcheck
mysql                     /usr/bin/mysqldump
mysql                     /usr/bin/mysqlimport
mysql                     /usr/bin/mysqlshow
mysql                     /usr/bin/mysqlslap
mysql                     /usr/lib/mysql/mysql_config
mysql                     /usr/lib/mysql/mysqlbug
mysql                     /usr/share/doc/mysql-5.1.51
mysql                     /usr/share/doc/mysql-5.1.51/COPYING
mysql                     /usr/share/doc/mysql-5.1.51/EXCEPTIONS-CLIENT
mysql                     /usr/share/doc/mysql-5.1.51/README
mysql                     /usr/share/doc/mysql-5.1.51/README.mysql-docs
mysql                     /usr/share/man/man1/my_print_defaults.1.gz
mysql                     /usr/share/man/man1/mysql.1.gz
mysql                     /usr/share/man/man1/mysql_config.1.gz
mysql                     /usr/share/man/man1/mysql_find_rows.1.gz
mysql                     /usr/share/man/man1/mysql_waitpid.1.gz
mysql                     /usr/share/man/man1/mysqlaccess.1.gz
mysql                     /usr/share/man/man1/mysqladmin.1.gz
mysql                     /usr/share/man/man1/mysqldump.1.gz
mysql                     /usr/share/man/man1/mysqlshow.1.gz
mysql                     /usr/share/man/man1/mysqlslap.1.gz


Getting information about rpm which is not installed, but locally available

Command: rpm rpm -qi
Eg:to list the information regarding rpm package mysql-5.1.51-2.fc14.i686
[root@latheefTest /]# rpm -qi  mysql-5.1.51-2.fc14.i686
Name        : mysql                        Relocations: (not relocatable)
Version     : 5.1.51                            Vendor: Fedora Project
Release     : 2.fc14                        Build Date: Thu 07 Oct 2010 02:01:06 PM EDT
Install Date: Wed 10 Nov 2010 03:49:43 AM EST      Build Host: x86-13.phx2.fedoraproject.org
Group       : Applications/Databases        Source RPM: mysql-5.1.51-2.fc14.src.rpm
Size        : 2451091                          License: GPLv2 with exceptions
Signature   : RSA/SHA256, Thu 07 Oct 2010 05:06:25 PM EDT, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.mysql.com
Summary     : MySQL client programs and shared libraries
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. The base package
contains the standard MySQL client programs and generic MySQL files.


Checking which rpm package installed a specific system file.
Command: rpm rpm -qf
Eg:I want to see, which rpm package created /etc/hosts file
[root@latheefTest /]# rpm -qf /etc/hosts
setup-2.8.23-1.fc14.noarch




Getting the detailed information about an installed package.



[root@latheef~]# rpm -qi mysql-server-5.1.51-2.fc14.x86_64
Name        : mysql-server                 Relocations: (not relocatable)
Version     : 5.1.51                            Vendor: Fedora Project
Release     : 2.fc14                        Build Date: Thu 07 Oct 2010 09:02:12 PM AST
Install Date: Tue 09 Nov 2010 06:55:13 AM AST      Build Host: x86-09.phx2.fedoraproject.org
Group       : Applications/Databases        Source RPM: mysql-5.1.51-2.fc14.src.rpm
Size        : 24571485                         License: GPLv2 with exceptions
Signature   : RSA/SHA256, Fri 08 Oct 2010 12:02:05 AM AST, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.mysql.com
Summary     : The MySQL server and related files
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. This package contains
the MySQL server and some accompanying files and directories.

To get the complete documents (help files and manfiles) information about the installed package.

[root@latheef~]# rpm -qd mysql-server-5.1.51-2.fc14.x86_64
/usr/share/doc/mysql-server-5.1.51/my-huge.cnf
/usr/share/doc/mysql-server-5.1.51/my-innodb-heavy-4G.cnf
/usr/share/doc/mysql-server-5.1.51/my-large.cnf
/usr/share/doc/mysql-server-5.1.51/my-medium.cnf
/usr/share/doc/mysql-server-5.1.51/my-small.cnf
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/msql2mysql.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/mysql.server.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/mysql_fix_extensions.1.gz
/usr/share/man/man1/mysql_fix_privilege_tables.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysql_setpermission.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlbug.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlman.1.gz
/usr/share/man/man1/mysqltest.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man8/mysqld.8.gz
/usr/share/man/man8/mysqlmanager.8.gz

Continue...


Tuesday 22 February 2011

Renaming Volume Group in HP Unix

Renaming VG in hpux.
Here is the procedure for renaming a VG in hpux. Renaming a VG is simple as exporting the the VG as importing with different name. (eg: vgapp to vgdb)
1. Verify the existing configuration

#vgdisplay vgapp
VG Name                     /dev/vgapp
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      2
Open LV                     2
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               1016
VGDA                        8
PE Size (Mbytes)            32
Total PE                    508
Alloc PE                    336
Free PE                     172
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 508g
VG Max Extents              16256


1. Umount all the logical volume from vgapp.
# bdf|grep vgapp
/dev/vgapp/test1   10485760   20062 9811599    0% /apps/test1
# umount /apps/test1



2. Deactivate Vg.

# vgchange -a n vgapp
Volume group "vgapp" has been successfully changed.



3. Create  a map file which can be used whileimporting back . File name is /tmp/vgapp

# vgexport -v \ # -->
-p \   # Preview the actions to be taken without updating lvmtab
-s \ #  Scan option for creating map file
-m /tmp/vgapp vgapp  #description of the volume group and its associated logical volume
Beginning the export process on Volume Group "vgapp".
/dev/disk/disk38
/dev/disk/disk39
/dev/disk/disk40
/dev/disk/disk41
vgexport: Preview of vgexport on volume group "vgapp" succeeded.



4. Export VG

# vgexport vgapp
vgexport: Volume group "vgapp" has been successfully removed.



5. Create device files for vgdb

root@rx16-243   [/root]
# ls -l /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Feb 18 20:30 /dev/vg00/group
# mknod /dev/vgdb/group c 64 0x010000
# ls -l /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Feb 18 20:30 /dev/vg00/group
crw-r--r--   1 root       sys         64 0x010000 Feb 20 04:36 /dev/vgdb/group



6. Import the VG with new name using the mapfile
# vgimport -s -N -m /tmp/vgapp vgdb
vgimport: Volume group "/dev/vgdb" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
Note: -N is for pvlink to be in new persistant dsf naming 



7.  Activate the new VG.

# vgchange -a y vgdb
Activated volume group.
Volume group "vgdb" has been successfully changed.



8. Verify the VG and mount the volume

# vgdisplay -v vgdb
--- Volume groups ---
VG Name                     /dev/vgdb
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      2
Open LV                     2
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               1016
VGDA                        8
PE Size (Mbytes)            32
Total PE                    508
Alloc PE                    336
Free PE                     172
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 508g
VG Max Extents              16256


   --- Logical volumes ---
   LV Name                     /dev/vgdb/test
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  16
   Allocated PE                16
   Used PV                     1


   LV Name                     /dev/vgdb/test1
   LV Status                   available/syncd
   LV Size (Mbytes)            10240
   Current LE                  320
   Allocated PE                320
   Used PV                     3




   --- Physical volumes ---
   PV Name                     /dev/disk/disk38
   PV Status                   available
   Total PE                    127
   Free PE                     0
   Autoswitch                  On
   Proactive Polling           On


   PV Name                     /dev/disk/disk39
   PV Status                   available
   Total PE                    127
   Free PE                     0
   Autoswitch                  On
   Proactive Polling           On


   PV Name                     /dev/disk/disk40
   PV Status                   available
   Total PE                    127
   Free PE                     45
   Autoswitch                  On
   Proactive Polling           On


   PV Name                     /dev/disk/disk41
   PV Status                   available
   Total PE                    127
   Free PE                     127
   Autoswitch                  On
   Proactive Polling           On
# mount /dev/vgdb/test1 /mnt
# bdf /mnt
Filesystem          kbytes    used   avail %used Mounted on
/dev/vgdb/test1    10485760   20062 9811599    0% /mnt


Saturday 19 February 2011

Mirroring HP-UX root disk on Itanium-based systems


1. Setup the disk partitions
Create a partition description file:
# vi /tmp/partitionfile
3
EFI 100MB
HPUX 100%
HPSP 400MB

2. Use the idisk(1M) command to partition the disk according to this file:

# idisk -wf /tmp/partitionfile /dev/rdsk/c2t0d0
idisk version: 1.44
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes


EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0x4ef8e40b
        MyLbaLo                   = 0x1
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x88bb991
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x40
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x88bb93f
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 68847bb2-3c12-11e0-8000-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x60f72440


  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 68847e78-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x40
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xf9fff
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 68847e96-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0xfa000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x87f3fff
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 68847eaa-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x87f4000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x88bb93f
        Ending Lba Hi              = 0x0


EFI Alternate Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0x1ce467d8
        MyLbaLo                   = 0x88bb991
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x1
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x40
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x88bb93f
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 68847bb2-3c12-11e0-8000-d6217b60e588
        PartitionEntryLbaLo       = 0x88bb971
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x60f72440


  Alternate Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 68847e78-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x40
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xf9fff
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 68847e96-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0xfa000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x87f3fff
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 68847eaa-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x87f4000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x88bb93f
        Ending Lba Hi              = 0x0


Legacy MBR (MBR Signatures in little endian):
   MBR Signature = 0x4e7b8468


Protective MBR

3. Create device files needed for the new partitions.

# insf -eC disk
##Listing the new partitions
# ioscan -funNCdisk
Class     I  H/W Path  Driver S/W State   H/W Type     Description
===================================================================
disk     35  64000/0xfa00/0x0  esdisk   CLAIMED     DEVICE       HP 73.4GMAX3073NC
                      /dev/disk/disk35      /dev/disk/disk35_p2   /dev/rdisk/disk35     /dev/rdisk/disk35_p2
                      /dev/disk/disk35_p1   /dev/disk/disk35_p3   /dev/rdisk/disk35_p1  /dev/rdisk/disk35_p3
disk     36  64000/0xfa00/0x1  esdisk   CLAIMED     DEVICE       HP 73.4GMAX3073NC
                      /dev/disk/disk36      /dev/disk/disk36_p2   /dev/rdisk/disk36     /dev/rdisk/disk36_p2
                      /dev/disk/disk36_p1   /dev/disk/disk36_p3   /dev/rdisk/disk36_p1  /dev/rdisk/disk36_p3

4. Verify the partition table.

# idisk /dev/rdsk/c2t0d0
# idisk /dev/rdsk/c2t0d0
idisk version: 1.44


EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0x4ef8e40b
        MyLbaLo                   = 0x1
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x88bb991
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x40
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x88bb93f
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 68847bb2-3c12-11e0-8000-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x60f72440


  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 68847e78-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x40
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xf9fff
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 68847e96-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0xfa000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x87f3fff
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 68847eaa-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x87f4000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x88bb93f
        Ending Lba Hi              = 0x0


EFI Alternate Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0x1ce467d8
        MyLbaLo                   = 0x88bb991
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x1
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x40
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x88bb93f
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 68847bb2-3c12-11e0-8000-d6217b60e588
        PartitionEntryLbaLo       = 0x88bb971
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x60f72440


  Alternate Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 68847e78-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x40
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xf9fff
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 68847e96-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0xfa000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x87f3fff
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 68847eaa-3c12-11e0-8000-d6217b60e588
        Starting Lba Lo            = 0x87f4000
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x88bb93f
        Ending Lba Hi              = 0x0


Legacy MBR (MBR Signatures in little endian):
   MBR Signature = 0x4e7b8468


Protective MBR

5. Verify that the device files were created properly.

# ioscan -efnC disk --> c2t0d0 is 0/1/1/0.0.0

6. Initialize the efi partition for use.

# efi_fsinit -d /dev/rdsk/c2t0d0s1

7. Populate the /efi/hpux/ directory in the new EFI system partition.

# mkboot -e -l /dev/rdsk/c2t0d0
##Here we can verify the contends.
#  efi_ls -d /dev/rdsk/c2t0d0s1
FileName                             Last Modified             Size
EFI/                                   2/19/2011                  0
startup.nsh                            2/19/2011                296


total space 523218944 bytes, free space 520163328 bytes



8. Change the auto file for the mirror to boot without quorum.
NOTE: Using "s1"

# echo "boot vmunix -lq" > /tmp/AUTO.lq
# efi_cp -d /dev/rdsk/c2t0d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO

NOTE: We assume that if we boot from the primary, the mirror is fully
functional and therefore we don't need to override quorum. Your site
might require that both disks override quorum.

9. Verify the contents of the auto file on the primary and the mirror.
NOTE: Using "s1"

root@rx16-243   [/root]
# efi_cp -d /dev/rdsk/c2t1d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.pri


root@rx16-243   [/root]
# efi_cp -d /dev/rdsk/c2t0d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.sec


root@rx16-243   [/root]
# cat /tmp/AUTO.pri
boot vmunix


root@rx16-243   [/root]
# cat /tmp/AUTO.sec
boot vmunix -lq

10. Create PV and add the new partition to vg00.

NOTE: Using "s2"

# pvcreate -fB /dev/rdsk/c2t0d0s2
Physical volume "/dev/rdsk/c2t0d0s2" has been successfully created.


# vgextend vg00 /dev/dsk/c2t0d0s2
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

11. Mirror all logical volumes in vg00.

NOTE: Using "s2"

for i in `vgdisplay -v vg00 |grep lv|awk -F\/ {'print $4'}`
do
echo "Extending $i"
lvextend -m 1 /dev/vg00/$i /dev/dsk/c2t0d0s2
done


##this is the exptected output.
Extending lvol1
lvextend: "MirrorCopies" parameter "1" must be larger than existing number "1".
Extending lvol2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol3
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol4
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol4" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol5
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol5" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol6
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol6" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol7
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol7" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Extending lvol8
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volue Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf


 For checking the status of current sysncing. (Eg. For lvol6)

# lvdisplay -v /dev/vg00/lvol6|grep stale|wc -l
26


12. Add the new disk to /stand/bootconf.
NOTE: Using "s2"



# echo "l /dev/dsk/c2t0d0s2" >> /stand/bootconf


# cat /stand/bootconf
l /dev/disk/disk36_p2
l /dev/dsk/c2t0d0s2


13. Verify that the new disk was added to vg00, and the lv's are in sync.

# vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      2
Act PV                      2
Max PE per PV               4329
VGDA                        4
PE Size (Mbytes)            16
Total PE                    8638
Alloc PE                    4324
Free PE                     4314
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 1108224m
VG Max Extents              69264


   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            1792
   Current LE                  112
   Allocated PE                224
   Used PV                     2


   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  384
   Allocated PE                768
   Used PV                     2


   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            1024
   Current LE                  64
   Allocated PE                128
   Used PV                     2


   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  32
   Allocated PE                64
   Used PV                     2


   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            112
   Current LE                  7
   Allocated PE                14
   Used PV                     2


   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            12096
   Current LE                  756
   Allocated PE                1512
   Used PV                     2


   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            6256
   Current LE                  391
   Allocated PE                782
   Used PV                     2


   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            6656
   Current LE                  416
   Allocated PE                832
   Used PV                     2




   --- Physical volumes ---
   PV Name                     /dev/disk/disk36_p2
   PV Status                   available
   Total PE                    4319
   Free PE                     2157
   Autoswitch                  On
   Proactive Polling           On


   PV Name                     /dev/dsk/c2t0d0s2
   PV Status                   available
   Total PE                    4319
   Free PE                     2157
   Autoswitch                  On
   Proactive Polling           On


14. Verify that the BDRA was updated properly. Take note of the HW paths for
step 15.

# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/disk/disk36_p2 -- Boot Disk
        /dev/dsk/c2t0d0s2 -- Boot Disk
Boot: lvol1     on:     /dev/disk/disk36_p2
                        /dev/dsk/c2t0d0s2
Root: lvol3     on:     /dev/disk/disk36_p2
                        /dev/dsk/c2t0d0s2
Swap: lvol2     on:     /dev/disk/disk36_p2
                        /dev/dsk/c2t0d0s2
Dump: lvol2     on:     /dev/disk/disk36_p2, 0


15. Add EFI primary and high availability boot path menu entries.

# ioscan -funCdisk|more
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      2  0/0/2/0.0.0.0  sdisk   CLAIMED     DEVICE       _NEC    DVD+-RW ND-6650A
                           /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk      0  0/1/1/0.0.0    sdisk   CLAIMED     DEVICE       HP 73.4GMAX3073NC
                           /dev/dsk/c2t0d0     /dev/dsk/c2t0d0s2   /dev/rdsk/c2t0d0    /dev/rdsk/c2t0d0s2
                           /dev/dsk/c2t0d0s1   /dev/dsk/c2t0d0s3   /dev/rdsk/c2t0d0s1  /dev/rdsk/c2t0d0s3
disk      1  0/1/1/0.1.0    sdisk   CLAIMED     DEVICE       HP 73.4GMAX3073NC
                           /dev/dsk/c2t1d0     /dev/dsk/c2t1d0s2   /dev/rdsk/c2t1d0    /dev/rdsk/c2t1d0s2
                           /dev/dsk/c2t1d0s1   /dev/dsk/c2t1d0s3   /dev/rdsk/c2t1d0s1  /dev/rdsk/c2t1d0s3


# setboot -p 0/1/1/0.1.0 <-- Set primary disk
# setboot -h 0/1/1/0.0.0 <-- Set mirror disk
# setboot -b on <-- Set autoboot on


16. Verify that the primary and mirror boot paths are configured properly.

# setboot
Primary bootpath : 0/1/1/0.0x1.0x0 (/dev/rdisk/disk36)
HA Alternate bootpath : 0/1/1/0.0x0.0x0 (/dev/rdisk/disk35)
Alternate bootpath : 0/1/1/0.0x0.0x0 (/dev/rdisk/disk35)


Autoboot is ON (enabled)


17. Test the new mirror by booting off of it.


# shutdown -r -y 0
18. Select "HP-UX HA Alternate Boot" to test the mirror while EFI Display below messages.

Please select a boot option


    HP-UX Primary Boot: 0/1/1/0.0x1.0x0
    HP-UX HA Alternate Boot: 0/1/1/0.0x0.0x0
    HP-UX Alternate Boot: 0/1/1/0.0x0.0x0
    EFI Shell [Built-in]
    Boot Option Maintenance Menu
    System Configuration




    Use ^ and v to change option(s). Use Enter to select an option
Scsi(Pun0,Lun0) HP 73.4GMAX3073NC       HPC1 (320 MBytes/sec)
Loading.: HP-UX HA Alternate Boot: 0/1/1/0.0x0.0x0
Starting: HP-UX HA Alternate Boot: 0/1/1/0.0x0.0x0


(C) Copyright 1999-2009 Hewlett-Packard Development Company, L.P.
All rights reserved


HP-UX Boot Loader for IPF  --  Revision 2.039


Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix -lq
Seconds left till autoboot -   8


20. Verify which disk/kernel you booted from.

# grep "Boot device" /var/adm/syslog/syslog.log
Feb 19 06:18:41 rx16-243 vmunix: Boot device's HP-UX HW path is: 0.1.1.0.0.0


21. Remove temporary files.

# rm /tmp/partitionfile /tmp/AUTO*