mkwpar, truss and coffee!A colleague was attempting to recreate a WPAR. The WPAR had previously been removed using the WPAR Manager Web GUI. This worked, or so he tells me!
Anyway, when he tried to create the WPAR again from the GUI, using the same WPAR name (wpar20), it failed. The error claimed that /wpars/wpar20 already existed. But it didn’t!
Now, before I go any further, looking back at the issue now, it is pretty obvious what the problem might have been. However, the solution was not evident at first. This proves one thing for certain: some problems cannot be resolved without TWO cups of coffee in the morning.
Of course, I resorted to the command line to see what was REALLY happening.
The mkwpar command was indeed complaining that /wpars/wpar20 already existed.
# mkwpar -n wpar20 mkwpar: 0960-288 The /wpars/wpar20 file system already exists. mkwpar: 0960-417 Specify -p to create this workload partition using the existing file system data.
I could not find any directory or file system with that name, anywhere under /wpars or elsewhere.
# ls -l /wpars/wpar20 /wpars/wpar20 not found
# ls -l /wpars total 0 #
# df –g | grep –i wpar #
# lsvg | lsvg –il | grep –i wpar #
I ran the mkwpar with truss to try to find out where it was finding the reference to /wpars/wpar20. At this point you have probably already determined where the problem might be!
The truss output
pointed me in the direction of /etc
# truss mkwpar -n wpar20 > /tmp/wpar20 2>&1 # vi /tmp/wpar220
stat kope
Whatever my learned colleague had done when he “removed” the WPAR with the GUI, it left entries for the WPARs file systems in /etc/filesystems.
# grep wpar20 /etc/filesystems | grep -v type /wpars/wpar20: /wpars/wpar20/home: /wpars/wpar20/opt: /wpars/wpar20/proc: /wpars/wpar20/tmp: /wpars/wpar20/usr: /wpars/wpar20/var:
And after removing these entries with the rmfs command, like so:
# grep wpar20 /etc/filesystems | grep -v type | sed -e 's/://' /wpars/wpar20 /wpars/wpar20/home /wpars/wpar20/opt /wpars/wpar20/proc /wpars/wpar20/tmp /wpars/wpar20/usr /wpars/wpar20/var
# grep wpar20 /etc/filesystems | grep -v type | sed -e 's/://' # cg="/wpars/wpar20 > /wpars/wpar20/home > /wpars/wpar20/opt > /wpars/wpar20/proc > /wpars/wpar20/tmp > /wpars/wpar20/usr > /wpars/wpar20/var > "
# echo $cg /wpars/wpar20 /wpars/wpar20/home /wpars/wpar20/opt /wpars/wpar20/proc /wpars/wpar20/tmp /wpars/wpar20/usr /wpars/wpar20/var
# for i in $cg > do > rmfs $i > done
We were able to create the WPAR once more without a problem.
# mkwpar -n wpar20 mkwpar: Creating file systems... / /home /opt /proc /tmp /usr /var Mounting all workload partition file systems. x ./usr x ./lib x ./admin x ./admin/tmp x ./audit x ./dev x ./etc x ./et x ./etc/consdef x ./etc/cronlog.conf x ./etc/csh.cshrc x ./etc/csh.login x ./etc/dlpi.conf x ./etc/dumpdates x ./etc/environment x ./etc/ewlm x ./etc/ewlm/limits x ./etc/ewlm/trc x
./et x
./et x ./etc/filesystems x ./etc/group x ./etc/inittab x ./etc/magic ...etc...
Lessons I learnt from this were twofold, truss is (still) useful and drink more coffee before tackling a problem! |