Archive

Archive for the ‘HP-UX’ Category

HP-UX fixing device names that change on a VG

April 13, 2016 Leave a comment

In a recent situation when the Physical Device names of a volume group changes and the VG fails to activate/mount, a rescan will be required.

First, backup lvmtab:
mv /etc/lvmtab /etc/lvmtab.old

Next, rescan for the VG information on the disks:
vgscan -a -v

This should create a new lvmtab file and the inactivated VGs should be found. Check lvmtab just in case:
strings /etc/lvmtab

Check the PVlinks information; it should show multiple paths to the same disk (assuming SAN environment):
vgdisplay -v vgxx

Next, activate you VGs that failed previously:
vgchange -a y vgxx

Resync vg information on disk:
lvlnboot -R

Advertisements
Categories: HP-UX, Uncategorized

HP-UX When Good Disks Go Bad (Procedure for disk replacement)

October 13, 2015 Leave a comment

System is HP-UX 11.23 RP3440

Methods are based off document:
http://www.filibeto.org/unix/hp-ux/lib/os/volume-manager/when-good-disks-go-bad-c01911837.pdf

#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 3
Act PV 3
Max PE per PV 4384
VGDA 6
PE Size (Mbytes) 32
Total PE 13122
Alloc PE 5001
Free PE 8121
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

— Logical volumes —
LV Name /dev/vg00/lvol1
LV Status available/stale
LV Size (Mbytes) 1792
Current LE 56
Allocated PE 168
Used PV 3

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 13024
Current LE 407
Allocated PE 1221
Used PV 3

LV Name /dev/vg00/lvol3
LV Status available/stale
LV Size (Mbytes) 3008
Current LE 94
Allocated PE 282
Used PV 3

LV Name /dev/vg00/lvol4
LV Status available/stale
LV Size (Mbytes) 512
Current LE 16
Allocated PE 48
Used PV 3

LV Name /dev/vg00/lvol5
LV Status available/stale
LV Size (Mbytes) 28000
Current LE 875
Allocated PE 2625
Used PV 3

LV Name /dev/vg00/lvol6
LV Status available/stale
LV Size (Mbytes) 128
Current LE 4
Allocated PE 12
Used PV 3

LV Name /dev/vg00/lvol7
LV Status available/stale
LV Size (Mbytes) 4640
Current LE 145
Allocated PE 435
Used PV 3

LV Name /dev/vg00/lvol8
LV Status available/stale
LV Size (Mbytes) 2240
Current LE 70
Allocated PE 210
Used PV 3
— Physical volumes —
PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c2t1d0
PV Status unavailable
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c3t2d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

#lvdisplay -v /dev/vg00/lvol1
— Logical volumes —
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/stale
Mirror copies 2
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1792
Current LE 56
Allocated PE 168
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

— Distribution of logical volume —
PV Name LE on PV PE on PV
/dev/dsk/c2t0d0 56 56
/dev/dsk/c2t1d0 56 56
/dev/dsk/c3t2d0 56 56

#isocan -fCdisk
sh: isocan: not found.
dawson3 #ioscan -fCdisk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GMAW3147NC
disk 2 0/1/1/0.1.0 sdisk NO_HW DEVICE HP 146 GMAW3147NC
disk 3 0/1/1/1.2.0 sdisk CLAIMED DEVICE HP 146 GST3146707LC
disk 5 0/3/1/1.1.6.0.0.0.0 sdisk CLAIMED DEVICE NETAPP LUN
disk 4 0/3/1/1.1.7.0.0.0.0 sdisk CLAIMED DEVICE NETAPP LUN
disk 7 0/4/1/1.1.6.0.0.0.0 sdisk CLAIMED DEVICE NETAPP LUN
disk 6 0/4/1/1.1.7.0.0.0.0 sdisk CLAIMED DEVICE NETAPP LUN
# pvdisplay /dev/dsk/c2t1d0|grep “PV Status”
PV Status unavailable

#diskinfo /dev/rdsk/c2t1d0
diskinfo: can’t SIOC_INQUIRY /dev/rdsk/c2t1d0: No such device or address

#### Now, lvreduce from 2 mirror copies down to 1 and disable autobackup:

#for i in 1 2 3 4 5 6 7 8
> do
> lvreduce -m 1 -A n /dev/vg00/lvol$i /dev/dsk/c2t1d0
> done

#### This may take 10min per LV, so do it from a screen session

Once completed, vgreduce (remove the PV from the VG)

On releases prior to HP-UX 11.31

