AIX and VIO Server readvgda
There is a new command in AIX 6.1 and later that allows you to read the VGDA from a disk that is not online. It is a great command that replaced the need to use commands like lqueryvg and lquerypv etc. This can safely be run (by root) on disks on a VIO server that are presented to and in use by the clients. The command does a quick read of the VGDA from the disk and displays lots of useful information regarding disk, volume groups and logical volumes.Usage: readvgda [-hqldps | -t | -m <lv> [-c#] | -v# ] <file|disk>
-h header, print raw first block of the disk
-q queryvg, print 'lqueryvg' like data
-l lv, format vgda to show 'lslv' and 'lslv -m' data
-d (default) debug, print vgsa & vgda structures.
-p primary, only print info from and about primary MD areas
-s secondary, only print info from and about secondary MD areas
-m map, format vgda to print lv map for specified lv
-t timestamps, only print timestamps (overrides other options).
-c copy, for use with -m, only print map for this copy
-v verbosity #, print outputs for snap (primary areas only):
-o query ODM for PV names, VG names, and other ODM attributes.
file if file isn't found, will try /dev/file
Here is an example where I read the VGDA from an old rootvg disk that is varied off.
# lspv | grep -w hdisk[01]
</code><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">hdisk0 00112233445566ea old_rootvg</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">hdisk1 aabbccddeeffgg2b5 old_rootvg</span></p>
<p><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"><code># lsvg
</code><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">old_rootvg</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">rootvg</span></p>
<p><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"><code># lsvg -o
rootvg
# readvgda -q /dev/hdisk0
.....
..... Fri May 20 11:43:04 EET:2011
..... readvgda -q /dev/hdisk0
..... readvgda_file: /dev/hdisk0
..... readvgda_type: smallvg
..... readvgda_ver: 3
.....
============= B: QUERYVG /dev/hdisk0 0 =============
VGID: 001122334455660000000aabbccdd6fd
Max LVs: 256
PP Size: 28
Free PPs: CALC
LV count: 13
PV count: 2
Total VGDAs: 3
Conc Allowed: 0
MAX PPs per PV: 1016
MAX PVs: 32
Quorum (disk): 1
Autovaryon: 1
Conc Autovaryon: 0
Varied on Conc: LVDD
Logical: LVID lvname state
001122334455660000000aabbccdd6fd.1 hd5 CALC
001122334455660000000aabbccdd6fd.2 hd6 CALC
001122334455660000000aabbccdd6fd.3 paging00 CALC
001122334455660000000aabbccdd6fd.4 hd8 CALC
001122334455660000000aabbccdd6fd.5 hd4 CALC
001122334455660000000aabbccdd6fd.6 hd2 CALC
001122334455660000000aabbccdd6fd.7 hd9var CALC
001122334455660000000aabbccdd6fd.8 hd3 CALC
001122334455660000000aabbccdd6fd.9 hd1 CALC
001122334455660000000aabbccdd6fd.10 hd10opt CALC
001122334455660000000aabbccdd6fd.12 fslv00 CALC
001122334455660000000aabbccdd6fd.13 pridumpdev CALC
001122334455660000000aabbccdd6fd.14 secdumpdev CALC
Physical: PVID #vgdas pvstate stale
00112233445566ea 2 1 CALC
aabbccddeeffggb5 1 1 CALC
Total PPs: 1092
LTG size (disk): 128
HOT SPARE: 0
AUTO SYNC: 0
VG PERMISSION: LVDD
SNAPSHOT VG: 0
IS_PRIMARY VG: 0
PSNFSTPP: CALC
VARYON MODE: LVDD
VG Type: 0
Max PPs: 32512
============= E: QUERYVG =============