LUN details with mount point (2400 Views)
Reply
Frequent Advisor
Sumant M Kumar
Posts: 59
Registered: ‎04-06-2009
Message 1 of 11 (2,400 Views)
Accepted Solution

LUN details with mount point

Dear Experts,

I need to find out LUN info with mount point details. The HPUX machine connected with IBM Storage DS4800 so unable to find which LUN belongs to which mount point.

Is there any command on hpux to check or any formula to calculate ?

Regards,
Sumant M Kumar
Honored Contributor
Mel Burslan
Posts: 3,214
Registered: ‎08-26-1998
Message 2 of 11 (2,399 Views)

Re: LUN details with mount point

Your question lacks details. As a matter of fact, you did not provide any useful information.

for disk in `ioscan -fknC disk | grep rdsk | awk {'print $2'}`; do diskinfo ${disk}; done >/tmp/disklist

(all of the above is on one line)

edit /tmp/disklist and look for the line where it says product ID and find the disks with some sort of IBM designator (I am not familiar with DS4800 so I can't tell you the exact string but it should have IBM letters in it)

Now that you identified the cXtXdX device files for your DS4800 LUNs, it all depends what kind of volume management you are using, i.e.. LVM or VxVM. I am assuming you are using one of these volume managers. Everyone does nowadays.

Provide the output from bdf and people can tell you what you are using, if you don't know the difference between LVM and VxVM

________________________________
UNIX because I majored in cryptology...
Esteemed Contributor
Bob_Vance
Posts: 602
Registered: ‎06-13-2000
Message 3 of 11 (2,399 Views)

Re: LUN details with mount point


an ioscan -fnCdisk will give something like:

disk 249 0/2/1/0.3.0.239.0.13.6 sdisk CLAIMED DEVICE HP MSA2312fc
/dev/dsk/c33t13d6 /dev/rdsk/c33t13d6

Taking the last 3 octets of the disk HW address,
0.13.6
you can calculate the LUN from the array by:

LUN= $(( 128*0 + 8*13 + 6 )) = 110

or generally by 128*3rd + 8*2nd + 1st
.

I wrote a script to do that parsing, but it is very complicated and
dependent on certain kinds of arrays.




Now, for your case, you would have to do:

1) get the Volume Group via:

mount | grep mountpointv2 \
|sed -e 's/.*\/dev\///' -e 's/\/.*//'


2) get the physical paths via:

vgdisplay -v VG | grep -e 'PVG Name' -e 'PV Name'


3) ioscan -fnCdisk < /tmp/ioscan-fnCdisk


4) peruse the /tmp/ioscan-fnCdisk file
for the PV names from step 2

5) use the above formula to get the LU number



E.g.,

1) ## mount | grep /oradatamt \
|sed -e 's/.*\/dev\///' -e 's/\/.*//'

vgoradatamt


2) ## vgdisplay -v vgoradatamt | grep -e 'PVG Name' -e 'PV Name'

PV Name /dev/dsk/c33t13d6
PV Name /dev/dsk/c34t13d6 Alternate Link
PV Name /dev/dsk/c31t13d6 Alternate Link
PV Name /dev/dsk/c32t13d6 Alternate Link
PV Name /dev/dsk/c35t13d6
PV Name /dev/dsk/c36t13d6 Alternate Link
PV Name /dev/dsk/c37t13d6 Alternate Link
PV Name /dev/dsk/c38t13d6 Alternate Link
PVG Name vgoramt_pMSA
PV Name /dev/dsk/c33t13d6
PVG Name vgoramt_lMSA
PV Name /dev/dsk/c35t13d6

NOTE: In my case here, I have PVGs, which devices can be ignored --
there're the same as a device in the part above the PVG section.

NOTE: The LUN # is the SAME for all paths (alternate links) to a device.
Duh. Winning...
er, I mean,
Duh.. thay're pointing to the same LUN!



3) ioscan -fnCdisk < /tmp/ioscan-fnCdisk


4) perusing the /tmp/ioscan-fnCdisk file or using

## grep -e ^disk -e /dev/dsk/c33t13d6 /tmp/ioscan-fnCdisk
I get
...
...
...
disk 249 0/2/1/0.3.0.239.0.13.6 sdisk CLAIMED DEVICE HP MSA2312fc
/dev/dsk/c33t13d6 /dev/rdsk/c33t13d6
...
...
...


5) use formula :
## echo $(( 128*0 + 8*13 + 6 ))
110


so my LUN for that device is 110


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Esteemed Contributor
Bob_Vance
Posts: 602
Registered: ‎06-13-2000
Message 4 of 11 (2,399 Views)

Re: LUN details with mount point

I forgot to mention that if you're using the new flexible device names under HPUX 11.31, then you can use

ioscan -m dsf

to see the legacy name for the flexible name.


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Honored Contributor
Manix
Posts: 518
Registered: ‎12-03-2010
Message 5 of 11 (2,399 Views)

Re: LUN details with mount point

