|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help in scripting to check if rootvg is mirrored or not
Hi Can some one help me with a script which when executed will check and tell if all the LV's in rootvg are mirrored or not. Say for example in the below server we could see that everything is mirrored except dumplv2. So if I execute the script it should tell that all are mirrored except dumplv2. Please assist with the script. Code:
BMUT8# lsvg -l rootvg rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 2 2 closed/syncd N/A hd6 paging 4 8 2 open/syncd N/A fslv37 jfs2 18 36 2 open/syncd /usr/sap/DAA paging01 paging 160 320 2 open/syncd N/A hd8 jfs2log 1 2 2 open/syncd N/A hd4 jfs2 2 4 2 open/syncd / hd2 jfs2 27 54 2 open/syncd /usr hd9var jfs2 3 6 2 open/syncd /var hd3 jfs2 11 22 2 open/syncd /tmp hd1 jfs2 1 2 2 open/syncd /home hd10opt jfs2 3 6 2 open/syncd /opt fslv01 jfs2 1 2 2 open/syncd /var/log fslv02 jfs2 1 2 2 open/syncd /usr/local fslv03 jfs2 3 6 2 open/syncd /opt/patrol lg_dumplv sysdump 9 9 1 open/syncd N/A hd11admin jfs2 1 2 2 open/syncd /admin fslv04 jfs2 7 14 2 open/syncd /opt/oscdtws1 dumplv2 sysdump 9 9 1 open/syncd N/A |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Quote:
bakunin |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
snip: Code:
#!/usr/bin/ksh
TMP_FILE=/tmp/mirror_check.out
if (( $(lspv| grep -cw rootvg) > 1 )); then
lsvg -l rootvg | awk 'NR > 2 && $2 !~ /^sysdump$/ { if ($3 == $4) {print $0} }' >> $TMP_FILE
NON_MIRR=`wc -l < $TMP_FILE`
if (( $NON_MIRR != 0 )); then
echo "unmirrored LVs found:"
echo
cat $TMP_FILE
fi
fiThe original code was written by zaxxon. Thank Him not me
|
|
#4
|
|||
|
|||
|
Non mirrored LV whose $2 is "sysdump" are not displayed, this is normal (the script as been coded to behave this way)
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
long ago it was ok to not mirror sysdump/hd6 BUT AIX will dump to mirrorred device - so that even on a reboot on a single copy after a dump, the dump is there.
i.e. better practice to mirror imho |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
Moderative Interlude
|
| The Following 4 Users Say Thank You to bakunin For This Useful Post: | ||
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
Xray didn't know it - will send him a PM to be a tad more sensible next time. But you are absolutely right Bakunin. That's the way to go.
Last edited by zaxxon; 02-02-2013 at 01:31 PM.. Reason: spelling |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rootvg mirrored | newtoaixos | AIX | 1 | 05-24-2012 01:27 PM |
| Help scripting to start, check, and restart processes | MacG32 | Shell Programming and Scripting | 12 | 06-24-2011 02:59 PM |
| Scripting to check the size of file and it's existance. | amitkumar.b2 | Shell Programming and Scripting | 1 | 06-06-2011 06:47 AM |
| New to Shell scripting: Can you check it? | sapient | Shell Programming and Scripting | 11 | 10-29-2008 06:02 PM |
| SQL Connection check though Scripting | Swapna173 | UNIX for Dummies Questions & Answers | 2 | 08-20-2008 04:16 AM |
|
|