Operating System - HP-UX
1752591 Members
2763 Online
108788 Solutions
New Discussion юеВ

script to determine internal vs external disks

 
Penni Nussbaum
Frequent Advisor

script to determine internal vs external disks

I am in the process of writing a "collection" script to be run on all of our HP servers. It was asked that I specify which disks are internal and which disks are external. However, since this script will be run on many different model servers, I don't see how this is possible without keeping a hardcoded table listing each type of server and the address for the internal disks. Does this sound correct?
3 REPLIES 3
Leif Halvarsson_2
Honored Contributor

Re: script to determine internal vs external disks

Hi

I think you are right. What you can get is which SCSI-bus a disk is is connectet to but not automatic if this is a internal or external bus. In some cases it is also possible external and internal diska share the same bus.
Stefan Farrelly
Honored Contributor

Re: script to determine internal vs external disks


Yes, youre out of luck. Even a full ioscan | grep ext_bus shows both internal and external controllers for varoius models. You are going to have to keep a master list of which paths for which server types for internal/external.

Im from Palmerston North, New Zealand, but somehow ended up in London...
Ralph Grothe
Honored Contributor

Re: script to determine internal vs external disks

Hi Penni,

as Leif wrote you could look after the bus to possibly decide whether the disks are internal.
Though it may give a propper indication I think it's not ultimately reliable.
Nor would be this method, I use because it works for most of our big application and db servers that are connected to disk storage systems.
I look at the description field of the ioscan command to parse the vendor (which in our case would either be EMC or HITACHI OPEN-*)

This will show you the specified field:

ioscan -kFCdisk|awk -F: '{print $(NF-1)}'
Madness, thy name is system administration