Operating System - HP-UX
1748194 Members
4027 Online
108759 Solutions
New Discussion юеВ

Re: How do you determine the current boot path/device

 
SOLVED
Go to solution
Travis Harp_1
Advisor

How do you determine the current boot path/device

What I'm looking to be able to do is walk up to a running system and from the OS tell what is the current boot drive, path, device or something that will tell me which drive the system is currently booted from.

I've run through some of the easy ones such as setboot, lvlnboot and checking syslog.
None of them give the current boot device.

Right at the start of boot on the console it lists the starting boot path but I would have to be looking at the console during boot to catch that.

This seemed like a simple thing to me when I was asked but the answer has been more elusive than I originally thought.

Thanks,
Travis
15 REPLIES 15
Tim Nelson
Honored Contributor

Re: How do you determine the current boot path/device

try this.
MODEL=`uname -m`
if [[ $MODEL = "ia64" ]]
then
echo "--- IA64 System ---"
echo "Syslog says"
grep Boot /var/adm/syslog/syslog.log
echo "\nkcpath says:"
kcpath
echo "\nADB from /stand/vmunix says:"
MINOR=`echo "bootdev/x"|adb /stand/vmunix /dev/kmem|awk 'NR == 2 {print $1}'|cut -c 5-10`
echo "\n$MINOR Translated to:"
ls -l /dev/dsk/|grep $MINOR
DEV=`ls -l /dev/dsk|awk '/'$MINOR'/ {print $10}'`
echo "Boot device is: \c"
lssf /dev/dsk/$DEV|awk '{print $15" "$16}'


else
echo "--- PA-RISC System ---"
echo "\nADB from /stand/vmunix says:"
echo boot_string/S|adb /stand/vmunix /dev/mem
echo "\nkmpath says:"
kmpath
fi
Patrick Wallek
Honored Contributor

Re: How do you determine the current boot path/device

This works on HP-UX 11.0, 11.11 and 11.23 PA/RISC:

echo "boot_string/S" | adb -k /stand/vmunix /dev/kmem
Bill Hassell
Honored Contributor
Solution

Re: How do you determine the current boot path/device

PARISC is a simple adb command. IA64 is a real pain...you get part of the minor number as the kernel's reference, then match it with a device file and then there's all that DSF stuff for 11.31, so I wrote a script to give you the details (attached). Here are two examples, PARISC followed by IA64:

bootstring using adb:
Last booted using disk(0/0/2/0.6.0.0.0.0.0;0)/stand/vmunix

Boot disks and AUTO file boot command:
/dev/dsk/c1t6d0
BootCommand: "hpux -lq"
/dev/dsk/c2t6d0
BootCommand: "hpux -lq"

boot PATHS:
Primary bootpath = 0/0/2/0.6.0, /dev/dsk/c1t6d0
(disk) SEAGATE ST318404LC

Alternate bootpath = 0/0/1/0.0.0, /dev/rmt/0mn
(tape) HP C1537A


Automatic boot settings from setboot:
Autoboot is ON (enabled)
Autosearch is OFF (disabled)


