msgbartop
Tips and Tricks site for advanced HP-UX Engineers
msgbarbottom

04 Jun 12 Cleaning up an hp-ux depot

This post was a long time coming. It was posted to a powerpoint presentation years ago. Nine years ago to be exact.

–My depot is too big and contains patches that are superseded a few times, what to do?
–cleanup –p –d <depot.name> # preview
cleanup –d  <depot.name>
When you run it:
Removing superseded 11.X patches from depot: /depot/PATCH …done.
The superseded 11.X patches have been removed from the depot:
/depot/PATCH.
All information has been logged to /var/adm/cleanup.log.
### Cleanup program completed at 06/04/12  11:32:38

16 Feb 12 Enabling a falsely disabled OnlineJFS license

Older versions of HP-UX 11.11,11.23 and 11.31 do suffer from the OnlineJFS license disabling itself. This was due to a product defect from Symanntec which HP let into a depot a few years ago.

System had this license information:

vxlicrep[/root] # vxlicrep

Symantec License Manager vxlicrep utility version 3.02.19.0
Copyright (C) 1996-2006 Symantec Corporation. All rights reserved.

Creating a report on all VERITAS products installed on this system

—————–***********************—————–

License Key = 3JZU-WDP6-PP6C-P4O4-HS38-NPPO-P
Product Name = VERITAS File System
Serial Number = 1
License Type = PERMANENT
OEM ID = 4095

Features :=
HP_OnlineJFS = Enabled

CPU Count = Not Restricted
Platform = HP-UX
Version = 4.1
File Change Log = Enabled
Maximum number of file systems = Not Restricted

Command and response.
fsadm: /etc/default/fs is used for determining the file system type
vxfs fsadm: V-3-25255: fsadm: You don’t have a license to run this program

[/root] # vxenablef -a

After the vxenablef -a statement the fsadm command starts to work. This will is not a license bypass. If the system is not actually licensed it won’t work.

fsadm command works after this correction.

Tags: , ,

28 Aug 11 Using Ignite-UX to improve quality assurance in a large HP-UX environment

  • Maintain a legacy golden image in case problem is discovered with a newly developed build image.
  • Maintain a current golden image that includes all the latest patches, kernel tweaks and version improvements. Improve the speed of system recovery from unforeseen problem. Improve build consistency.
  • Maintain two current Ignite images that are system specific for each HP-UX host. This is the first line of defense in any problem or DR situation
  • Maintain major patch sets on the Ignite server and enabled scripted, automated patch implementation.
  • Use audit scripts and health check scripts to insure all systems are always up to organizational audit standards.



28 Aug 11 Finding someone for your next HP-UX build

Core competencies of our owner and fearless leader

  • npar/vpar build up from the bare metal, virtualization. How to build a cloud on the big iron
  • HPVM Virtualization on Itanium
  • Logical Volume Manager (LVM)
  • Vertias Volume Manager VxVM(1 year on platform)
  • HP Serviceguard High Availability Cluster.
  • APA Auto Port Aggregation
  • Work Load Manager (WLM)
  • Kernel Tuning, optimization, tuning for large database servers.
  • HP tools such as kmeminfo, SysInfo (and much much more)
  • Automation Scripting to improve outcome of repetitive systems administration tasks.
  • SD-UX Software Distributor, building patch sets.
  • OE(Operating Environment) update to roll out improvements in networking and input/output subsystems that are not in the bi-annual patch set.
  • Audit Scripting
  • Health Check scripting for day to day use after routine work.
  • DRD, Dynamic Root Disk for OE updates and bi-annual patching to minimize downtime.
  • Ignite-UX (see an article on this upcoming)




Quality Assurance Improvements done on previous assignments:

  • Boot host before patches or major updates. Make sure system still boots and that major applications have not been modified into a non-starting state.
  • Check that a kernel can be compiled before patching (basic health check needed for any major update)
  • Run a patch consistency check prior to major work.
  • Use system health check before patching to insure pre update health.

Maybe ISN Corporation should be working on your next big HP-UX system build

26 Aug 11 Quick and dirty ldap/sudo migration

You stand up a new HP-UX host. sudo and ldap won’t work.

You know it should have been built into the Golden image but you never had time. Your organization requires sudo and ldap.

Temporary procedure to restore ldap and sudo functionality.

HP-UX 11.31 Itanium

Step 1: Log on to a working production box.

cd /etc/opt/ldapux

scp -rp * working_host:/$PWD

scp -p /etc/sudoers targethost:/etc

 

scp –p /sbin/init.d/ ldapclientd.rc  targethost:/sbin/init.d

12 Jul 11 Migrate VXVM booted system to LVM

From the HP-UX Veritas Administration guide, buried on page 106

This example shows how to create an LVM root disk on physical disk c0t1d0
after removing the existing LVM root disk configuration from that disk.

BOOTBG=$(vxdg bootdg)

vxprint -htg $BOOTDG | grep ^dm

dm rootdisk01   disk233_p2   auto     1024     142450592 –
dm rootmirr     disk234_p2   auto     1024     142450592 –

# You get the boot disk from this command. Break off the s2 if you are using legacy devices you can use them or the agile SDF devices.

# You may need to use vxbrk_mirror to break the mirror. Make sure you know which disk you are booted from. Check syslog to be sure. setboot is not a good indicator.

