LVM and VxVM

adb diff between 11.23 and 11.11?

 
SOLVED
Go to solution
Doug O'Leary
Honored Contributor

adb diff between 11.23 and 11.11?

Hey, all;

I have a script that helps to identify disks that are pvlinks but aren't part of the vg to which their corresponding pair is assigned. The function which identifies the vgid from the disk is defined as follows:
id_vgid()
{ pv=$1

echo 0x2010?2X| adb ${pv} 2>/dev/null | expand |tr -d " "| \
sed -e "s/2010://" -e 's/0x//g'
}

On an 11.11 system, the function returns in less than a second. On a pa-risc 11.23 system, it takes at least a couple of minutes.

Is there some argument I can supply to adb which would help it return quicker? Is there a better/quicker way to get the vgid from the disk?

Any hints/tips/suggestions greatly appreciated.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: adb diff between 11.23 and 11.11?

I tried it like this:

echo 0x2010?2X|adb /dev/dsk/c6t8d7|expand|tr -d " "|sed "s/2010://"

same thing...

I know adb behaves differently...

I identify disks with san commands.

For example, I use /usr/symcli/bin/syminq on EMC:

# /usr/symcli/bin/syminq |grep 11B
/dev/rdsk/c60t6d2 M(4) EMC SYMMETRIX 5670 6511B000 35354880
/dev/rdsk/c62t6d2 M(4) EMC SYMMETRIX 5670 6511B000 35354880
/dev/rdsk/c64t6d2 M(4) EMC SYMMETRIX 5670 6511B000 35354880
/dev/rdsk/c66t6d2 M(4) EMC SYMMETRIX 5670 6511B000 35354880

Those are all the same disks..

Sorry - not much help :(

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Doug O'Leary
Honored Contributor

Re: adb diff between 11.23 and 11.11?

Hey;

Thanks for the reply. I'm working on a perl script which does something similar using inq. It just seems a whole lot cleaner and less error prone to go after the vgids directly. But, if I can't, I can't.

Thanks again for the reply.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
James R. Ferguson
Acclaimed Contributor
Solution

Re: adb diff between 11.23 and 11.11?

Hi Doug:

'adb' has undergone some extensive work. Check the 11.23 manpages. There is an '-o' old mode for backwards compatability.

Another way to obtain the VGID of a disk is:

# xd -An -j8200 -N16 -tx /dev/rdsk/cXtYdZ

The output will appear in four fields. The third and fourth field when joined together, are the VGID in question. The first and second field are the PVID.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: adb diff between 11.23 and 11.11?

Hi (again) Doug:

A little boiler-plate should surround my first offering to insure that we are really looking at an LVM disk:

#!/usr/bin/sh

typeset RAWDEV=${1}

[ -z "${RAWDEV}" -o ! -c "${RAWDEV}" ] && { echo "Not a raw device"; exit 1; }

KIND=`xd -An -j 8192 -N8 -tc ${RAWDEV} 2> /dev/null | xargs`

if [ "${KIND}" = "L V M R E C 0 1" ]; then
INFO=`xd -An -j8200 -N16 -tx ${RAWDEV}`
PVID=`echo ${INFO} | awk '{print $1 $2}'`
VGID=`echo ${INFO} | awk '{print $3 $4}'`
echo "${RAWDEV} PVID = ${PVID}"
echo "${RAWDEV} VGID = ${VGID}"
else
echo "${RAWDEV} is not an LVM disk"
fi
exit 0

Regards!

...JRF...
Doug O'Leary
Honored Contributor

Re: adb diff between 11.23 and 11.11?

Hey;

That works perfectly, thank you very much. It also has the added benefit of working on 11.11 so I don't have to do any convoluted if/fi's based on os level.

For my particular need, there are no raw devices used w/o LVM so I'm not bothering to put that logic in; however, if/when I make it available for general use, I very definitely will.

Thanks for the info, I appreciate it alot.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html