# vgreduce vg00 /dev/dsk/c2t1d0

# vgscan –v ## Not necessary to run

Now replaced the failed drive (RP3440 is hot-pluggable)

# vgdisplay -v vg00 ## Before VGREDUCE

— Physical volumes —
PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c2t1d0
PV Status unavailable
Total PE 4374
Free PE 4374
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c3t2d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

# vgdisplay -v vg00 ## AFTER VGREDUCE, note the bad drive is no longer there

— Physical volumes —
PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c3t2d0
PV Status available
Total PE 4374
Free PE 2707
Autoswitch On
Proactive Polling On

Categories: HP-UX

Syslog output to remote host

August 1, 2012 Leave a comment

Syslog will output to UDP port 514 on a remote host.

Configuring syslog to remote hosts on the local sending host:
For RHEL/OEL Linux:
Edit /etc/syslog.conf
Append the desired messages to receive to remote host:
*.* @
#service syslogd restart

On HP-UX:
Edit /etc/syslog.conf
Choose the level of logging desired.
Append to file.
*.emerg;*.alert;*.crit;*.err;*.warning;*.notice;*.info;*.debug @
#/sbin/init.d/syslogd stop
#/sbin/init.d/syslogd start

Test by generating a syslog message:
#logger “Test alert from “

Categories: HP-UX, Linux, Redhat

HP-UX reuse password

If you get in a situation where you want to change a password to an old, previous password, but you can’t due to the internal reuse policy, try the following:

#/sbin/passwd <user>

This should work and bypass it. Type it exactly as above.

Categories: HP-UX

Monitor disk usage on HP-UX

July 26, 2011 Leave a comment

If you don’t have a fancy monitoring system, put a script in a cronjob like the one below and it will email you if you are below your thresholds.

#!/bin/sh

# These limits are for AVAIL column in MBs from bdf output
# warn = 80MB, low = 50MB
warn=80000
low=50000

email=user@domain.com

# Excluding /home since it really isnt being used; always put / last in filesystems
filesystems=”/stand /var /usr /tmp /opt /”

for fs in $filesystems
do
size=`bdf $fs|grep $fs|awk ‘{ print $4; }’`
if [ $size -le $low ]
then
mailx -s “URGENT: Low disk space for $fs, ($size)MB left” $email < /dev/null
break
fi
if [ $size -le $warn ]
then
mailx -s "WARNING: Low disk space for $fs ($size)MB left" $email < /dev/null
fi
done

Categories: HP-UX, Linux

How to export and import kernel parameters from one HP-UX server to another

February 24, 2011 Leave a comment

First off, to export/import the kernel parameters, the systems have to be similar and running the same versions of HP-UX on same platform (PA-RISC or Itanium).

To export current running kernel configs from 11.23:
kconfig -e filename

To import from kernel dumpfile in 11.23:
kconfig -i filename

For 11.11, use SAM to export and import under kernel parameters section.

Categories: HP-UX

Mount Options for Oracle files when used with NAS devices

November 12, 2010 Leave a comment

Operating
System

Mount options for Binaries

Mount options for
Oracle Datafiles

Mount options for CRS Voting Disk and OCR

Sun Solaris *

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,suid

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,
forcedirectio, vers=3,suid

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,vers=3,noac,
forcedirectio

AIX (5L) **

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,
vers=3,timeo=600

cio,rw,bg,hard,nointr,
rsize=32768,
wsize=32768,tcp,noac,
vers=3,timeo=600

cio,rw,bg,hard,intr,rsize=32768,
wsize=32768,tcp,noac,
vers=3,timeo=600

HPUX 11.23 ****

rw,bg,vers=3,proto=tcp,noac,hard,
nointr,
timeo=600,rsize=32768,
wsize=32768,suid

rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,
timeo=600,
rsize=32768,wsize=32768,suid

rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,
timeo=600
,rsize=32768,wsize=32768,suid

Windows

Not Supported

Not Supported

Not Supported

Linux x86

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600

Linux x86-64

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,vers=3,
timeo=600,
noac

Linux – Itanium

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600

* The NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp)
*** NAS devices are only supported with HPUX 11.23 ONLY

Please refer to Doc ID: Note:359515.1 for future updates.

Here’s an example of the NFS command with the options suitable for RAC databases:
mount -t nfs -o rw,rsize=32768,wsize=32768,tcp,hard,nointr,nfsvers=3,bg,actimeo=0,timeo=600,suid,async mac:/data/NFS /NFS

Categories: HP-UX, Linux, Oracle, Redhat