When root disk is mirrored at OS level, its difficult to know which disk system is booted from. Learn here how to identify current boot disk in HPUX.
There are couple of ways by which you can identify boot disk from which HPUX system is currently booted. This information is handy when HPUX is having root mirroring and if any maintenance activity needs to be carried out.
In such scenarios one must know the current boot disk out of 2 root mirror disks. For example if you have a root disk failure in mirror then you must know if boot disk is damaged or not so that you can safely redirect IO to other disk/plan your maintenance.
Method 1 :
Easy method is to use setboot command which clearly states primary boot disk.
# /usr/sbin/setboot -v
Primary bootpath : 2/0/0/3/0.0x6.0x0 (/dev/rdisk/disk40)
HA Alternate bootpath :
Alternate bootpath : 2/0/0/2/0.0x6.0x0 (/dev/rdisk/disk16)
Autoboot is ON (enabled)
Hyperthreading : OFF
: OFF (next boot)
----- output truncated -----
This is bit tricky one. You need to use adb to get hardware address of the booted disk. Then this hardware address can be traced back to disk name by matching in under ioscan output.
# echo "boot_string/S" | adb /stand/vmunix /dev/kmem
Even by observing syslog messages after boot, one can determine from which disk kernel was booted.
# grep "Boot device" /var/adm/syslog/syslog.log
Nov 15 18:44:18 myserver1 vmunix: Boot device's HP-UX HW path is: 2/0/0/3/0.0x6.0x0
In above output it clearly mentions hardware path of the disk from which kernel was booted. Now this hardware path can be matched with device name in ioscan -fnCdisk output and disk name can be obtained.