Operating System - HP-UX
1829010 Members
2545 Online
109986 Solutions
New Discussion

Determining alternate paths to a disk (non-LVM)

 
Larry Schauer_1
New Member

Determining alternate paths to a disk (non-LVM)

I just read the dialogue at:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=209496

I have a similar problem. I have a script which does "ls -1 /dev/rdsk/*" and does a diskinfo against each disk. How can I tell if the disk has alternate paths? We have an autoraid with 2 LUNs configured but not part of LVM. My script counts each LUN twice. I want an automated way to calculate total storage on a server.

Thanks,
Larry
8 REPLIES 8
Rajeev  Shukla
Honored Contributor

Re: Determining alternate paths to a disk (non-LVM)

Hi Larry,
The other way you could do is to create a map as i used to do in past.
Do an ioscan on the system and looking at the ioscan you'll find that if the disk is same i.e seen from two different path it will have controller number different i.e /dev/c1txdx could become /dev/c2txdx bust the target ID and disk ID will remain the same.
So when you do a ioscan, concentrate on the different controllers and compare the disks seen by each controller. I know its a bit of labour but once you create the comparison and make your map ready you'll never get wrong in choosing the disks.

Cheers
Rajeev
Sunil Sharma_1
Honored Contributor

Re: Determining alternate paths to a disk (non-LVM)

Hi,

It's depend on your server configuration. I am sorry to say that there is no way to do it with 100% accurecy using HP native commands.

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

Re: Determining alternate paths to a disk (non-LVM)

As Rajeev says, the best way is to do a script to compare the hardware paths.

However, if you want to go a bit over the top, you could write a script to compare the data on all your disks. Your disk, after all, just appear as files. You could probably do a checksum on the devices or perhaps just "dd" a few meg off each disk and do a "cmp" of the result. You could even, perhaps, do a "strings" on the devices and "diff" them. All sorts of options. However, the hardware path seems more sensible to me :)
Never preceed any demonstration with anything more predictive than "watch this"
Alex Richardson
Advisor

Re: Determining alternate paths to a disk (non-LVM)

Hi Larry,

I have found this useful in some scripts with alternate path information.

for dsk in `vgdisplay -v|grep "PV Name"|grep -v Alter|awk '{print $3}'|sed s/dsk/rdsk/`
do
diskinfo $dsk >> $LOGFILE
done

I usually strip out the alternate links to avoid incorrect values, but of course you can remove the -v switch and you would only get the diskinfo information for the alternate links. You can also grep for more if you are just looking for a specific VG. In any event I hope you can make some use out of it.

Alex
Larry Schauer_1
New Member

Re: Determining alternate paths to a disk (non-LVM)

Thanks to everyone for your help. This is a tricky situation, because A) these disks are NOT lvm (if they were it would be a lot easier), and B) I'm not allowed to write to them (look but don't touch).

Rajeev---I want to try your suggestion. I'm not exactly sure what you mean, though. Attached at the ioscan files for one of our boxes. We have 8 Seagate drives and 2 autoraids. Two of the autoraid LUNs are non-lvm and have alternate paths. By just using target ID and disk ID, it's possible that I might incorrectly ID two standalone disks as ONE disk with an alternate path. But I guess that's not very likely these days, since most of our systems will only have a few standalone disks.

Is there anything else I can focus on in the ioscan? I'm thinking that maybe I can use the "description" field to get 99% accuracy.

Thoughts?
Kevin Wright
Honored Contributor

Re: Determining alternate paths to a disk (non-LVM)

I got this script from this site previously, it does exactly what you want.
Larry Schauer_1
New Member

Re: Determining alternate paths to a disk (non-LVM)

Thanks Kevin. The script is great! However, it doesn't exactly solve my problem. It shows 4 disks under "UNKNOWN"---2 primary and the 2 alternate. The stand-alone disks appear here as well.

Thanks, Larry
Larry Schauer_1
New Member

Re: Determining alternate paths to a disk (non-LVM)

Rajeev,
I looked at your answer a little more closely:

i.e /dev/c1txdx could become /dev/c2txdx bust the target ID and disk ID will remain the same.

This is not true on our box. The target ID changes by one:

c1t0d0 -> c2t1d0
c1t1d3 -> c2t0d3

Unfortunately, there's no set pattern. :(