Archive

Archive for August, 2010

HP-UX mirroring with mirror-ux

August 30, 2010 Leave a comment

Steps to create a mirrored boot disk on PA-Risc HP-UX (10.x and 11.x) systems:

  • In order to mirror disks on HP-UX, you must have Mirror-Disk-UX installed. The following command will check if it’s installed or not:
 # swlist -l fileset | grep -i mirror
  • You should see something similar to below:
LVM.LVM-MIRROR-RUN
  • In this example, the disk to be used as the additional mirror copy will be /dev/dsk/c0t5d0, which will include root and the swap logical volumes. The primary mirror copy will be on /dev/dsk/c0t6d0.
  • To mirror the root file system, add a bootable LVM disk. Create a physical volume using the pvcreate command:
 # pvcreate -B /dev/rdsk/c0t5d0
  • Add the physical volume to the existing root volume group with vgextend:
 # vgextend /dev/vg00 /dev/dsk/c0t5d0
  • Use the mkboot command to place boot utilities in the boot area:
 # mkboot -l /dev/rdsk/c0t5d0
  • Use mkboot to add an AUTO file in the boot LIF area. If only two disks are in the root volume group (recommended), be certain to use the -lq option in the event of a disk failure which results in a loss of quorum. If more than two disks are in the root volume group, quorum will be maintained without the -lq option.
 # mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
  • Verify the contents of the AUTO file in the boot area:
 # lifcp /dev/rdsk/c0t5d0:AUTO -
  • Determine the hardware address of the disk which will become the mirror disk with the ioscan command:
 # ioscan -fnC disk
  • Set the alternate boot path variable according to the hardware path determined above (example below):
 # setboot -a 8/0/19/0.5.0
  • To validate it was set, use the setboot command without any parameters.
  • Activate the autosearch and autoboot capabilities:
 # setboot -s on -b on
  • Use the pvdisplay command to view the order of the logical volumes on the primary disk:
 # pvdisplay -v /dev/dsk/c0t6d0
  • Mirrot the boot, primary swap, root, and other logical volumes as needed to the mirror disk in the correct sequence found above. In the following, the standard sequence of lvol1, lvol2, lvol3 and so on is assumed:
 # lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
 # lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
 # lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
 # lvextend -m 1 (additional LV as necessary)
  • Use the pvdisplay command to view the order of the logical volumes on the mirror disk to validate the are in the correct order:
 # pvdisplay -v /dev/dsk/c0t5d0
  • Update all physical volumes in the volume group so that the logical volumes become the root, boot, primary swap or a dump volume when the system is booted next:
  • For HP-UX 10.20(not updated to) and 11.x only:
 # lvlnboot -r /dev/vg00/lvol3 /dev/vg00
 # lvlnboot -b /dev/vg00/lvol1 /dev/vg00
 # lvlnboot -s /dev/vg00/lvol2 /dev/vg00
 # lvlnboot -d /dev/vg00/lvol2 /dev/vg00
  • For HP-UX 10.01, 10.10, and updated to 10.20 only:
 # lvlnboot -r /dev/vg00/lvol1 /dev/vg00
 # lvlnboot -s /dev/vg00/lvol2 /dev/vg00
 # lvlnboot -d /dev/vg00/lvol2 /dev/vg00
  • To validate the updates, check with:
 # lvlnboot -v
  • Both disks must be listed for root, boot and swap definitions. Without the lvlnboot sequence, the system will not be able to boot automatically if the primary disk fails. In order to correct it then, the system will have to be booted into LVM maintenance mode.
  • In order to test the mirror configuration, shut down the system and boot from the mirror disk:
 # shutdown -ry 0
  • The system will begin to shutdown and reboot. As the system starts to come back up, look for a message similar to:
 TO INTERRUPT THE BOOT SEQUENCE, PRESS ...
  • Interrupt the book sequence. This will display the Boot Admin display. At the boot_admin> prompt, type:
 bo <Alternate disk's hardware path>      -or-
 bo alt
  • If the alternate boot device has been configured properly, the system will prompt to interact with the IPL. Answer “no”, and the system will boot from the mirror root disk.

Installation of Offline Diagnostics (ODE) on Mirrored Boot Disks

  • Check the existance of the updatediaglif file:
 # ll /usr/sbin/diag/lif/updatediaglif
  • List the contents of the LIF directory of the mirror:
 # lifls -l /dev/rdsk/c0t5d0
  • Use the getconf command below to determine which type of cpu is supported (32, 32/64, 64):
 # getconf HW_CPU_SUPP_BITS
  • Install the ODE LIF files with mkboot and protect (-p) the existing LIF files which you detected with lifls in previous step:
 # mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD
