IN=prod
for FS in `lsvg -l ${IN}vg | awk ‘$2 == “jfs” {print $NF}’` ; do
LV=`lsvg -l ${IN}vg | awk -v FLB=$FS ‘$NF == FLB {print $1}’`
fuser -k /dev/$LV
fuser -k /dev/$LV
fuser -k /dev/$LV
umount $FS
done
varyoffvg ${IN}vg
What value is getting stuck into LV? I can’t figure out what the awk statement is doing
LV=`lsvg -l ${IN}vg | awk -v FLB=$FS ‘$NF == FLB {print $1}’`
There are two filesystems in the prodvg, plus the jfslog. When I run this command by itself, it returns nothing. From what I can tell, a space (default field sep) is getting assigned to FLB, and awk would then return the $1 field from any line that contains a space? And then 3x kill any processes attached to /dev/blank or /dev/newline or something like that?
Obviously, the intent is to get all filesystems unmounted so the VG can get varied off, but I can’t quite figure out the design of this particular awk.
Anyone got a clue what this is really trying to do (assuming my description above is wrong), or what the author’s thinking was for this?