# Due to a wordpress error I’ve been forced to take the path etc vx bin out of the commands. I will fix this when wordpress stops blowing chunks on this data. Where there are spaces there need to be slashes.
#  etc vx bin vxdestroy_lvmroot -v c0t1d0
# etc vx bin vxres_lvmroot -v -b c0t1d0
The -b option to vxres_lvmroot sets c0t1d0 as the primary boot device.
As these operations can take some time, the verbose option, -v, is specified to
indicate how far the operation has progressed.

This command takes care of setboot and all details. Then just boot from the console.

This procedure does not remove VxVM software. The daemon still runs. But your system now boots LVM and that makes using Dynamic Root Disk (DRD) much easier.

 

Tags: , , , , , ,

05 Jul 11 VxVM replace boot disk

Create a partition description file

(Need to update the EFI and HPSP size below according to the other root disk partition’s size)
This examples is where the new disk is disk85. Applies only to HP-UX 11.31 with VxVM as boot drive manager.

# vi /tmp/efipart

3
EFI 500MB
HPUX 100%
HPSP 400MB

Use the idisk(1M) command to partition the disk according to this file
# idisk -wf /tmp/efipart /dev/rdisk/disk85

Write EFI info to the EFI partition on the disk
# mkboot -e -l /dev/rdisk/disk85

Confirm the AUTO file entry is intact It should be  “boot vmunix”
# efi_cp -d /dev/rdisk/disk85_p1 -u /EFI/HPUX/AUTO /tmp/efi; cat /tmp/efi

If found any difference, edit /tmp/efi file  as below to update the entry “boot vmunix”
#echo “boot vmunix ” > /tmp/efi

Update auto file
#efi_cp -d /dev/rdisk/disk85_p1 /tmp/efi /EFI/HPUX/AUTO

Confirm the AUTO file entry again, It should be  “boot vmunix”
# efi_cp -d /dev/rdisk/disk85_p1 -u /EFI/HPUX/AUTO /tmp/efi; cat /tmp/efi

Initialize the disk as VXVM  boot disk

#### vxdisksetup -iB disk85_p2  ((lives in etc vx bin slashes removed due to Word Press error))

Add the disk to the existing rootdg
# vxdg -g rootdg adddisk rootdisk02=disk85_p2

Write Volume Manager volume information to the LABEL file:
# /opt/VRTS/bin/vxbootsetup rootdisk02

Display the LIF and Volume Manager label information:
# vxvmboot -v /dev/rdisk/disk85

Check the Mirror status  ( Each volume should be with two plex )
$ vxprint –htg rootdg |egrep –i “^v|^pl”

 

Tags: , , , ,

15 Jun 11 Why HP-UX root shell needs to be /sbin/sh

Thanks to Jibn Antony of the Best Buy IDC team for validating.

So who cares what the root shell is? You do if you try to boot your system into single user mode with root shell changed to a shared executable shell, you will find out the hard way. The system won’t boot.

root@dxd22hxd# ls -l /bin/ksh
-r-xr-xr-x   2 bin        bin         538632 Nov 12  2007 /bin/ksh*
root@dxd22hxd# ldd /bin/ksh
        libnsl.so.1 =>  /usr/lib/hpux32/libnsl.so.1
        libxti.so.1 =>  /usr/lib/hpux32/libxti.so.1
        libc.so.1 =>    /usr/lib/hpux32/libc.so.1
        libc.so.1 =>    /usr/lib/hpux32/libc.so.1
        libxti.so.1 =>  /usr/lib/hpux32/libxti.so.1
        libdl.so.1 =>   /usr/lib/hpux32/libdl.so.1
root@dxd22hxd# ldd /sbin/sh
ldd: “/sbin/sh” is not a shared executable.
root@dxd22hxd# ls -l /sbin/sh
-r-xr-xr-x   1 bin        bin        1402600 Oct 23  2007 /sbin/sh*
Note that /bin/ksh requires /usr to be mounted which is not the case with single user or lv maintenance mode.

Tags: ,

11 Apr 11 swlist check the state of patches

swlist -l fileset -a state | grep -v config | sed ‘/^#/d’

 

Output looks like this:
PHCO_36551.CORE2-64SLIB               transient
PHCO_36551.CORE2-SHLIBS               transient

Look for stuff that is in state installed instead of configured.

swconfig \* or swconfig PHCO_36551 may fix the issue.

Tags: , ,

06 Apr 11 setboot hardware path to legacy hardware path. A converter.

HP-UX 11.23

setboot provides output only including the hardware path (ioscan -H).

When calculating DRD clone targets and such you need the regular legacy device path.

Here is a converter, built with a little help from JRF on the ITRC forums.

First get the setboot path. Might want to use the full path of the setboot command in practice.

pboot=$(setboot | grep ^Primary | awk ‘{ print $NF }’);
aboot=$(setboot | grep ^Alternate |awk ‘{ print $NF}’);

abootdisk=$(ioscan -kfnCdisk | awk -v aboot=${aboot} ‘/aboot/ $0~aboot {getline;print aboot,$2}’ | awk ‘{ print $2 }’);

pbootdisk=$(ioscan -kfnCdisk | awk -v aboot=${pboot} ‘/pboot/ $0~pboot {getline;print pboot,$2}’ | awk ‘{ print $2 }’);

The slick part is getting the variable in and out of awk.

Uses ioscan.

Tags: , , ,

sidebarbottom
sidebartop
sidebarbottom
WhatsApp chat