Operating System - HP-UX
1855496 Members
2001 Online
104111 Solutions
New Discussion

Which disk did I boot from?

 
SOLVED
Go to solution
Stacey Akerstrom
Frequent Advisor

Which disk did I boot from?

I have recently started learning how to mirror disks, but I have a question.
How can you tell which disk the box booted with?

Thanks-
10 REPLIES 10
Cheryl Griffin
Honored Contributor

Re: Which disk did I boot from?

# echo "bootdev/X" | adb /stand/vmunix /dev/kmem
"Downtime is a Crime."
Cheryl Griffin
Honored Contributor
Solution

Re: Which disk did I boot from?

It will produce the disk in hex:
bootdev:
bootdev: 1F005000
# ll /dev/dsk/* |grep 005000
brw-r----- 1 bin sys 31 0x005000 May 30 13:54 c0t5d0
"Downtime is a Crime."
James R. Ferguson
Acclaimed Contributor

Re: Which disk did I boot from?

Hi:

One way is:

# echo 'boot_string/S'|adb /stand/vmunix /dev/mem

...you will see something like:

boot_string:
boot_string: disc(10/0.6.0;0)/stand/vmunix

...which can be quickly related to the disk device file by examining the output of 'lvlnboot -v'.

Regards!

...JRF...
Stacey Akerstrom
Frequent Advisor

Re: Which disk did I boot from?

Not sure why, but my ll command gives me nothing back:
# echo "bootdev/X" | adb /stand/vmunix /dev/kmem
bootdev:
bootdev: 1F03F000
# ll /dev/dsk/* |grep 03F000
# ll /dev/dsk/*
brw-r----- 1 bin sys 31 0x004000 Oct 17 2002 /dev/dsk/c0t4d0
brw-r----- 1 bin sys 31 0x01f000 Oct 2 2002 /dev/dsk/c1t15d0
brw-r----- 1 bin sys 31 0x03f000 Oct 2 2002 /dev/dsk/c3t15d0

However, since there are only 2 drives in these boxes, it was easy enough to identify.
Thanks for your help!!!
harry d brown jr
Honored Contributor

Re: Which disk did I boot from?

Much easier is:

lvdisplay -v /dev/vg00/lvol1 | grep " \{2\}/dev/dsk/c*"

The grep looks for at least two spaces in front of the disk path.

This works because lvol1 (/stand) must be contiguous.

live free or die
harry
Live Free or Die
Stacey Akerstrom
Frequent Advisor

Re: Which disk did I boot from?

Harry-
Could you please explain the output for me?

Thanks
harry d brown jr
Honored Contributor

Re: Which disk did I boot from?

The output from:

# lvdisplay -v /dev/vg00/lvol1 | grep " \{2\}/dev/dsk/c*"
/dev/dsk/c1t6d0 28 28
#


the /dev/dsk/c1t6d0 identifies the disk and the first number trailing is the LE (Logical Extents - usually 4mb - in this case 112mb for /stand) on the PE (Physical Volume) and the second number is the PE (Physical Extents) on the PV (Physical Volume).

This is a "sniplet" of the

lvdisplay -v /dev/vg00/lvol1

command:


--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t6d0 28 28


live free or die
harry
Live Free or Die
Caesar_3
Esteemed Contributor

Re: Which disk did I boot from?

Hello!

Do: bdf /stand (will find the LV of kernel)
you will get /dev/vgXX/lvolX
Then: vgdisplay -v vgXX | grep dev/dsk/c
(will get the device for)
you will get /dev/dsk/cXtXdX

Caesar
Stacey Akerstrom
Frequent Advisor

Re: Which disk did I boot from?

Caesar-
Thanks, but what I was looking for was which disk I had booted *from*, not which were available.

Stace
A. Clay Stephenson
Acclaimed Contributor

Re: Which disk did I boot from?

Actually, your only reliable methof is to query the kernel itself as indicated by Cheryl's or James' responses. The other method query static information on he disks themselves. Just because a disk indicates that it is capable to be booted from does not mean that it is THE boot device. Only the kernel knows for sure.

Your confusion over the boot device not being listed results from not fully understanding the device number.
1F03F000

The first 2 hex digits (1F) - 31 Decimal indecate the major device number. An lsdev indicates that blk device 31 is "sdisk" SCSI disk.

The next two hex digits 03 - 3 decimal indicate the controller instance number "c3".
The next hex digit (F) - 15 decimal indicates the SCSI ID (or "target") "t15".
The next hex digit (0) indicates the logical unit number (LUN) "d0".
The last two hex digits are driver specific.

You need to look for a device with major number
31 and minor number 0x03f000 and you should se that under /dev/dsk.

Thus 1F03F000 corresponds to /dev/dsk/c3t15d0.

This technique can be very useful because soon or later you are going to have to decode those dreaded "LBOLT" messages and the device number is done exactly the same way.

If it ain't broke, I can fix that.