Archive for category HP-UX

Remove special (device) files in HP-UX

You can use the command rmsf to remove special (device) files in HP-UX, example:
# rmsf -H 6/0/8/1/0.0.0

Where 6/0/8/1/0.0.0 is the HW PATH of the device.

, ,

No Comments

Identify PV device in HP-UX 11.31

In HP-UX 11.31, LVM doesn’t use “ctd’ (ie: /dev/rdsk/c2t1d0), but DSF to balance the throughput between many device paths., so if you need identify what physical device represent that logical device, you can use ioscan, for example:

server@root:/root # vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      12
Open LV                     12
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               4385
VGDA                        2
PE Size (Mbytes)            16
Total PE                    4375
Alloc PE                    3998
Free PE                     377
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 1122560m
VG Max Extents              70160


--- Logical volumes ---
LV Name                     /dev/vg00/lvol1
LV Status                   available/syncd
LV Size (Mbytes)            2000
Current LE                  125
Allocated PE                125
Used PV                     1


LV Name                     /dev/vg00/lvol2
LV Status                   available/syncd
LV Size (Mbytes)            16384
Current LE                  1024
Allocated PE                1024
Used PV                     1

(...)

LV Name                     /dev/vg00/lvol12
LV Status                   available/syncd
LV Size (Mbytes)            5120
Current LE                  320
Allocated PE                320
Used PV                     1

--- Physical volumes ---
PV Name                     /dev/disk/disk4
PV Status                   available
Total PE                    4375
Free PE                     377
Autoswitch                  On
Proactive Polling           On

Note that the pv name is “disk4”, not c2t1d3.

With ioscan you can reverse map it:

server@root:/root # ioscan -m dsf
Persistent DSF           Legacy DSF(s)
========================================
/dev/rdisk/disk3         /dev/rdsk/c2t1d0
/dev/rdisk/disk4         /dev/rdsk/c2t0d0
/dev/rdisk/disk5         /dev/rdsk/c0t0d0

Now we know that the “disk4″ is the physical disk located in 12/0/1/1/0.0.0

root@brux0044:/root # ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
========================================================================
disk 1298 12/0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GMAP3735NC
                         /dev/dsk/c2t0d0 /dev/rdsk/c2t0d0

, , ,

No Comments

Memory disposition in HP-UX

You can use the following commando to check me memory disposition in HP-UX:
echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

It will return something like this:

Memory Board Inventory

DIMM Slot Size (MB)
--------- ---------
0a        256
2a        1024
1a        256
0b        256
2b        1024
1b        256
--------- ---------
System Total (MB): 3072

No Comments

Recovery files from a IGNITE HP-UX backup

If you have a backup made using the ignite tool on a HP-UX, you can use the following commands to recovery just a part of it.

For PA-RISC:
-Rewind the tape
mt -t /dev/rmt/0mn rew

-Forward to the sector after the boot
mt -t /dev/rmt/0mn fsf 1

-Use tar to extract the file
tar xvf /dev/rmt/0mn etc/hosts

For Itanium2:
-Rewind the tape
mt -t /dev/rmt/0mn rew

-Forward to the sector after the boot
mt -t /dev/rmt/0mn fsf 22

-Use tar to extract the file
tar xvf /dev/rmt/0mn etc/hosts

NOTE: change “/dev/rmt/0mn” to your tape device. If you don’t know what it is, run the command “ioscan -fnC tape” do find it out.

, ,

No Comments

Removing password aging restrictions in HP-UX

To remove all passwords aging restriction in HP-UX, you can use the following command:
/usr/lbin/modprpw -m llog=0,mintm=0,exptm=0,lftm=0,expwarn=0,umaxlntr=0 username

Where:
llog – Set the last login time interval (days);
mintm – Set the minimum time interval between password changes (days). 0 = none;
exptm – Set password expiration time interval (days). 0 = not expired;
lftm – Set password life time interval (days).  0 = infinite;
expwarn – Set password expiration time interval (days). 0 = not expired;
umaxlntr – Set Maximum Unsuccessful Login tries allowed. 0 = infinite.

, ,

No Comments

How to check HBA card settings in HP-UX

First of all, you need if the device exists:

myserver@root:/root # ioscan -fnC fc
Class     I  H/W Path    Driver S/W State   H/W Type     Description
===================================================================
fc        1  0/0/4/1/0   fcd  CLAIMED     INTERFACE    HP AB378-60101 4Gb Single Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                        /dev/fcd1
fc        2  0/0/10/1/0  fcd  CLAIMED     INTERFACE    HP AB378-60101 4Gb Single Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                        /dev/fcd2
fc        3  0/0/12/1/0  fcd  CLAIMED     INTERFACE    HP AB378-60101 4Gb Single Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                        /dev/fcd3
fc        0  0/0/13/1/0  fcd  CLAIMED     INTERFACE    HP AB378-60101 4Gb Single Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                        /dev/fcd0

Now, you can check the settings:
myserver@root:/root # fcmsutil /dev/fcd1

                           Vendor ID is = 0x001077
                           Device ID is = 0x002422
            PCI Sub-system Vendor ID is = 0x00103c
                   PCI Sub-system ID is = 0x0012d6

                               PCI Mode = PCI-X 133 MHz
                       ISP Code version = 4.0.22
                       ISP Chip version = 3
                               Topology = PTTOPT_FABRIC
                             Link Speed = 4Gb
                     Local N_Port_id is = 0x020300
                  Previous N_Port_id is = None
            N_Port Node World Wide Name = 0x5001438002fdf7c3
            N_Port Port World Wide Name = 0x5001438002fdf7c2
            Switch Port World Wide Name = 0x200300051e365dca
            Switch Node World Wide Name = 0x100000051e365dca
                           Driver state = ONLINE
                       Hardware Path is = 0/0/4/1/0
                     Maximum Frame Size = 2048
         Driver-Firmware Dump Available = NO
         Driver-Firmware Dump Timestamp = N/A
                         Driver Version = @(#) libfcd.a HP Fibre Channel ISP 23xx & 24xx Driver B.11.23.06 /ux/core/isu/FCD/kern/src/common/wsio/fcd_init.c:Jun 23 2006,14:06:46

, , ,

No Comments

Increase lvol size in HP-UX

Let’s assume that you want to increase 1Gb of the /dev/MyVG /lvol1 device (mounted as /filesystem):
# bdf /filesystem
Filesystem          kbytes    used   avail %used Mounted on
/dev/ MyVG /lvol1
                   573440000 533892407 37080557   94% /filesystem

The actual size is 573440000 Kb (573 Gb) and you will increase it to 574440000 Kb (574 Gb).

- Check if there is available space in the Volume Group:
# vgdisplay MyVG
--- Volume groups ---
VG Name                     /dev/MyVG
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      1
Open LV                     1
Max PV                      100
Cur PV                      17
Act PV                      17
Max PE per PV               15000
VGDA                        34
PE Size (Mbytes)            16
Total PE                    36907
Alloc PE                    35000
Free PE                     1907
Total PVG                   1
Total Spare PVs             0
Total Spare PVs in use      0

Note the “Free PE” and “PE Size (Mbytes)”. It say that you has 30512 Mb (30Gb) available in MyVG (Free PE * PE Size).

- Increase the lvol:
# lvextend -L 574440 /dev/MyVG/lvol1
* the syntax is: lvexten -L <new size in Mb> <lvol path>

- Now, increase the filesystem:
# fsadm -b 574440m /filesystem
* the syntax is: fsadm –b <new size in Mb> <mount point>
 

, , , ,

No Comments

Changing the HP-UX hostname

To change the hostname in HP-UX:

- Edit the file "/etc/rc.config.d/netconf"
# /etc/rc.config.d/netconf

- Look for the line that starts with HOSTNAME and change the hostname, example:
HOSTNAME="mylittleserver"

- Now, apply the change:
# /sbin/init.d/hostname start

,

No Comments

Rename a Super Dome Partition

To rename a Super Dome Partition (for example change the name that is showed in the MP console menu), do the following:

Login into any host of this SD and run:
parmodify -p <partition number> -P <partition name>
Example:
parmodify -p 2 -P WEBSERVER01
 

,

No Comments

Glance shortcuts

To use the buttons at the bottom of the glance, you should do an "export TERM=dtterm".

After that, you will be able to use:
F1 for ProcList
F2 for CPU Rpt
F3 for Mem Rpt
F4 for Disk Rpt
F5 for NextKeys
F6 for SlctProc
F7 for Help
F8 for Exit

 

, ,

No Comments

Control agent problem (OVO)

Sometimes the OVO agent stops communicating with the OVO Server.
Control agent on nodeHOST isn't accessible. (OpC40-405) Network communication problem: Could not obtain endpoint information from node ncadg_ip_udp:10.0.0.10[]. (OpC40-399)

To reestablish the communication, you should restart it:

To stop, use the command:
# /opt/OV/bin/OpC/opcagt -stop

Check if it is stopped:
# /opt/OV/bin/OpC/opcagt -status
ITO Managed Node status :
-------------------------
Control Agent /opt/OV/bin/OpC/opcctla               (3818) is running
Message Agent /opt/OV/bin/OpC/opcmsga               (3819) is running
Subagent 1:
Action Agent /opt/OV/bin/OpC/opcacta                (3820) is running
Logfile Encapsulator /opt/OV/bin/OpC/opcle          (3821) is running
Monitor Agent /opt/OV/bin/OpC/opcmona               (3822) is running
Message Interceptor /opt/OV/bin/OpC/opcmsgi         (3823) is running

Attention: the "Control Agent" may not stop, you can kill it with a "kill -9 PID"

To start, use the command:
# /opt/OV/bin/OpC/opcagt -start

 

, ,

2 Comments

Check powerpath links in HP-UX

To check if the powerpath links are up in HP-UX, you can use the following command:

# powermt display dev=all

 

, , ,

No Comments

When Glance stop working

Sometimes glance (performance monitor for HP-UX) can crash (before crash, it will return 0% of CPU, Disk and networking) working with the following error:
GlancePlus fatal error.
== Fatal Nums Error == C.04.50.57 02/10/07 ==
User: root/6pts/6(/dev/pts/6) Date: Sun Dec 6 15:52:12
File: /crm/numsVob/hp/11.0/nums.C Line: 485 Product id: Glance
System: server B.11.11 9000/800
Errno: 0 (Error 0)
Connection to midaemon lost -- check midaemon process and status.mi == End of Error Msg
=============================

To solve it, you should:

Stop MWA:
# mwa stop

Remove all files (including the hidden ones) from /var/opt/perf/datafiles:
# rm -rf /var/opt/perf/datafiles/* rm -rf /var/opt/perf/datafiles/.*

Check if midaemon and ttd are stopped:
# mwa status

If midaemon and ttd didn’t stop, force stops them with the command kill (the PID was returned by the command ‘mwa status’).

Now, start MWA again:
# mwa start

 

,

No Comments

Lock an user account in HP-UX

To lock an user account in HP-UX, you can use the following command:

# /usr/lbin/modprpw -m alock=YES USER

, ,

No Comments

Merge many depots

When you have many depot files, you can create a single big depot and install it instead of install one by one. Let’s assume that you need install the following depots, and they are all located in the directory /tmp/install/depots:

autoconf-2.64-hppa-11.11.depot bison-2.4.1-hppa-11.11.depot gawk-3.1.7-hppa-11.11.depot sed-4.2.1-hppa-11.11.depot tcltk-8.5.7-hppa-11.11.depot texinfo-4.13-hppa-11.11.depot zip-3.0-hppa-11.11.depot

To create a single depot, run the follow commands:
# cd /tmp/install/ for i in `ls depots/*.depot` ;do swcopy -s /tmp/install/$i \* @/tmp/install/big;done

Now, to install it, you can use:
# swinstall -s /tmp/install/big

 

, , ,

No Comments

HP-UX password maintenance

Follow a few utilities to maintain the user’s passwords:

/usr/lbin/getprpw <username> - display protected password database information
/usr/lbin/modprpw -x <username> – change password
/usr/lbin/modprpw -k <username> – unlock the user

No Comments

Hardware specification in HP-UX

You can use the following command to check the HP-UP hardware (like CPU and memory):

# hpuxhost@root:/root # print_manifest |more
System Information

Your Hewlett-Packard computer has software installed and
configured as follows.

The system was created July 04, 2007, 11:53:28 EDT.

It was created with Ignite-UX revision C.6.10.97.

-------------------------------------------------------------
NOTE: You should retain this information for future reference.
-------------------------------------------------------------

System Hardware
Model: 9000/800/SD32A
Main Memory: 65005 MB
Processors: 32
Proccesor(0) Speed: 1000 MHz
Proccesor(1) Speed: 1000 MHz
Proccesor(2) Speed: 1000 MHz
Proccesor(3) Speed: 1000 MHz
Proccesor(4) Speed: 1000 MHz
Proccesor(5) Speed: 1000 MHz
Proccesor(6) Speed: 1000 MHz
Proccesor(7) Speed: 1000 MHz
Proccesor(8) Speed: 1000 MHz
Proccesor(9) Speed: 1000 MHz
Proccesor(10) Speed: 1000 MHz
Proccesor(11) Speed: 1000 MHz
Proccesor(12) Speed: 1000 MHz
Proccesor(13) Speed: 1000 MHz
Proccesor(14) Speed: 1000 MHz
Proccesor(15) Speed: 1000 MHz
Proccesor(16) Speed: 1000 MHz
Proccesor(17) Speed: 1000 MHz
Proccesor(18) Speed: 1000 MHz
Proccesor(19) Speed: 1000 MHz
Proccesor(20) Speed: 1000 MHz
Proccesor(21) Speed: 1000 MHz
Proccesor(22) Speed: 1000 MHz
Proccesor(23) Speed: 1000 MHz
Proccesor(24) Speed: 1000 MHz
Proccesor(25) Speed: 1000 MHz
Proccesor(26) Speed: 1000 MHz
Proccesor(27) Speed: 1000 MHz
Proccesor(28) Speed: 1000 MHz
Proccesor(29) Speed: 1000 MHz
Proccesor(30) Speed: 1000 MHz
Proccesor(31) Speed: 1000 MHz
(...) Many other HW information above

 

1 Comment

Recovering corrupted lvol on HP-UX

Sometimes you can get the following error while try to access a directory in HP-UX:

# cd /DATA
sh: /DATA: The specified directory is not valid.

This error is caused because the file system is corrupted and you need run fsck on it.

First of all, umount the FS:

# umount /DATA

And them, run the fsck:

# fsck -y -o full /dev/vgLOG/lvol1on clear? (ynq)y
UX:vxfs fsck: WARNING: V-3-20836: file system had I/O error(s) on meta-data.
log replay in progress
pass0 - checking structural files
pass1 - checking inode sanity and blocks
fileset 999 primary-ilist inode 177502 marked bad, allocation flags (0x0001)
fileset 999 primary-ilist inode 177502 has invalid number of blocks (7309)
fileset 999 primary-ilist inode 177502 has invalid block map
fileset 999 primary-ilist inode 177502 failed validation clear? (ynq)y
fileset 999 primary-ilist inode 177859 marked bad, allocation flags (0x0001)
fileset 999 primary-ilist inode 177859 has invalid number of blocks (24850)
fileset 999 primary-ilist inode 177859 has invalid block map
fileset 999 primary-ilist inode 177859 failed validation clear? (ynq)y
fileset 999 primary-ilist inode 178243 marked bad, allocation flags (0x0001)
fileset 999 primary-ilist inode 178243 has invalid number of blocks (6417)
fileset 999 primary-ilist inode 178243 has invalid block map
fileset 999 primary-ilist inode 178243 failed validation clear? (ynq)y
fileset 999 primary-ilist inode 178793 marked bad, allocation flags (0x0001)
fileset 999 primary-ilist inode 178793 failed validation clear? (ynq)y
pass2 - checking directory linkage
pass3 - checking reference counts
pass4 - checking resource maps
fileset 999 au 2 imap incorrect - fix (ynq)y
fileset 999 au 2 iemap incorrect - fix (ynq)y
au 42 emap incorrect - fix? (ynq)y
au 42 summary incorrect - fix? (ynq)y
au 59 emap incorrect - fix? (ynq)y
au 59 summary incorrect - fix? (ynq)y
au 60 emap incorrect - fix? (ynq)y
au 60 summary incorrect - fix? (ynq)y
au 61 emap incorrect - fix? (ynq)y
au 61 summary incorrect - fix? (ynq)y
au 62 emap incorrect - fix? (ynq)y
au 62 summary incorrect - fix? (ynq)y
au 63 emap incorrect - fix? (ynq)y
au 63 summary incorrect - fix? (ynq)y
fileset 999 iau 2 summary incorrect - fix? (ynq)y
free block count incorrect 2153192 expected 2202289 fix? (ynq)y
free extent vector incorrect fix? (ynq)y
OK to clear log? (ynq)y
set state to CLEAN? (ynq)y

After that, you can mount the FS again.

# umount /DATA

 

,

No Comments

Listing installed packages in HP-UX

To list all installed packages on HP-UX, you can use the following command:

# swlist -l

 

,

No Comments

How to change user’s password in HP-UX

To change the user passwd in HP-UX, you can use the following command:

# /usr/lbin/modprpw -x foobar
passwd=dyxmuola

It will force the user foobar to change its password in the first login.

 

No Comments