Operating System - HP-UX
1832593 Members
2827 Online
110043 Solutions
New Discussion

To identify the Alternate linked Disk

 
SOLVED
Go to solution
Chandramohan Achar
Occasional Contributor

To identify the Alternate linked Disk


Hi all,

I have been working on disk stations with alternate path to the same physical disk.
I usually identify the alternate disks by looking at card instance number of ioscan o/p. But still i don't feel this is a
proper/wise way to find out alternate link when server numbers are more (more than 400 .. ). I would like to know if any proper way is there
to identify the multi path disk, so that i can put it in shell script.

â diskinfo â v â command does not give any serial number so that I can use this string( serial number ) to match with anther disk device file to identify the alternate linked disk.

Waiting for the reply ...

Thanks in
8 REPLIES 8
melvyn burnard
Honored Contributor

Re: To identify the Alternate linked Disk

how about looking at vgdisplay -v output?
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
RAC_1
Honored Contributor

Re: To identify the Alternate linked Disk

vgdisplay -v
pvdisplay -v
There is no substitute to HARDWORK
Sunil Sharma_1
Honored Contributor

Re: To identify the Alternate linked Disk

Hi,

Your way is absolutely right before disk is configured in LVM. Once it's part of LVM you can find it out using
vgdisplay and pvdisplay

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
John Palmer
Honored Contributor

Re: To identify the Alternate linked Disk

Before the disk has been added to a volume group, I don't think there's any way to identify it from a script.

Once it's in a VG however you can identify the VGID and disk number within the VG by extracting information from the VG header.

The following code works in HP-UX 11:00 where the variable DISK contains the disk name e.g. c6t0d0:-

VGID=$(dd if=/dev/rdsk/${DISK} bs=512 count=1 skip=16 2>/dev/null | xd -j16 -N8 -tx | awk '{print $2 $3}')

DISKID=$(dd if=/dev/rdsk/${DISK} bs=512 count=1 skip=16 2>/dev/null | xd -j28 -N4 -tu | head -1 | awk '{print $2}')

There may be better ways to run xd and interpret the results but the above work.

VGID will contain the Volume Group Identifier as reported by vgexport.

DISKID will report the disk number within the VG. This will be 0 for the first disk added, 1 for the second etc.

Regards,
John
Stuart Abramson_2
Honored Contributor

Re: To identify the Alternate linked Disk

emc provides the "inq" utility that prints out the disk (hypervolume) Serial Number. It's exactly what you need.

Except that some disks don't have unique serial numbers.

I suspect that you can get the utility from the emc web site (?).
Todd McDaniel_1
Honored Contributor
Solution

Re: To identify the Alternate linked Disk

EMC inq command is proprietary, if i remember correctly.

Also, for disks that are multipathed, they share the SAME EMC Hypervolume number (serial number).

There is no way that I know of to identify an alternate disk before it is assigned to a VG. Because before then the are merely 2 paths to the same disk, neither one is primary nor secondary.


After it all paths have been added to a VG, then you can use vgdisplay to see which one has been "assigned" as alt and pri.

Typically, which ever one is listed first, in the vgcreate or vgextend command, is considered the primary. You can remove one to make the other one primary if you prefer them in a certain order.
Unix, the other white meat.
Mic V.
Esteemed Contributor

Re: To identify the Alternate linked Disk

Hi,

My recollection is that EMC's inq command works for all types of disks. I've successfully used it to find information about built-in SCSI disks as well as those on the EMC array.

HTH,
Mic
What kind of a name is 'Wolverine'?
Todd McDaniel_1
Honored Contributor

Re: To identify the Alternate linked Disk

No points here please...

I meant by calling it "proprietary" that it costs to use it. It must be purchased, not that it only works on storage in an EMC frame.
Unix, the other white meat.