Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WARNING .... a little problem on importvg command

Status
Not open for further replies.

sbix

IS-IT--Management
Nov 19, 2003
493
CA
This problem seems to affect only systems with HACMP but it's not rounded to those system.
If I create 2 lv whithe the following names "goofie" and "goofie.new" also in different Vs, the importvg command, ran with the -L option (as it's done by C-SPOC) will fail.
This is because of an error in the importvg command, while "learning" from the VGDA contained in one of the pvs of the importing VG.
The failing command row is:
lqueryvg -p $KEY_DEVICE -L | (awk '{print $2" "$1}'|cut -d'.' -f1) > /tmp/lvverify$$

With the "cut -d'.' -f1" command, the string ".new" of the name of LV goofie.new ... will be lost with the result of importvg command will incorrectly believe that's whe are trying to import a VG with an LV name identical to an already existing one
 
Ooops .... I forgot to say this problem affects AIX 5.2 ML05
 
Good catch!

The problem stems from an assumption that lv names will not contain periods, although mklv allows them. The best solution is too avoid periods in lv names, but if you must have them you should be able to fix it by replacing:
Code:
cut -d'.' -f1
with:
Code:
sed 's/\.[^\.]*$//'

This code, of course, is presented without warranty.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Well ... the "what follows period trashing" is useful for the 2nd field outputed by awk (which was the 1st field in lqueryvg -L output) which should be the VGID followed by the LV sequential number (VGID.seq-number).
Probably the "period plus sequential LV number" should be trashed inside the awk statement with something like
awk '{print $2" "substr($1,(index($1,".")-1)}'
 
True, then we can drop the cut altogether. Much less of a kluge.

But I think you meant

awk '{print $2" "substr($1,1,(index($1,".")-1)}'

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Yep .... you're rite!!! It was exactly what I meant!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top