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.


Method 2:

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.

Method 3:

Even by observing syslog messages after boot, one can determine from which disk kernel was booted.

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.

 

Any thoughts?