HP Ux Tips and Procedures
HP Ux Tips and Procedures
Note down the next available minor no. In this example we can use
0x020000 (0x for hex then 02 is for VG and next 0000 is reserved for logical volumes)
mkdir /dev/vg-test
mknod /dev/vg-test/group c 64 0x02000
vgcreate /dev/vg-test /dev/dsk/c1t15d0 (assuming on this disk you want to create VG)
then
lvcreate -r n -L 20480 -n lv-TEST /dev/vg-TEST (assuming 20GB LV Size you want)
newfs -F fxfs -o largefiles /dev/vg-test/rlv-test
mount /dev/vg-test/lv-test /test
To check the contents of a Itanium based Systems make_tape_recovery do the following. you use -xvf to
restore any file too.
mt -t /dev/rmt/0mn rew
mt -t /dev/rmt/0mn fsf 22
tar -tvf /dev/rmt/0mn
then run
To register the same depot (mounted at /mnt/cd on the local host) as a depot to be available on the network, type:
The following example enables direct access from one or two other systems to the HWEnable11i depot on the Support Plus CD,
assuming the Support Plus CD is mounted at /cdrom:
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=1
GATED=0
GATED_ARGS=""
RDPD=0
RARP=0
PAY ATTENTION: In this file the hostname ist NOT set, the subnetmask is
set to 255.255.255.255 and all route entries are removed!
f) Create a rc file, that blanks out the /etc/dhcpclient.data at each shutdown. The link should be a K-Link in /sbin/rc0.d/
(For instructions how to create a working rc script see /sbin/init.d/template)
Steps to create a device file manually for Robot for Veritas netbackup
ioscan -fnk|grep for the controller the robot has connecetd
Note down the Ext Bus Card instance no.
Example :
We have a IBM 3581 Scaller Library Connected to SCSI LVD Card at Hardware Address 0/0/1/0 .SCSI ID of the Library is
14, LUN no. of the Robot is 1 and the drive LUN no. is 0
sctl
driver 0/0/1/0.14.1 sctl
/usr/sbin/mk_kernel -s /stand/system
kmupdate
reboot
The reason to change it to 100 is the robotic device is controlled by the 1st Tape Drive in the Tape partition so the robot
and the drive is same device (Drive scsi/fscsi id is 0 and robot is 1 , always)
then the major and minor no for new device will be 203 and 0x062e100 respectively.
For STK L700/L180 and Quantum ATLP4000 Libraries the minor no. will be same as the device in /dev/rac.
sctl
driver 0/0/1/0.14.1 sctl
/usr/sbin/mk_kernel -s /stand/system
HPUX Tips
kmupdate
reboot
Create a /etc/vx/disks.exclude file if you want some disks to be excluded from vxvm
vxconfigd
Initial Setup
Step 1. Place disks under Volume Manager control.
Step 2. Create new disk groups (if you do not want to use rootdg or you want
other disk groups).
Step 3. Create volumes.
Step 4. Put file system(s) in volumes.
Options
Maintenance
Vxvm Commands
To display free space for a disk group, use the following command:
vxdg -g diskgroup free
Creating Volumes
Now create a file systems in it and mount and change /etc/fstab (HP-UX)
or /etc/vfstab (Soaris)
To move a disk between disk groups, remove the disk from one disk
group and add it to the other. For example, to move the physical disk
c0t3d0 (attached with the disk name disk04) from disk group rootdg
and add it to disk group mktdg, use the following commands:
vxdg rmdisk disk04
vxdg -g mktdg adddisk mktdg02=c0t3d0
To remove disk02 from rootdg with chance of data loss, use the following command:
vxdg rmdisk disk02 -k
fragmentation is approaching the figures for bad fragmentation, then the interval between fsadm runs
should be reduced. If the degree of fragmentation is low, the interval between fsadm runs can be
increased.
The “after” result is an indication of how well the reorganizer is performing. The degree of fragmentation
should be close to the characteristics of an unfragmented file system. The file system may be a candidate
for expansion. (Full file systems tend to fragment and are difficult to defragment.) It is also possible that
the reorganization is not being performed at a time during which the file system in question is relatively
idle. Directory reorganization is not nearly as critical as extent reorganization, but regular directory
reorganization will improve performance. It is advisable to schedule directory reorganization for file
systems when the extent reorganization is scheduled. The following is a sample script that is run
periodically at 3:00 A.M. from cron for a
number of file systems:
outfile=/tmp/fsadm_out.&212#;/bin/date +’%m%d’&212#;
for i in /home /home2 /project /db
do
/bin/echo "Reorganizing $i"
/bin/timex fsadm -F vxfs -e -E -s $i
/bin/timex fsadm -F vxfs -s -d -D $i
done > $outfile 2>
# shutdown -r -y 0
18. Select "HP-UX HA Alternate Boot" to test the mirror.
EFI Boot Manager ver 1.10 [14.61] Firmware ver 2.21 [4334]
Please select a boot option
HP-UX Primary Boot: 0/1/1/0.1.0
HP-UX HA Alternate Boot: 0/1/1/1.2.0
EFI Shell [Built-in]
20. Verify which disk/kernel you booted from.
# grep "Boot device" /var/adm/syslog/syslog.log
vmunix: Boot device's HP-UX HW path is: 0.1.1.1.2.0
21. Remove temporary files.
# rm /tmp/partitionfile /tmp/AUTO*
Done.
Date 0/31/04
Use rmsf command to remove the entries (Cause: Migrated from old Symmetrix to a new Symmetrix)
Host cannot see more than 8 luns per port ( From EMC)
For HP-UX hosts with HDS 9960 or HP XP512 arrays: Set the host mode to 03, not 08, as the HDS documentation specifies.
Setting the host mode to 03 enables the host to see more than 8 LUNs per port.
How to test if PowerPath is load balancing and configured properly to failover (emc87060)
The following procedure can be used to make sure that PowerPath is configured properly for load balancing and failover.
This example was done on an HP-UX machine, but it will work (with modifications for the device names) on any Unix host:
Pick a Symmetrix device and note all of the native paths configured for that device:
Start I/O to a single device in the group (in this case, use the block device as the input file and /dev/null as the output file to read
from the device):
# dd if=/dev/dsk/c24t0d1 of=/dev/null
# sar -d 10
HP-UX curly B.11.11 U 9000/800 05/18/04
15:54:21 device %busy avque r+w/s blks/s avwait avserv
15:54:31 c1t2d0 0.50 0.50 3 44 4.30 1.54
c24t0d1 6.79 0.50 336 2688 5.04 0.24
c35t0d1 8.08 0.50 336 2688 5.04 0.21
c37t0d1 6.79 0.50 336 2688 5.03 0.25
c38t0d1 7.68 0.50 336 2689 5.05 0.21
Note: In the above example, there is only I/O down the four paths to device 0011 and to the internal disk (c1t2d0). If there is
I/O to many devices on the system (almost certain in a production environment), egrep can be used to display only the paths
to the Symm device in question:
How to interpret HP-UX device numbers from SCSI read and write errors in the syslog - emc88252
When SCSI read and write errors are logged in the syslog, the device number is written in hex. For example:
Jun 2 21:13:38 pdb01 vmunix: SCSI: Read error -- dev: b 31 0x2b8400, errno: 126, resid: 8192,
Jun 2 21:13:39 pdb01 above message repeats 13 times
Jun 2 21:13:39 pdb01 vmunix: - dev: b 31 0x2b8400, errno: 126, resid: 8192,
Jun 2 21:13:39 pdb01 vmunix: blkno: 2895352, sectno: 5790704, offset: -1330126848, bcount: 8192.
Jun 2 21:13:52 pdb01 vmunix: SCSI: Write error -- dev: b 31 0x038400, errno: 126, resid: 8192,
Jun 2 21:13:52 pdb01 vmunix: blkno: 5454416, sectno: 10908832, offset: 1290354688, bcount: 8192.
The numbers can be broken down as follows:
vmunix: SCSI: Write error -- dev: b 31 0x2b8400
2b = Controller 43
8 = Target 8
4 = LUN 4
This translates to c43t8d4
vmunix: SCSI: Read error -- dev: b 31 0x038400
HPUX Tips
03= Controller 3
8 = Target 8
4 = LUN 4
This translates to c3t8d4
SCSI write error is most probably either disk or tape. In this case major no is 31 which is always for disk in hp-ux. So run ll
/dev/dsk and grep for the entry 0x038400 and you will know right away which is the device.
There are 2 paths to the same Symmetrix device (091) that is logging the read and write errors:
/dev/rdsk/c3t8d4 :EMC :SYMMETRIX :5568 :32091000 :8838720
/dev/rdsk/c43t8d4 :EMC :SYMMETRIX :5568 :32091000 :8838720
In most cases when this type of error is seen against Symm devices, the issue is logical corruption and running
fsck on the affected logical volumes or devices will solve the problem.
vgexport -p -m vg-test.map vgtest (To preview and create the mapfile. To export omit -p)
on the New Server
ioscan –fnC disk (To find new disk entries)
insf –d sdisk (To install the disk device files)
ll /dev/*/group (To see what minor numbers have already been used)
mkdir /dev/vg-test (To create the directory)
mknod /dev/vgx/group c 64 0x00000 (To create the device file)
vgimport -m /dev/dsk/cxtxdx /dev/dsk/cxtxdx (To import the volume group)
vgchange -a y (to activate the volume group)
mkdir /test
and mount /dev/vg-test/lvxx /test
ftp targethost
username/passwd...
bin
hash
put "|dd if=/dev/zero bs=32k count=1000" /dev/null
1111101000
To convert the binary number 1111101000 to a decimal format, enter:
bc
ibase=2
1111101000
1000
possible (tested) solution : - Boot from the recovery tape. Note down each file systems size and delete them and re-create them from
the Ignite Menu.
I successfully recoverd on of my clients's server using this method. I don't know anyone else ever tested it or not.
Suppose you want to troubleshoot network problem and you have the mac address of the remote server running hp-ux. From your
current server u want to check the connectivity using lan0. From ioscan -funClan you got the instance no. which is 0 and MAC of the
remote ethernet card is 0x00306EF3FDBD. the syntax will be:
Check /etc/hosts file and match the hostname with proper IP address. Then check /etc/resolv.conf file and check the correct entries
and see if you can ping the dns server or not. For instant solution you may rename it and then run swagentd -r command. Once you are
done u can move that file back and rerun swagentd -r again.
# mc –p /dev/rac/cxtxdx –r IDSM ( Will show all the slot and Drive information)
# mc –p /dev/rac/cxtxdx –e IDSM ( Will show less detailed information)
GSP login:Admin
GSP password:
Welcome to
CO: Consoles
VFP: Virtual Front Panel
CM: Command Menu
CL: Console Logs
SL: Show chassis Logs
HE: Help
X: Exit Connection
GSP> co
Partitions available:
# Name
--- ----
0) Npar0
1) Npar1
Q) Quit
-------------------------------
parstatus
HPUX Tips
parstatus -V -p0
Example of a parcreate command to create a partition name shreya with Cell2 and cell3 (Remember at least one Cell
must have core io attached to it i.e should have IO Drawers)
(I am not explaining as man page has all the informations, but this screenshot will help people who are new to nPar world)
root@SDPROD0> parstatus
Warning: No action specified. Default behaviour is display all.
[Complex]
Complex Name : GOD
Complex Capacity
Compute Cabinet (8 cell capable) : 1
Active GSP Location : cabinet 0
Model : 9000/800/SD32000
Serial Number : USE12345678
Current Product Number : A5201A
Original Product Number : A5201A
Complex Profile Revision : 1.0
The total number of Partitions Present : 2
[Cabinet]
Cabinet I/O Bulk Power Backplane
Blowers Fans Supplies Power Boards
OK/ OK/ OK/ OK/
Cab Failed/ Failed/ Failed/ Failed/
Num Cabinet Type N Status N Status N Status N Status GSP
=== ============ ========= ========= ========== ============ ======
0 SD32000 4/ 0/ N+ 5/ 0/ ? 6/ 0/ N+ 3/ 0/ N+ active
[Cell]
CPU
Memory Use
OK/ (GB)
Core On
Hardware Actual Deconf/ OK/
Cell Next Par
Location Usage Max Deconf Connected To Capable Boot Num
========== ============ ======= ========= =================== ======= ==== ===
cab0,cell0 active core 4/0/4 16.0/ 0.0 cab0,bay1,chassis3 yes yes 1
cab0,cell1 active base 4/0/4 12.0/ 0.0 cab0,bay0,chassis3 yes yes 1
cab0,cell2 inactive 4/0/4 8.0/ 0.0 - no
- -
cab0,cell3 inactive 4/0/4 12.0/ 0.0 - no
- -
cab0,cell4 active core 4/0/4 12.0/ 0.0 cab0,bay0,chassis1 yes yes 0
cab0,cell5 active base 4/0/4 12.0/ 0.0 - no
yes 0
cab0,cell6 active base 4/0/4 12.0/ 0.0 cab0,bay1,chassis1 yes yes 0
cab0,cell7 inactive 4/0/4 12.0/ 0.0 -
no - -
HPUX Tips
[Chassis]
Core Connected Par
Hardware Location Usage IO To Num
=================== ============ ==== ========== ===
cab0,bay0,chassis0 absent - - -
cab0,bay0,chassis1 active yes cab0,cell4 0
cab0,bay0,chassis2 absent - - -
cab0,bay0,chassis3 active yes cab0,cell1 1
cab0,bay1,chassis0 absent - - -
cab0,bay1,chassis1 active yes cab0,cell6 0
cab0,bay1,chassis2 absent - - -
cab0,bay1,chassis3 inactive yes cab0,cell0 1
[Partition]
Par # of # of I/O
Num Status Cells Chassis Core cell Partition Name (first 30 chars)
=== ============ ===== ======== ========== ===============================
0 active 3 2 cab0,cell4 sdprod0
1 active 2 1 cab0,cell0 sdoraprod1
Here is the screenshot of HP-UX booting process. This Screen shot taken from a Superdome nPar but the BCH
main screen is almost same for all HPPA Servers.
The Boot Action for this path specifies that PDC stop at BCH.
Command Description
------- -----------
HPUX Tips
BOot [PRI|HAA|ALT|<path>] Boot from specified path
PAth [PRI|HAA|ALT] [<path>] Display or modify a path
SEArch [ALL||<cell|path>] Search for boot devices
ScRoll [ON|OFF] Display or change scrolling capability
Do you wish to stop at the ISL prompt prior to booting? (y/n) >>n
(Select y to boot single user mode for lvm maintenance, override quorum, changing
root password etc. I wil cover those later otherwise press n to boot normally.
Here is the output if you press y , I deleted blank lines to save some space)
ISL> help
ISL>
ISL> di
Autoboot is OFF (disabled)
HPUX Tips
Autosearch is OFF (disabled)
Primary boot path is 0/0/1/0/0.0.0.0.0.0.0
Primary boot path is (hex) 0/0/1/0/0.0.0.0.0.0.0
ISL>
I am not going through all the details here but will cover later. Here is couple of syntaxes
ISL>hpux /stand/vmunix.old ---> To boot from the old kernel called vmunix.old
We can type exit to go back to bch but it works only for newer servers including Superdome.
In stead let us boot from here using defaults as if we didn't press any key at bch or used bo
command from bch. Here is the complete boot process from Console. Take a close look
at each lines and you will understand things better. Depending upon different configuration
this screen will look slightly different but most of them are like this.
ISL> hpux
Boot
: disk(0/0/1/0/0.0.0.0.0.0.0;0)/stand/vmunix
10493952 + 2043904 + 4738040 start 0x1f2a68
gate64: sysvec_vaddr = 0xc0002000 for 2 pages
NOTICE: nfs3_link(): File system was registered at index 3.
NOTICE: autofs_link(): File system was registered at index 6.
NOTICE: cachefs_link(): File system was registered at index 7.
0/0/4/0/0/4/0: Fibre channel host port is OFFLINE, can not scan
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/0/8/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/0/10/0/0
0/0/12/0/0/4/0: Fibre channel host port is OFFLINE, can not scan
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 1/0/2/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 1/0/4/0/0
1/0/12/0/0/4/0: Fibre channel host port is OFFLINE, can not scan
/sbin/ioinitrc:
/sbin/krs_sysinit:
/sbin/bcheckrc:
Checking for LVM volume groups and Activating (if any exist)
Volume group "/dev/vg00" has been successfully changed.
Resynchronized volume group /dev/vg00
vxfs fsck: sanity check: root file system OK (mounted read/write)
Checking hfs file systems
/sbin/fsclean: /dev/vg00/lvol1 (mounted) ok
HFS file systems are OK, not running fsck
Checking vxfs file systems
/dev/vg00/lvol8 :
vxfs fsck: sanity check: /dev/vg00/lvol8 OK
/dev/vg00/lvol3 :
vxfs fsck: sanity check: root file system OK (mounted read/write)
/dev/vg00/lvol4 :
vxfs fsck: sanity check: /dev/vg00/lvol4 OK
/dev/vg00/lvol5 :
vxfs fsck: sanity check: /dev/vg00/lvol5 OK
/dev/vg00/lvol6 :
vxfs fsck: sanity check: /dev/vg00/lvol6 OK
/dev/vg00/lvol7 :
vxfs fsck: sanity check: /dev/vg00/lvol7 OK
Cleaning /etc/ptmp...
(c)Copyright 1983-2000 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2000 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1991-2000 Isogon Corporation, All Rights Reserved.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).