importvg doesn't work, there is no VGDA to work from.
After removing a volume group, I tried recreatevg and received this error:
# recreatevg -y myvg hdisk20
0516-066 lqueryvg: Physical volume is not a volume group member.
Check the physical volume name specified.
0516-066 lqueryvg: Physical volume is not a volume group member.
Check the physical volume name specified.
0516-066 lqueryvg: Physical volume is not a volume group member.
Check the physical volume name specified.
0516-082 lrecreatevg: Unable to access a special device file.
Execute redefinevg and synclvodm to build correct environment.
0516-1320 recreatevg: Unable to recreate volume group.
An attempt of redefinevg yielded this error:
# redefinevg -d hdisk20 myvg
0516-066 : Physical volume is not a volume group member.
Check the physical volume name specified.
Here is the method that I have used under AIX 4.3 and AIX 5.1.
Note: this assumes you keep good recovery data for LVs and filesystems. This data should be kept on a remote system, as it never does any good to have the data on a system that is down or on a volume group that has been accidentally removed.
a) backup /etc/filesystem
b) recreate the volume group with the same drive(s) (obviously) with the same PP size
c) Create the LVs
recreate the LVs at the exact same size and with the same mapping as the original. The system logs that are referenced in my "Note" should contain this data. Build map files and create the LVs using the "-m <mapfile>" flag.
"man mklv" to read more on map file syntax.
d) create the jfslog(s) for the volume group
logform the jfslog volumes. This is highly destructive, so no typing mistakes here.
e) manually edit /etc/filesystems. Add a stanza per filesystem:
/filesystem/path:
dev = /dev/mytmp
vfs = jfs
log = /dev/loglv05
mount = false
check = true
options = rw
account = false
The /filesystem/path does not need to match the original.
*do not* run crfs or mkfs to create the filesystem.
h) mount the filesystem
If you have mapped the LVs properly, the filesystems will mount and the data will be available.
gg