Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recover a deleted VG in AIX

Status
Not open for further replies.

thedocsta

IS-IT--Management
Jan 5, 2005
12
0
0
ZA
An employee just managed to delete a VG "VG01" from one of our AIX Unix systems. (On instruction from a storage guy who is restructuring disks in the cluster.)
The storage guy did not backup the data and came running to us after the fact requesting the vg to be recovered!

Is there a way of recovering this VG?

Thanks in Advace
TheDoc
 
How has he deleted the vg ? What command has he used ?

The VG has only one disk ?

Il the hdisk is ok, you can try this :
# importvg -y VG1 hdisk#
 
Thanks for the reply

The person deleted it using smit!

It was only on one disk, yes, hdisk5!

I can't import it as it is no longer defined as a volume group member of a physical volume!

Any other ideas would be greatly appreciated!

Thanks
TheDoc
 
Look at the "recreatevg" command or "redefinevg" command available in AIX 5.1 and above.

There are 10 types of people in the world: those who understand binary, and those who don't.
 
Thanks for all your input.

I eventually restored from our legato backup tape library.

Regards
TheDoc
 
Hi

What you mean with "deleted" ?

cfgmgr && importvg -y testvg hdisk5 && lsvg -l testvg

 
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
 
xlist () { VGID=`getlvodm -v &1`; if test &? -ne0
then
exit 1
fi
Q1=`getlvodm -w &VGID | cut -f2 -d' '`; echo &Q1; }; xlist 'vg05'

This done through smit.

VG removed, deleted, gone....
Cannot import...it is not in the available list of import vgs anymore!!??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top