Operating System - HP-UX
1833514 Members
3863 Online
110061 Solutions
New Discussion

Re: Finding total number of disks

 
Vijaya Kumar_3
Respected Contributor

Finding total number of disks

Hi,

I am trying to find out total number of disks available on some HP 9000 L5000 class, N4000 and K570 class servers.. I used following command..

disks=`ioscan -fkC disk |grep -v CD|grep -v Class|grep -v ==== |wc -l`
echo "total disks = "$disks

I found some wrong information on the output.
It shows 239 disks on a N class server. Can you please tell me how to find out total number of disks....

thanks in advance
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
9 REPLIES 9
Umapathy S
Honored Contributor

Re: Finding total number of disks

ioscan -fkC disk|grep disk|wc -l is not enough?
Arise Awake and Stop NOT till the goal is Reached!
Uday_S_Ankolekar
Honored Contributor

Re: Finding total number of disks

Did you try ??
ioscan -fnkC disk | grep disk | wc -l

-USA..
Good Luck..
Pete Randall
Outstanding Contributor

Re: Finding total number of disks

Vijay,

I suspect you're seeing alternate paths. You could use SAM but you're probably trying to do this in a script? How about using vgdisplay -v instead of ioscan?


Pete


Pete
Vijaya Kumar_3
Respected Contributor

Re: Finding total number of disks

yes, ioscan is not enough it seems.
ioscan -fnkC disk is also not enough.

Pete:
I tried
vgdisplay -v | grep "PV Name"
46

but, i think vgdisplay -v will show only physical volumes that are attached to a VG, is it right? let me check the man pages? any other ideas?

Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Hari Kumar
Trusted Contributor

Re: Finding total number of disks

If you ar using an array and U want find the Disks and not LUNs u can use
armdsp -a |grep 'Disk at ' |wc -l

and the
ioscan -fnC |grep disk |wc -l for the LUN's
i could find correct with alternate links also
Information is Wealth ; Knowledge is Power
Jeff Schussele
Honored Contributor

Re: Finding total number of disks

Hi Vijay,

As Pete has pointed out you have to be careful about using ioscan to determine disk/LUN count. Not only will it show alternate links (effectively doubling the disk count), it will also show "gatekeeper" devices on XPs & EMCs - not to mention CD/DVD devices.

So I'd have to agree that

vgdisplay -v | grep "PV Name" | grep -v grep | grep -v "Alternate Link" | wc -l

would be a better method.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Helen French
Honored Contributor

Re: Finding total number of disks

1) Your best option would be to use SAM and disk devices to list the disks.
2) You can use the print_manifest command and look at the disk devices session.
Life is a promise, fulfill it!
Sundar_7
Honored Contributor

Re: Finding total number of disks



Did u try ?

# sympd list

Learn What to do ,How to do and more importantly When to do ?
Steven E. Protter
Exalted Contributor

Re: Finding total number of disks

Its possible ghost disks are being picked up by the i/o scan. What I mean by that are logical volumes once allocated, but later removed.


I'm attaching a script that will let you check and count(you need to make a mod to get a count) of all disks configured and part of logical volumes.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com