Friday, August 7, 2015
Basics of DRD (Dynamic Root Disk) + HPUX
Monday, August 3, 2015
Operating environment in HP-UX 11i V3 + HPUX
HP-UX 11i v3 OEs run on all members of the Integrity server family, from server blades, to entry-class, midrange and Superdome systems.
Command to find out "what operating environment we have on our server":
#swlist | grep -i oe
Below are the various OE's available in HP-UX 11i V3: I have explained their uses in one liner.
HPUX11i-B-OE - HP-UX 11i V3 Base OE - Base operating environment.
HPUX11i-VSE-OE - HP-UX 11i V3 Virtual Server OE - Virtualization (Vpar; Npar; HP-VM) is possible but can not create cluster
HPUX11i-HA-OE : HP-UX 11i V3 High Availability OE - No virtualization but we can create clusters. HP Service guard cluster software will be integrated with this.
HPUX11i-DC-OE : HP-UX 11i V3 Data Center OE - It is combination of HA-OE and VSE-OE and both of which include BOE. Means we can do everything; virtualization and cluster is
supported.
Monday, July 20, 2015
ntpdate: no server suitable for synchronization found + HPUX
Friday, July 17, 2015
Dangerous/Hazardous commands in HPUX
Dangerous/Hazardous Commands in HP-UX Every Administrator Should Know
As System Administrators, we regularly work on Production and Development servers where a single incorrect command can result in service outages, data loss, application failures, or even complete server downtime.
Therefore, it is extremely important to understand the purpose and impact of every command before executing it.
Always Check the Manual Page
If you are not sure about any command or its options, always refer to the manual page first:
Example:
Spending a few minutes reviewing the documentation can save hours of troubleshooting later.
Dangerous/Hazardous Commands in HP-UX
Below are some commands that should be used with extreme caution.
1. rm - Remove Files and Directories
Used to delete files and directories.
Be especially careful with:
The -f (force) option removes files without prompting and can cause irreversible data loss if used incorrectly.
2. chown - Change Ownership
Used to change file or directory ownership.
Take extra care when using the recursive option:
An incorrect recursive ownership change can make applications or services fail.
3. chmod - Change Permissions
Used to modify file and directory permissions.
Be cautious with recursive permission changes:
A wrong permission change can expose sensitive data or break application functionality.
4. mv - Move or Rename Files
Used to move or rename files and directories.
Avoid using force options carelessly:
This may overwrite existing files without warning.
5. hostname - Display or Change Hostname
Used to display the server hostname.
Be very careful while using options or incorrect syntax, as changing the hostname can impact cluster services, monitoring tools, applications, and network communication.
6. date - Display or Modify System Date and Time
Display current date and time:
Changing system time can have serious consequences for applications, databases, authentication services, and scheduled jobs.
Examples:
Always verify before modifying system date or time.
7. last | grep -i "reboot"
Administrators often use the following command to check reboot history:
A common mistake is accidentally typing:
instead of searching for the keyword.
To avoid mistakes, always use quotes:
or
8. init - Change System Run Levels
Used to change system run levels.
Examples:
Incorrect usage can stop services, switch the server to maintenance mode, or reboot the system.
9. ntpdate - Synchronize System Time
Used to synchronize server time with an NTP server.
Unexpected time changes can affect applications, databases, and scheduled tasks.
10. reboot / shutdown
Used to restart or shut down the server.
Executing these commands on a production server without proper planning can lead to service outages and business impact.
11. ifconfig - Network Interface Management
Used to configure network interfaces.
Examples:
An incorrect command can disconnect the server from the network and terminate remote sessions.
Additional Commands Worth Mentioning
dd - Disk Destroyer
One of the most dangerous commands if used incorrectly.
A wrong source or destination can overwrite an entire disk.
kill -9
Forcefully terminates processes.
Killing critical processes can result in service interruptions or system instability.
umount
Unmounts a filesystem.
Unmounting an active filesystem may impact running applications and users.
Final Thoughts
Most server outages are caused by human mistakes rather than hardware failures. Before executing any command:
✅ Verify the command syntax
✅ Understand the impact of the command
✅ Double-check the target file, filesystem, or server
✅ Review the man page if unsure
✅ Test in a non-production environment whenever possible
✅ Take backups before performing critical operations
Remember: Think twice, execute once.
I will continue updating this list as I come across more potentially dangerous commands in HP-UX. Happy learning and stay safe! 🚀
Monday, July 6, 2015
Decimal to Hexadecimal conversion through bc command - HPUX
Binary = base is 2
Hexadecimal = base is 16
By default we use decimal value.
1. Convert Decimal to Hexadecimal through bc command :
Here we have to define obase value obase - output base; here obase=16 since we are converting the decimal values to Hexadecimal
testserver:/] bc
obase=16
198
C6
or
testserver:/] echo "obase=16; 198" |bc
C6
2. Convert Hexadecimal to Decimal through bc command:
Here we have to define ibase value ibase - input base; here ibase=16 since we are converting Hexadecimal values to the decimal values.
testserver:/] bc
ibase=16
C6
198
or
testserver:/] echo "ibase=16; C6" |bc
198
Similarly we can convert decimal to oct or decimal to Bin or decimal to any base number and vice versa.
Wednesday, July 1, 2015
How to Identify Luns on EMC- Symmetrix Storage – HPUX
Tuesday, June 30, 2015
How to Identify New IBM disks - HPUX
Tuesday, March 31, 2015
Fiber channel (HBA - Host Based Adapter) WWN in HPUX/LINUX/AIX
At the time of server decommissioning process we ask storage team to remove storage attached to server which we are going to decommission. Then storage team may ask us to provide FC WWN details.
So here is the way to find it out:
HPUX:
#ioscan -fnCfc
#fcmsutil [/dev/fcd0, /dev/fcd1 ....] |grep -i port
Linux:
#systool -c fc_host -v |grep -i "port_name"
AIX:
#lsdev |grep fcs
#lscfg -vl [fcs0, fcs1 ...] |grep Network
Tuesday, March 3, 2015
Set non expire password + HPUX
We are taking "kiraan"as an username.
For trusted system:
Before:
ehorse:/> /usr/lbin/getprpw kiraan
uid=304198, bootpw=NO, audid=167, audflg=1, mintm=-1, maxpwln=-1, exptm=-1, lftm=-1, spwchg=Wed Aug 13 01:31:36 2014, upwchg=-1, acctexp=-1, llog=-1, expwarn=-1, usrpick=DFT, syspnpw=DFT, rstrpw=DFT, nullpw=DFT, admnum=-1, syschpw=DFT, sysltpw=DFT, timeod=-1, slogint=Tue Sep 30 09:40:55 2014, ulogint=Wed Feb 11 14:16:53 2015, sloginy=-1, culogin=3, uloginy=-1, umaxlntr=-1, alock=NO, lockout=1000000
Run below command:
#/usr/lbin/modprpw -m exptm=0,lftm=0,mintm=0,expwarn=0,llog=0 kiraan
After:
ehorse:/> /usr/lbin/getprpw kiraan
uid=304198, bootpw=NO, audid=167, audflg=1, mintm=0, maxpwln=-1, exptm=0, lftm=0, spwchg=Wed Aug 13 01:31:36 2014, upwchg=-1, acctexp=-1, llog=0, expwarn=0, usrpick=DFT, syspnpw=DFT, rstrpw=DFT, nullpw=DFT, admnum=-1, syschpw=DFT, sysltpw=DFT, timeod=-1, slogint=Tue Sep 30 09:40:55 2014, ulogint=Wed Feb 11 14:16:53 2015, sloginy=-1, culogin=3, uloginy=-1, umaxlntr=-1, alock=NO, lockout=0000000
For non-trusted system:
#passwd -x -1 username
Monday, February 9, 2015
Password cannot be circular shift of logonid +HPUX
******************************************
hpuxsrv:/> passwd kalyanjit
Changing password for kalyanjit
Last successful password change for kiren: Thu Feb 5 15:06:04 2015
Last unsuccessful password change for kiren: NEVER
New password:
Password cannot be circular shift of logonid.
Trick:
testhpux:/sbin/passwd kalyanjit
New password:
Re-enter new password:
Reason: /sbin/passwd - it allows to change the password even if it is changed 5 minutes before also.
Friday, January 30, 2015
Shutdown/reboot/halt commands + HPUX
From Multi-user mode:
* shutdown -ry 0 --> reboot
* shutdown -hy 0 --> shutdown and halt
or
init 0 --> halt
* shutdown 0 --> shutdown to single user mode
or
init s
or
ISL> hpux -is --> from console,by interrupting the auto boot process
* reboot 0 --> reboot
Note : 0 means restart/halt the server immediately.
Graphical View of Shutdown process:
From console (GSP Menu) :
a.TC : it will create the dump
b.RS :RST(reset)signal will be send to processor
C.PC : power cycle
Tuesday, January 27, 2015
Root password forgot + HPUX
Situation: I was not able to do sudo as somebody changed the permission on sudoers file or sudoers file is corruped so I had to login with root user through console, but i
got to know that i dont know root password.
While doing sudo i got below error:
mysrv:/home/> sudo su -
sudo: /opt/iexpress/sudo/etc/sudoers is mode 0440, should be 0644
Solution : Reboot the server in single user mode through console and edit the file /tcb/files/auth/r/root.
Steps:
1. Reboot the server through console either by PC or RS command:
2. interrupt the boot sequence to interact with ISL (initial system loader)
************************************
Processor is booting from first available device.
To discontinue, press any key within 10 seconds.
Boot terminated.
---- Main Menu ---------------------------------------------------------------
Command Description
------- -----------
BOot [PRI|ALT|
PAth [PRI|ALT] [
SEArch [DIsplay|IPL] [
COnfiguration menu Displays or sets boot values
INformation menu Displays hardware information
SERvice menu Displays service commands
DIsplay Redisplay the current menu
HElp [
RESET Restart the system
----
Main Menu: Enter command or menu > bo pri ISL
Interact with IPL (Y, N, or Cancel)?> Y
Booting...
Boot IO Dependent Code (IODC) revision 1
HARD Booted.
ISL Revision A.00.43 Apr 12, 2000
ISL>
3. Go to single user mode
*******************************************************
ISL> hpux -is
Boot
: disk(0/0/1/1.2.0.0.0.0.0;0)/stand/vmunix
10649600 + 2105344 + 2044264 start 0x1fe4e8
alloc_pdc_pages: Relocating PDC from 0xf0f0000000 to 0x7fa01000.
gate64: sysvec_vaddr = 0xc0002000 for 2 pages
NOTICE: autofs_link(): File system was registered at index 3.
NOTICE: cachefs_link(): File system was registered at index 5.
NOTICE: nfs3_link(): File system was registered at index 6.
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/2/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/3/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/6/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/7/0/0
System Console is on the Built-In Serial Interface
Logical volume 64, 0x3 configured as ROOT
Logical volume 64, 0x2 configured as SWAP
Logical volume 64, 0x2 configured as DUMP
Swap device table: (start & size given in 512-byte blocks)
entry 0 - major is 64, minor is 0x2; start = 0, size = 8388608
Starting the STREAMS daemons-phase 1
Checking root file system.
log replay in progress
replay complete - marking super-block as CLEAN
Root check done.
Create STCP device files
Starting the STREAMS daemons-phase 2
$Revision: vmunix: vw: -proj selectors: CUPI80_BL2000_1108 -c 'Vw for CUPI80_BL2000_1108 build' -- cupi80_bl2000_1108 'CUPI80_BL2000_1108' Wed Nov 8
19:24:56 PST 2000 $
Memory Information:
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 4194304 Kbytes, lockable: 3158620 Kbytes, available: 3639268 Kbytes
/sbin/ioinitrc:
/dev/vg00/lvol1: 67 files, 0 icont, 5132 used, 57066 free (162 frags, 7113 blocks)
/sbin/krs_sysinit:
Starting EMC PowerPath.
INIT: Overriding default level with level 's'
INIT: SINGLE USER MODE
INIT: Running /sbin/sh
****************************************************************
4. Run mountall command or just mount /var , /tmp, /usr by looking into /etc/fstab file.
# cat /etc/fstab
#mountall
Note: while mounting FS if any error comes then run fsck command on that LVs/FS.
5. Try to change root password. but we can't as we dont know old root password.
# passwd root
Old password:
6. So edit the trusted system file means /tcb/files/auth/r/root and nullify the u_pwd string which stores password in it.
# cat /tcb/files/auth/r/root |grep -i "u_pwd"
:u_pwd=mGsOWDUjI0ULw4bkUQL6uxQY:\
7. After making null password or blank password
# cat /tcb/files/auth/r/root |grep -i "u_pwd"
:u_pwd=:\
8. Now change the password for root, this time it will not ask old root password to type.
# passwd root
9. unmount all the mouted filesystems.
# umountall
10. Reboot the system
# reboot
Shutdown at 14:45 (in 0 minutes)
System shutdown time has arrived
Tuesday, January 13, 2015
Genesis Partiotion - HPUX
What is Genesis Partition?
Answer:
1. The first npar created in a server is referred to as Genesis partiontion.
2. It is a single cell partition built via MP (Management Processor). We can load the HP-UX 11i OE once the genesis partition is created
3. To create genesis partion. go to MP --> CM --> CC & then choose option G. Pick a cell that contains processors & memory and it must be conneced an I/O chasis with a core I/O card installed.
Use the "bo" option from MP menu to boot the npar & start the installation.
4. After the installation, issue "parstatus" command to check the status & resourcess available on that npar.
Display the local partition number in a full sentence.
# parstatus -w
Saturday, January 10, 2015
Bound and Unbound CPU - HPUX
In Vpars, there are two types of CPU
1. Bound CPU 2. Unbound CPU
* A bound cpu is assigned to handle I/O interrupts in Vpar. So every Vpar must have atleast 1 bound CPU.
* An unbound cpu is floater cpu. The CPU which is not assinged to any Vpar or which is assigned but do not handle I/O interrupts is "Unbound Cpu"
* All CPU's are initially not assigned to any Vpar so all CPU begin as unbound cpu.
* Using Vpar command we can assign cpu as bound or unbound to Vpar.
* We can dynamically migrate only unbound CPUs.
####################################
consider below cases:
vparname: myvpar
2 bound cpu; 1 unbound cpu
{To create the partition winona2 with two bound CPUs and one unbound CPU
# vparcreate -p myvpar -a cpu::3 -a cpu:::2}
Vparname: urvpar
two bound and two unbound CPUs
1.To add an unbound CPU to an existing partition,
either modify the total number of CPUs (-m cpu::total) or add to the total number of CPUs (-a cpu::total).
myvpar# vparmodify -p myvpar -m cpu::4
or add one to total:
myvpar# vparmodify -p myvpar -a cpu::1
2. To delete one unbound CPU from the partition myvpar, which is having 3 CPUs:
myvpar# vparmodify -p myvpar -m cpu::2
or
myvpar# vparmodify -p myvpar -d cpu::1
3. migrate 1 unbound cpu from myvpar to urvpar
myvpar# vparmodify -p myvpar -d cpu::1; vparmodify -p urvpar -a cpu::1
Thanks...
Kiran Jadhav
**Let's Share our knowledge and keep visiting here**
Wednesday, December 31, 2014
Identify new Lun’s added in 11.31 on EMC SYMMETRIX storage + HPUX
Device name Size
9da 30GB
Here Device name/Lun id is 9da.
{Note :
EMC SYMMETRIX - No need to convert it into hexadecimal to get Lun ID
EMC SYMMETRIX - convert it into hexadecimal to get Lun ID }
Steps:
1. #ioscan –fnCdisk
2. #insf -e disk
3. #ls –lt /dev/disk |more
brw-r----- 1 bin sys 1 0x000013 Sep 20 16:57 disk411
See the timestamp to identify newly added disks.
4. #ioscan –m dsf /dev/disk/disk411
5. #ioscan -m lun
6. #strings /etc/lvmtab |grep –i disk411
7. # /usr/local/bin/inq.HPUXIA64 -showvol |grep -i 9da
........../dev/rdisk/disk411 :EMC :SYMMETRIX :5874 :02009da000 : 009DA: 40266240
/dev/rdsk/c25t8d2 :EMC :SYMMETRIX :5874 :02009da000 : 009DA: 40266240
/dev/rdsk/c28t8d2 :EMC :SYMMETRIX :5874 :02009da000 : 009DA: 40266240
8. #scsimgr -v get_info all_lun < To get all status information of all the LUNs>
or #scsimgr get_info -D /dev/rdisk/disk411 |grep "SCSI services internal state"
"SCSI services internal state" is UNOPEN then that is unused disk. If disk is used then the state will be ONLINE
Tuesday, December 23, 2014
How to find system is booted from which disk - hpux
On HPUX 11.31 (11iv3) :
1. From setboot command
testsrv:/] setboot
Primary bootpath : 0/0/0/2/0/0/0.0x0.0x1000000c0000000 (/dev/rdisk/disk5)
HA Alternate bootpath :
Alternate bootpath : 1/0/0/2/0/0/0.0x0.0x1010000c0000000 (/dev/rdisk/disk7)
Autoboot is ON (enabled)
Hyperthreading : ON
: ON (next boot)
See the primary bootpath.
2. From reading the information from /stand/vmunix
testsrv:/] echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem
bootdev:
bootdev: 0x100000a
testsrv:/] ll /dev/disk/* |grep 00000a
brw-r----- 1 bin sys 1 0x00000a Nov 30 2011 /dev/disk/disk5_p2
cr-------- 1 root root 12 0x00000a Feb 15 2013 /dev/disk/disk5_p2.pt
Friday, December 19, 2014
Few points on LVM - HPUX
1. We can create a LV of size greater than a PV size. This feature is called "Disk Spanning".
2. We can create upto 6 mirror copies simultaneously which required a product "HP MIRROR DISK/UX".
3. Mirrored data can be configured to automatically create a new mirror to a separate disk when of mirror copies fails called as "SPARING" & required a product "HP MIRROR
DISK/UX".
4. We can create a LV so that contiguous data can be distributed accross multiple disks, which speeds I/O throughput for large files by reading and writing sequentially. This
feature is called "STRIPING".
Wednesday, December 17, 2014
Extending root FS (mirrored) online - hpux
mysrv:/> lvdisplay /dev/vg00/lvol1 |grep -i allocation
Allocation strict/contiguous
mysrv:/> lvdisplay /dev/vg00/lvol2 |grep -i allocation
Allocation strict/contiguous
mysrv:/> lvdisplay /dev/vg00/lvol3 |grep -i allocation
Allocation strict/contiguous
mysrv:/> lvdisplay /dev/vg00/lvol4 |grep -i allocation
Allocation strict
if strict policy then LVM helps to avoid creating multiple mirror copies on a single bus.
contiguous - means PEs are adjoining/touching.
This method can be used on HP-UX 11.11 / 11.23 with Legacy Addressing (/dev/dsk/c#t#d#)
HP-UX versions prior to 11.31:
Here we want to extend FS / or LV /dev/vg00/lvol3
#bdf /
1. Take ignite backup or have full backup of vg00
2. Identify primary disk and secondary/alternate disk:
2.1 # setboot
2.2 # lvlnboot -v
2.3 #cat /stand/bootconf
primary disk= /dev/dsk/c0t8d0
secondary/alternate disk = /dev/dsk/c1t8d1
3. Reduce the mirror on every LV under vg00; if we have 8 lvs in vg00 then remove mirror from those LVS
#lvreduce -m 0 /dev/vg00/lvol1
#lvreduce -m 0 /dev/vg00/lvol2
.
.
#lvreduce -m 0 /dev/vg00/lvol8
4. Remove the mirror disk/secondary disk (/dev/dsk/c1t8d1) from vg00
#vgreduce vg00 /dev/dsk/c1t8d1
5. Create a PV on secondary disk
#pvcreate /dev/rdsk/c1t8d1
6. Add that PV in vg00
#vgextend vg00 /dev/dsk/c1t8d1
7. Move the PEs of all the Lvs in vg00 other than lvol1, lvol2 & lvol3 as they are contiguous in nature on secondary disk(/dev/dsk/c1t8d1)
Note : here we are making space on primary disk so moved all LEs from lovl4 .... to secondary disk.
#pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t8d0 /dev/dsk/c1t8d1
#pvmove -n /dev/vg00/lvol5 /dev/dsk/c0t8d0 /dev/dsk/c1t8d1
.
.
8. Extend the root FS.
#lvextend -L {size in MB} /dev/vg00/lvol3
#fsadm -b {size in MB}m /
9.Move back all LE's of all LVs from secondary disk to primary disk.
#pvmove -n /dev/vg00/lvol4 /dev/dsk/c1t8d1 /dev/dsk/c0t8d0
#pvmove -n /dev/vg00/lvol5 /dev/dsk/c1t8d1 /dev/dsk/c0t8d0
.
.
10. Remove secondary disk from vg00 so we can make the disk as bootable disk.
vgreduce /dev/vg00 /dev/dsk/c1t8d1
11.Create a boot disk.
#pvcreate -B /dev/rdsk/c1t8d1
#mkboot -a "hpux -lq" /dev/rdsk/c1t8d1
{Change the AUTO file to hpux -lq so the host can boot without quorum if one mirror disk fails.}
12. Extend the root VG with new boot disk
#vgextend /dev/vg00 /dev/dsk/c1t8d1
13. Mirror all Lvs present on primary disk to secondary disk.
#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t8d1
#lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t8d1
.
.
.
#lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c1t8d1
14. check if root,boot,swap& dump are properly configured.
#lvlnboot -v
15. Verify low quorum is set for both disk
#lifcp /dev/dsk/c0t8d0:AUTO-
#lifcp /dev/dsk/c1t8d1:AUTO-
16. run bdf command and compare old bdf output with current bdf output
#bdf /
Thursday, December 4, 2014
Identify VG is in cluster or not - hpux
Just by checking the VG status we can identify whether that particular VG is in cluster or not?
#vgdisplay
VG status = available --> VG is online and available and not in cluster.
or
VG status = available/exclusive --> VG is cluster aware. If VG is in exclusive mode then the node on which VG is activated in exclusive mode will have read - write access to this VG; other node
will be having read only access