-p LABEL /dev/rdsk/c0t5d0
  • For pure 64-bit (No 32-bit CPU support) systems use:
 # mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD
-p LABEL /dev/rdsk/c0t5d0
  • Check with the lifls command:
# lifls /dev/rdsk/c0t5d0

Here’s a link to a doc on how to vgfcrestore and lvsplit if you should need to do a recovery or lvsplit a mirror and back it up:
MIRROR-UX failure recovery options

Categories: HP-UX

How to kill all of a user’s sessions

August 30, 2010 Leave a comment

When dropping a user fails with sessions still connected, the following script will end all of those and allow you to complete your task.
–Kill all the Oracle connections script
DECLARE — declare variables
  CURSOR c1 IS
  select sid, serial# from v$session
  where username=’TESTUSER’;  — declare cursor
— declare record variable that represents a row fetched
   kill_it c1%ROWTYPE; — declare variable with %ROWTYPE attribute
BEGIN
— open the explicit cursor c1
  OPEN c1;
  LOOP
    FETCH c1 INTO kill_it; — retrieve record
    EXIT WHEN c1%NOTFOUND;
    BEGIN
      EXECUTE IMMEDIATE ‘alter system kill session ”’||
       kill_it.sid||’, ‘||kill_it.serial#||””;
    END;
  END LOOP;
  CLOSE c1;
END;

/

Categories: Oracle

Getting your HP-UX CSA certification

August 25, 2010 Leave a comment

I took the exam for HP-UX CSA many years ago and have been certified since. Even if you aren’t interested in certification exams, it is good to know the fundamentals/basics of HP-UX.  You might think certifications are not that important, but to employers, VARs or reputable consulting organizations — it provides the first glimpse into the qualifications of its members.  If you have never met a consultant, what baseline would you ask for?  This book will help get you get certified.

Categories: HP-UX

My recommended 1 TB USB external storage drive

August 25, 2010 Leave a comment

I really like this external HD below.  Not only is it of small profile, but performance is excellent.  Keep your files backed up daily from your desktop and/or your laptop.  Even keep one at the office.

Categories: Uncategorized

HP-UX extending a filesystem

August 24, 2010 Leave a comment

Confirm OnlineJFS is installed:
#swlist | grep -i online
#lvextend -L <new size in MB> <logical vol>
#fsadm -F vxfs -b <new size in MB>M <mountpoint>

Example:
#lvextend -L 5120 /dev/vg00/lvol5
#fsadm -F vxfs -b 5120M /home

If you don’t have OnlineJFS installed, you will have to umount and remount:
# umount /home
# lvextend -L 81920 /dev/vg00/lvol5
# extendfs -F vxfs /dev/vg00/rlvol5
# mount /dev/vg00/lvol9 /home
If you can not umount the filesystem, then you will have to boot into single-user mode and manually finish the process.

Of course you always have the option of running “sam” as well.

Categories: HP-UX

Setting up an HP-UX Ignite-UX server

August 11, 2010 Leave a comment

For the purposes of this installation guide, I will be using an HP-UX 11.11 PA-RISC (rp3440) server.

First, download the Ignite-UX software from HP’s website, http://software.hp.com.  It is freely available and the version I’ve chosen is all “3 bundles.”

Documentation can be found here:
http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c01942571/c01942571.pdf

I’ve downloaded to /var/tmp directory and now will install the software:
#swinstall -s /var/tmp/Ignite-UX-11-ALL_C.7.10.474.depot \*

To verify your installation:
#swlist | grep -i ignite
  IGNITE                        C.7.10.474     HP-UX Installation Utilities (Ignite-UX)
  Ignite-UX-11-11               C.7.10.474     HP-UX Installation Utilities forInstalling 11.11 Systems
  Ignite-UX-11-23               C.7.10.474     HP-UX Installation Utilities forInstalling 11.23 Systems
  Ignite-UX-11-31               C.7.10.474     HP-UX Installation Utilities forInstalling 11.31 Systems

From a client you want to make the “golden image” from, you’ll only need “make_sys_image” script and can be copied to /tmp without having to install the Ignite software.
#chmod +x /tmp/make_sys_image
For this image I will place it on an NFS server (already mounted).  Reason I am doing this is because the Ignite-UX server shares this same mount point.  Other option is to use “-s dest_IP” if you have a server to send it to.  I’ve also declined not to use compression (-c n, gzip is default).
#/tmp/make_sys_image -s local -d /directory_to_place_image -c n