Hello Bob,

echo $(( 128*0 + 8*13 + 6 ))

are we skipping continuous binary conversion here ( like 16,8,4,2,0 ) ..just to know the fact over here

Thanks
Manix
HP-UX been always lovable - Mani Kalra
Esteemed Contributor
Bob_Vance
Posts: 602
Registered: ‎06-13-2000
Message 6 of 11 (2,399 Views)

Re: LUN details with mount point

Yes.
It's not a simple progression of powers of 2.

In cXtTdL,
relating to the last 3 octets of the HW address,
the T comes from the 2nd octet and L comes from the 3rd octet

But, L (3rd octet) goes only from 0-7,
so, T represents a multiple of 8.
The progression of LUNs would be:
...
HW 0.0.6 --> t0d6 = (0*8) + 6 = 6
HW 0.0.7 --> t0d7 = (0*8) + 7 = 7
then we roll over to
HW 0.1.0 --> t1d0 = 1*8 (+0) = 8

T (2nd octet) only goes from 0-15,
so, the first octet represents a multiple of 8*16 = 128.
The progression of LUNs would be:
...
HW 0.15.6 --> cNt15d6 = (15*8) + 6 = 126
HW 0.15.7 --> cNt15d7 = (15*8) + 7 = 127
then we roll over to
HW 1.0.0 --> cMt0d0 = 1*128 (+0*8) (+0) = 80



A little simplified, we can say:

There's nothing special, really, about these restrictions (0-7 an 0-15) in the cXtTdL convention. It all relates to trying to fit Fibre Channel devices/LUNs into the original, simple, halcyon days of simple SCSI disk naming convention, where the cXtTdL came from.

Back then, all we had were disks and tapes and the T was the SCSI target and L was the target's LUN (still is, for real SCSI disks). LUN was 3 bits and so restricted to 0-7.
However, real SCSI disks *always* report as LUN0 (so L was always 0 -- and still is for all the disks attached to actual SCSI busses on our systems -- check it out for the "internal" disks).
So, interestingly, the DISK ID that we change with the jumpers on a real SCSI disk or the switches on a Jamaica box changes the TARGET number, not the LUN number. LUN 0 is required for all targets, and so the DISK always reports as LUN0, whatever its target is.

SCSI-1 spec allowed up to 8 targets on the bus. while
SCSI-2 spec allowed only up to 16 targets on the bus

-- hence T = 0-15.




bv
"The lyf so short, the craft so long to lerne." - Chaucer
Frequent Advisor
Sumant M Kumar
Posts: 59
Registered: ‎04-06-2009
Message 7 of 11 (2,399 Views)

Re: LUN details with mount point

Thanks a lot Bob. I have calculated with this formula i am getting the exact LUN value.

Dear Bob & Experts , Let me know if there is any command like xpinfo -i for IBM storage also.

Regards,
Sumant M Kumar
Valued Contributor
Vivek_Pendse
Posts: 139
Registered: ‎05-04-2007
Message 8 of 11 (2,399 Views)

Re: LUN details with mount point

Hi,

There is an IBM multipathing software named IBMSdd for DS storages for hp-ux, which is free & available on IBM site.
You can install that on hp-ux & run the below commands:
querysn -l
showvpath -l
With this commands, you can get the LUN ID wrt device file. Further you can trace that device file in lvmtab.
Even, you can use the vpath device files like pdsf in 11.31 & can define load balancing.

Thanks,
Vivek
Frequent Advisor
Sumant M Kumar
Posts: 59
Registered: ‎04-06-2009
Message 9 of 11 (2,399 Views)

Re: LUN details with mount point

Thats really good tool/utility Vivek but i am unable to get the exact download path from IBM site.

http://www-01.ibm.com/support/docview.wss?uid=ssg1S4000053

My system configuration is hpux 11.23 and connected with IBM Storage DS4800

Regards,
Sumant M Kumar
Valued Contributor
Vivek_Pendse
Posts: 139
Registered: ‎05-04-2007
Message 10 of 11 (2,400 Views)

Re: LUN details with mount point

Hi Sumant,

ftp://ftp.software.ibm.com/storage/subsystem/hp-ux/1.8.0.2/readme_v1802.txt

http://www-01.ibm.com/support/docview.wss?uid=ssg1S4000053#ds4k

As, you have ds4800 & the above drivers are suitable for almost all DS series.

Try it & let me know,

Thanks,
Vivek
Frequent Advisor
basant
Posts: 52
Registered: ‎08-04-2011
Message 11 of 11 (2,258 Views)

Re: LUN details with mount point

its not working in my case
disk 24 0/3/0/0/0/0.214.1.239.0.0.6 sdisk CLAIMED DEVICE DGC CX3-80WDR5

/dev/dsk/c3t0d6 /dev/rdsk/c3t0d6

128*0+8*0+6=6
but #powermt display dev=all
is showing lun id is 256

Please tell me how it is possible
Basant Sharma
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.