Search This Blog

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*

Monday, 14 February 2011

Extending HP-UX LVM

1. Make sure we have enough space in VG before extend.

#vgdisplay dbmdws|egrep 'Free PE|PE Size'
Multiplying this Free PE and PE size will provide the free size in MB in this VG.

2. Here we extend the LV to 100G (the rusulting FS will be in 100G size  (-L in MB 100Gx100)

#/usr/sbin/lvextend  -L 102400 /dev/oracle-vg/lvoracle 
Logical volume "/dev/oracle-vg/lvoracle" has been successfully extended.

3. Online extending Filesystem to the new size (-b KB (100Gx1024x1024)

#/usr/sbin/fsadm -F vxfs -b 104857600 /oracle
#bdf /dev/oracle-vg/lvoracle
                   104857600 10252151 88692620   10% /oracle


Wednesday, 9 February 2011

Perl script for getting Public IP from Linux


I used this script from LAN for getting my public IP which is obtained from ISP's DHCP server to my Modem

# cat getwanip.pl
#!/usr/bin/perl -w
#Owner                    :latheefp@gmail.com
#Purpose                  :Getting Public IP from Linux/Unix"
#Packages Required: Perl and wget
my $external_ip;
$external_ip = `wget -q -O - "http://checkip.dyndns.org"`;
if($external_ip =~ m/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) {
        print "My Wan IP is $1\n";
}


The output will be similar to this.
[root@RH31 scripts]# ./getwanip.pl
My Wan IP is 178.74.XXX.221

Saturday, 5 February 2011

Changing kernel parameters in HP-UX


Changing kernel parameters in HP-UX.


While Installing DB it failed due to  below kernel parameters


Checking for maxssiz=134217728; maxssiz=8388608.         Failed <<<<
Checking for maxssiz_64bit=1073741824; maxssiz_64bit=268435456.         Failed <<<<
Checking for maxuprc=3687; maxuprc=3686.         Failed <<<<
Checking for semmns=8192; semmns=4096.          Failed <<<<


I resolved this issue by setting this parameters using kctune command as below.


For verifying the current Value

# kctune -v for  maxssiz maxssiz_64bit maxuprc semmns
Tunable             maxssiz
Description         Maximum size of the stack segment of a 32-bit process (bytes)
Module              vm
Current Value       8388608 [Default]
Value at Next Boot  8388608 [Default]
Value at Last Boot  8388608
Default Value       8388608
Constraints         maxssiz >= 262144
                    maxssiz <= 401604608
Can Change          Immediately or at Next Boot


Tunable             maxssiz_64bit
Description         Maximum size of the stack segment of a 64-bit process (bytes)
Module              vm
Current Value       268435456 [Default]
Value at Next Boot  268435456 [Default]
Value at Last Boot  268435456
Default Value       268435456
Constraints         maxssiz_64bit >= 262144
                    maxssiz_64bit <= 2147483648
Can Change          Immediately or at Next Boot


Tunable             maxuprc
Description         Maximum number of processes for each non-root user
Module              pm_proc
Current Value       3686 [((nproc*9)/10)]
Value at Next Boot  3687
Value at Last Boot  3686
Default Value       256
Constraints         maxuprc >= 3
                    maxuprc <= nproc - 5
Can Change          Immediately or at Next Boot


Tunable             semmns
Description         Maximum number of semaphores
Module              pm_usync
Current Value       4096 [Default]
Value at Next Boot  4096 
Value at Last Boot  4096
Default Value       4096
Constraints         semmns >= 2
                    semmns <= 335534080
                    semmns >= semmni
                    semmns >= semume
Can Change          At Next Boot Only


For changing the Value:


# kctune maxssiz=134217728
     ==> Update the automatic 'backup' configuration first? yes
             yes     - Update backup before every change
             once    - Update backup now; ask for each future change
             no      - Don't update backup now; ask for each future change
             disable - Don't update backup before any change
     ==> Update the automatic 'backup' configuration first? yes
       * The automatic 'backup' configuration has been updated.
       * Future operations will update the backup without prompting.
       * The requested changes have been applied to the currently
         running configuration.
Tunable                Value  Expression  Changes
maxssiz  (before)    8388608  Default     Immed
         (now)     134217728  134217728


# kctune maxssiz_64bit=1073741824
       * The automatic 'backup' configuration has been updated.
       * The requested changes have been applied to the currently
         running configuration.
Tunable                       Value  Expression  Changes
maxssiz_64bit  (before)   268435456  Default     Immed
               (now)     1073741824  1073741824


# kctune maxuprc=3687
       * The automatic 'backup' configuration has been updated.
       * The requested changes have been applied to the currently
         running configuration.
Tunable            Value  Expression      Changes
maxuprc  (before)   3686  ((nproc*9)/10)  Immed
         (now)      3687  3687


# kctune semmns=8192
NOTE:    The requested changes could not be applied to the currently
         running system, for the following reasons:
         - The tunable 'semmns' cannot be changed without a reboot.
       * The requested changes have been saved, and will take effect at
         next boot.
NOTE:    No change to the tunable 'semmns' was needed.
Tunable               Value  Expression
semmns   (now)         4096  Default
         (next boot)   8192  8192


After Changing the value using kctune command, it require a reboot of the system for some of the value to get effected. As show below output.


 
# kctune -v for  maxssiz maxssiz_64bit maxuprc semmns
Tunable             maxssiz
Description         Maximum size of the stack segment of a 32-bit process (bytes)
Module              vm
Current Value       134217728
Value at Next Boot  134217728
Value at Last Boot  134217728
Default Value       8388608
Constraints         maxssiz >= 262144
                    maxssiz <= 401604608
Can Change          Immediately or at Next Boot


Tunable             maxssiz_64bit
Description         Maximum size of the stack segment of a 64-bit process (bytes)
Module              vm
Current Value       1073741824
Value at Next Boot  1073741824
Value at Last Boot  1073741824
Default Value       268435456
Constraints         maxssiz_64bit >= 262144
                    maxssiz_64bit <= 2147483648
Can Change          Immediately or at Next Boot


Tunable             maxuprc
Description         Maximum number of processes for each non-root user
Module              pm_proc
Current Value       3687
Value at Next Boot  3687
Value at Last Boot  3687
Default Value       256
Constraints         maxuprc >= 3
                    maxuprc <= nproc - 5
Can Change          Immediately or at Next Boot


Tunable             semmns
Description         Maximum number of semaphores
Module              pm_usync
Current Value       8192
Value at Next Boot  8192
Value at Last Boot  8192
Default Value       4096
Constraints         semmns >= 2
                    semmns <= 335534080
                    semmns >= semmni
                    semmns >= semume
Can Change          At Next Boot Only