Operating System - HP-UX
1851092 Members
2120 Online
104056 Solutions
New Discussion

Re: Trying to improve script for EMC disk mapping report

 
Rita C Workman
Honored Contributor

Trying to improve script for EMC disk mapping report

I have a script (it was left behind ..oops..when they installed MC/SG..), that does the EMC inq and produces files that are then read by this program and it then produces a report that maps for ALL servers attached to my EMC (..doesn't matter if they are part of cluster or not..just attached to the EMC).
The report gives me the /dev/dsk/ and the associated volume group.
NOW...for what I am trying to do.
I want to expand this (..if it's possible) to add the logical volume and file system also.
I've thought of using the /etc/mnttab (cause with some boxes in SG fstab is obviously not do-able)
But so far I am not sure how I would do this....and ensure that it connects up to the corresponding /dev/dsk entry.

Has anyone done this....or something similar?

Thanks,
Rita
5 REPLIES 5
Kofi ARTHIABAH
Honored Contributor

Re: Trying to improve script for EMC disk mapping report

Rita:

If I understand your question, you want to be able to map a disk device name to logical volumes on that disk and map out the filesystems on the disk right?

AFAIK, Because lvols can be mounted to different filesystem names, given any lvol, you cannot determine what filesystem it maps to unless you consult the corresponding /etc/fstab (or /etc/mnttab). Therefore the way would be to search the fstab or mnttab for each of the identified volume groups. UNLESS you name logical volumes with names that are easily identifiable with the filesystem they are mounted on.

so given the mnttab/fstab, you would be able to do something like:

for lv in `cat list_of_lvol`
do
grep $lv /etc/mnttab
done

for finding out what volumes contain what disks, try:

for disks in `cat list_of_disk_devices`
do
echo $disk
pvdisplay -v $disk | grep "VG Name"
done

good luck.
nothing wrong with me that a few lines of code cannot fix!
James A. Donovan
Honored Contributor

Re: Trying to improve script for EMC disk mapping report

Hi Rita,

Would you be willing to post your script? I've been meaning to write something along those lines myself, but I just never seem to have the time.

TIA,

Jim Donovan
Systems Administrator
Sony Computer Entertainment

Remember, wherever you go, there you are...
Rita C Workman
Honored Contributor

Re: Trying to improve script for EMC disk mapping report

Hi Kofi,

Yes, I understand how to do what you mentioned. What I am trying to do is tie the lvol and filesystem (and I agree more than likely using the /etc/mnttab) and have this tie back to the /dev/dsk/ /dev/vg. I already have the dsk/addr and /dev/vg showing on the report, it's this lvol and filesystem I want to integrate..

So I'm attaching a copy of the script...and I have tried to note the section I'm looking at modifying...
NOW remember, this was not my script..it was written by someone else and I'm just using (enhancing.......) it.
James R. Ferguson
Acclaimed Contributor

Re: Trying to improve script for EMC disk mapping report

Hi Rita!

Interesting. I suggest walking the output of 'bdf' (or /etc/mnttab) taking the filesystem and mountpoint; doing an 'lvdisplay -v' for each; awk that output looking at the "distribution of logical volume" information where the PV names are listed; and then matching those entities to the output in the 'inq' output. This would give you a mapping of mounted directories to physical volumes.

If during this processing you "mark" the 'inq' entities that you have matched you should end up (eventually) with nothing but the EMC gatekeeper disk, CDROMS, and non-EMC disk.

Does this provide any useful suggestion to you?

...JRF...
Rita C Workman
Honored Contributor

Re: Trying to improve script for EMC disk mapping report

You hit exactly what I came up with while I was driving home. The lvdisplay is the only place where the /dev/dsk/ and /dev/vg/lvol are all displayed as output...factor in the /etc/mnttab and I should be able to do this.
I don't care for programming (burned out 20 years ago with code...), and this little darlin' will take awhile to work out the bugs...but I think this will work..
Thanks for yours and everyones input.....

If and when I get the code worked out...I'll post the script for anyone who would like it.
Just be patient....I'm the only UNIX person here, so it may take awhile.

/rcw