lvlnboot -v:

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c1t6d0 (0/0/2/0.6.0) -- Boot Disk
/dev/dsk/c2t6d0 (0/0/2/1.6.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c1t6d0
/dev/dsk/c2t6d0
Root: lvol3 on: /dev/dsk/c1t6d0
/dev/dsk/c2t6d0
Swap: lvol2 on: /dev/dsk/c1t6d0
/dev/dsk/c2t6d0
Dump: lvol2 on: /dev/dsk/c1t6d0, 0


===========================================

bootstring using adb:
Last booted using 0x1000004 (disk5 or c0t0d0)

Boot disks and AUTO file boot command:
/dev/disk/disk5_p2
BootCommand: "hpux"
/dev/disk/disk10_p2
BootCommand: "hpux"

boot PATHS:
Primary bootpath = 0/1/1/0.0.0.0.0, /dev/rdsk/c0t0d0
= 0/1/1/0.0x5000c50007153089.0x0, /dev/rdisk/disk5
= (disk) 64000/0xfa00/0x1

Alternate bootpath = 0/1/1/0.0.0.1.0, /dev/rdsk/c0t1d0
= 0/1/1/0.0x5000c50007141ad5.0x0, /dev/rdisk/disk10
= (disk) 64000/0xfa00/0x0

HA Alt bootpath = 0/1/1/0.0.0.1.0, /dev/rdsk/c0t1d0
= 0/1/1/0.0x5000c50007141ad5.0x0, /dev/rdisk/disk10
= (disk) 64000/0xfa00/0x0


Automatic boot settings from setboot:
Autoboot is OFF (disabled)


lvlnboot -v:

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/disk/disk5_p2 -- Boot Disk
/dev/disk/disk10_p2 -- Boot Disk
Boot: lvol1 on: /dev/disk/disk5_p2
/dev/disk/disk10_p2
Root: lvol3 on: /dev/disk/disk5_p2
/dev/disk/disk10_p2
Swap: lvol2 on: /dev/disk/disk5_p2
/dev/disk/disk10_p2
Dump: lvol2 on: /dev/disk/disk5_p2, 0


Bill Hassell, sysadmin
Anoop Sivan
Frequent Advisor

Re: How do you determine the current boot path/device

Hi
We can find currently from which boot disk the server is booted as below

# uname -a
HP-UX rx26-185 B.11.31 U ia64 3025899524 unlimited-user license

[rx26-185]/
# dmesg | grep -i boot
Boot device's HP-UX HW path is: 0.1.1.1.2.0
[rx26-185]/
# ioscan -fnH 0.1.1.1.2.0
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 3 0/1/1/1.2.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c3t2d0 /dev/dsk/c3t2d0s2 /dev/rdsk/c3t2d0 /dev/rdsk/c3t2d0s2
/dev/dsk/c3t2d0s1 /dev/dsk/c3t2d0s3 /dev/rdsk/c3t2d0s1 /dev/rdsk/c3t2d0s3
[rx26-185]/
EmmanuelK2
Advisor

Re: How do you determine the current boot path/device

Hi Travis,
On 11.31, the command "lvlnboot -v" shows you the current boot device, root, swap and dump.
regards
Emmanuel
SoorajCleris
Honored Contributor

Re: How do you determine the current boot path/device

Hi ,

Simple ...

#dmesg | grep HW

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Bill Hassell
Honored Contributor

Re: How do you determine the current boot path/device

> dmesg | grep -i boot

This is not very reliable. dmesg is a small buffer in kernel memory and old information is erased to make room for new messages. The boot path information in dmesg is only valid right after you boot...several weeks from now, it can disappear.


Bill Hassell, sysadmin
Travis Harp_1
Advisor

Re: How do you determine the current boot path/device

One really important bit of information I left out is that I'm trying to figure it out on Itanium systems.
Most of the methods mentioned do work on RISC but not on Itanium.

I've still not found a reliable way to get the information from an Itanium box.
Sometimes syslog catches it but about 50% of the time it doesn't.
I thought at one point I might be able to change when syslogd starts so it would reliably capture the boot path but I haven't had time to work it in the last week.

Bill - I may give you a call directly about this, I'm the same Travis Harp with Northrop who bugs you from time to time.
Jayakrishnan G Naik
Trusted Contributor

Re: How do you determine the current boot path/device

Hi Travis Harp,

I just have my observation here about the OS disks and I have checked few HP ux servers with root disk mirroring.

I have executed sar & iostat command which shows comparably higher io on the presently used disk than the mirror. Based on this output I confirmed that the system is using the disk having higher io activity.

sar -d 5 5

See if this works for you too. This is purely based on what I observed on few HP-UX servers and I would appreciate if somebody have their objections/ comments/observations
on what I have here.

Thanks & Regards
Jayakrishnan G Naik