Operating System - HP-UX
1833159 Members
2998 Online
110051 Solutions
New Discussion

How to identify alternate path

 
SOLVED
Go to solution
Byron Myers
Trusted Contributor

How to identify alternate path

Is there a scripting way/method discover alternate paths to LUNS without doing any pvcreate's? In other words, If I log into a system I have never seen before, and the system has many unconfigured LUNs, then can I write a script to discover alternate paths?
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
9 REPLIES 9
Vincenzo Restuccia
Honored Contributor

Re: How to identify alternate path

#vgdisplay -v|grep -i alternate
MANOJ SRIVASTAVA
Honored Contributor

Re: How to identify alternate path

Hi Byron

Do a pvdisplay /dev/dsk/cxtydz and it will show you the alternate pathh too , however in case you can also do a ls -lt on the /dev/dsk for that disk device and check for the similar device created with the same time stamp ( crude way but it works ).


Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: How to identify alternate path

Hi Byron:

Yes. Compare the PVID and VGID values of the devices in question. If the values are the same, then one device is an alternate link of the other:

# DEV=/dev/dsk/cXtYdZ

# PVID=`echo 0x2008?2X|adb $DEV|expand|tr -d " " |sed "s/2008:/PVID /"`

# VGID=`echo 0x2010?2X|adb $DEV|expand|tr -d " " |sed "s/2010:/VGID /"`

echo $PVID $VGID

...and repeat for the second device file...

...JRF...
Byron Myers
Trusted Contributor

Re: How to identify alternate path

The suggestions above are great for already configure PV's and VG's, but I'm looking for a method for discovering alternate paths when NO VG's have been created. For example, you can use EMC's "inq" command to identify serial numbers of LUNs for Symmetrix systems. Each path points to the same serial number. But what about other storage systems, like SC10's, Jamaica's, autoraids, etc.

Is there a way to find alternate paths without knowing the hardware mappings and BEFORE any VG's are created?

If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
MANOJ SRIVASTAVA
Honored Contributor

Re: How to identify alternate path

Hi Byron

I know what I answered was after the vg's are created sorry . Try this.

Suppose you know atleast one path ( this you can find out doing a ioscan -fnC disk ) , check for the time stamp in /dev/dsk for that file , then grep for that time stamp you will get all the deivce files created witht that time stamp , so now you have narrowed down to few devices , an good analysis on the id will give you the answer , also try vgcrete using what you think is alternate path , it will not clreate unless both the paths point to the same disk.

Manoj Srivastava
Paula J Frazer-Campbell
Honored Contributor

Re: How to identify alternate path

Hi

Run this script - I stole it from a HP engineer.

It should give you all the info you require.

Paula
If you can spell SysAdmin then you is one - anon
Solution

Re: How to identify alternate path

Byron,
What I did was did on a system was diskinfo -v /dev/rdsk/cXtYdZ |grep Addit |awk '{print $4,$5,$6,$7,$8,$9,$10}'. This will give you a list such as this;
(32)37 (33)30 (34)32 (35)46 (36)30 (37)30 (38)30
Just replace each word with its ASCII code, so this disks serial number would be ?702f000 the ? is because I do not get the first number. So on a disk with two paths you would just have to match up the serial numbers such as from these two disks;

primary path /dev/dsk/c7t1d1
(32)37 (33)30 (34)32 (35)46 (36)30 (37)30 (38)30 so the serial number is ?702f000

And its Alternate Link /dev/dsk/c11t9d1
(32)37 (33)30 (34)32 (35)46 (36)30 (37)30 (38)30 this one is ?702f000

Now just a little scripting and you should be able to peak at your drives and find both paths to them. Give it a try and let me know if it works.
Carlos Fernandez Riera
Honored Contributor

Re: How to identify alternate path

I think S/N is the only way too. But dont think on diskinfo -v.

10 points to Terry.
unsupported
Joseph A Benaiah_1
Regular Advisor

Re: How to identify alternate path

Byron,

One other methods that springs to mind is this:

dd if=/dev/rdsk/cXtYdZ of=/tmp/pri.out bs=64k count=100

dd if=/dev/dsk/cUtVdW of=/tmp/alt.out bs=64k count=100

You could do a strings on both files and compare them.

I like Terry's method though, I will try it when I am back in the office.

Cheers,

Joseph.