Now configure the Ignite-UX server to recognize the new golden image.
#cp /opt/ignite/data/examples/B.11.11.golden_image.cfg /var/opt/ignite/data/Rel_B.11.11/golden_image.cfg
Make sure your /etc/exports contains the /var/opt/ignite/clients directory.
#cat /etc/exports
/var/opt/ignite/clients -anon=2
### Next 2 lines below don’t actually work since you can’t share NFS mounts from an NFS mount, but added as examples
/netapp/testoutput/ignite/REL_B.11.11 -anon=2,ro
/netapp/testoutput/ignite/REL_B.11.23 -anon=2,ro
#exportfs -a

Ignite-UX manages the directories for images from /var/opt/ignite/data/INDEX file.  Below, I’ve created an additional golden image cfg stanza:
cfg “HP-UX B.11.11 hpapp1 parisc archive” {
        description “This image is from a preconfigured B.11.11 release.”
        “/opt/ignite/data/Rel_B.11.11/config”
        “/var/opt/ignite/data/Rel_B.11.11/hpapp1_archive.cfg”
        “/var/opt/ignite/data/config.local”
}

Modify /var/opt/ignite/data/Rel_B.11.11/golden_image.cfg for sw_sel and sw_source:
nfs_source = “172.25.101.179:/netapp/testoutput/ignite/REL_B.11.11/hpapp1.none”
Remove the “init sw_sel” clauses that will not be used (i.e. “golden image – 32 bit OS”)
Change “init sw_sel” for your appropriate image’s description:
description = “hpapp1 archive HP-UX 11.11 CDE – 64 Bit OS”
archive_path = “hpapp1.none”
Replace “impacts” lines in the “init sw_sel” clause by executing “archive_impact”
#/opt/ignite/lbin/archive_impact -t /netapp/testoutput/ignite/REL_B.11.11/hpapp1.none
My example output:
init sw_sel “golden image – 64 bit OS” {
    description = “hpapp1 archive HP-UX 11.11 CDE – 64 Bit OS”
    sw_source = “core archive”
    sw_category = “HPUXEnvironments”
    archive_type = tar
    archive_path = “hpapp1.none”
    impacts = “/” 34Kb
    impacts = “/.ssh” 8Kb
    impacts = “/dev” 13Kb
    impacts = “/etc” 95311Kb
    impacts = “/opt” 2710993Kb
    impacts = “/sbin” 44769Kb
    impacts = “/stand” 1337Kb
    impacts = “/u01” 6199689Kb
    impacts = “/usr” 1253929Kb
    impacts = “/var” 3134736Kb
 } = TRUE

Verify and fix, if needed, the syntax of the INDEX file:
# /opt/ignite/binpa/instl_adm -T

Register clients to the Ignite-UX server:
#/opt/ignite/binpa/ignite
Click on server setup, configure booting IP addresses now and add IP and MAC address info.  You can choose the same IP you made the archive from since you would use it for a restoration procedure.  Skip DHCP Setup.

Configure the client to install the golden image:
If the client is already running HP-UX, boot it by:
#bootsys -v -w client_hostname 
client_hostname = name of the client
If the client is not running HP-UX, boot the system from the console and interrupt the boot process.
firmware prompt>boot lan.n.n.n.n install
where: n.n.n.n is the IP of the Ignite-UX server.

Using make_net_recovery
In short, make_net_recovery takes the place of make_tape_recovery so you won’t have to have a backup tape drive and tapes.  As long as you have available disk space, this method seems to be the best for administration and manageability.

For HP-UX IA server example:
#/opt/ignite/binia/make_net_recovery -s 172.25.101.179 -a 172.28.2.7:/vol/IandT/testoutput/ignite/REL_B.11.23/birch -x inc_entire=vg00 -N
The “-a” specifies an alternative NFS server to place the archive in, “-x” says to include only volume group vg00, and “-N” dictates no compression will be used.

For HP-UX PARISC example:
#/opt/ignite/binpa/make_net_recovery -s 172.25.101.179 -a 172.28.2.7:/vol/IandT/testoutput/ignite/REL_B.11.23/birch -x inc_entire=vg00 -N
The “-a” specifies an alternative NFS server to place the archive in, “-x” says to include only volume group vg00, and “-N” dictates no compression will be used.

Categories: HP-UX

Useful EMC Powerpath commands

August 10, 2010 Leave a comment

Install or check EMC powerpath licensing:
#emcpreg -install

Check for new devices
#powermt config

Check for dead paths
#powermt check [hba=all]

Configure policy to use
#powermt set policy

Display devices and number of paths
#powermt display [dev=all]

Remove devices
#powermt remove dev=all

Save the configuration
#powermt save

Categories: EMC, HP-UX, Linux, Powerpath, Redhat