1838613 Members
5181 Online
110128 Solutions
New Discussion

Vgcfgrestore command

 
Mihaita Bighiu
Advisor

Vgcfgrestore command

Hi,

I loosed the LVM information on two disk. I have a good backup of the volume group vgprod.conf and also the affected disks are in /etc/lvmtab ( file was not changed in last week ans is OK).
Could I use vgcfgrestore to restore back the LVM configuration from vgprod.conf file?
The vgscan -apv commnad show that the disks are not part of any vg but pvdisplay return's that they are on vgprod.

If yes could I use vgcfgrestore Online ( fs mounted and DB up)? Or I need down time?

Thanks,
MB
4 REPLIES 4
Mihaita Bighiu
Advisor

Re: Vgcfgrestore command

Hi, One more detail here. The vgdisplay command display the same value for CUR PV and ACT PV. Diskinfo is also OK.

I did also:
# echo 0x2010?2X|adb /dev/dsk/c11t1d5|expand |tr -d " "|sed "s/2010:/VGID /"
VGID 00

# echo 0x2010?2X|adb /dev/dsk/c11t1d4|expand |tr -d " "|sed "s/2010:/VGID /"
VGID 00

Same command on a good disk on same vg display the VG ID correct.

# echo 0x2010?2X|adb /dev/dsk/c11t1d3|expand |tr -d " "|sed "s/2010:/VGID /"
VGID 28BB153738E4B9D7

Do I have a bad disk here or is OK to restore from vgdata.conf backup file?

Thanks,
MB

Stefan Saliba
Trusted Contributor

Re: Vgcfgrestore command

The question to ask I guess is , what happened to end up losing the LVM info ?

As long as you have a good vgcfgbackup then you will restore the LVM info on the disks that is no prob. Of course you will restore the data from your backups.

If you have backups of the data in volume group vgprod then I will first ioscan and check that all disks are claimed, pvcreate all disks affected in this volume group.

then I will vgcfgrestore

then vgchange -a y vgprod

and mount it, grab the tapes and restore

If you have mirroring then I suggest to remove the mirroring then mirror later.

I suggest going in single user mode with vgprod de-activated to be extra safe.


Good luck
Stefan
Jon Finley
Honored Contributor

Re: Vgcfgrestore command

If you're mirrored, you should be able to issue:

vgcfgrestore -n vgprod ......
vgchange -a y /dev/vgprod
vgsync vgprod

to have the two disks rebuilt.

If these are unmirrored disks, then the backups will have to be restored after the headers have been re-build and the volume group re-activated.

Jon
"Do or do not. There is no try!" - Yoda
MANOJ SRIVASTAVA
Honored Contributor

Re: Vgcfgrestore command

Hi MB

If you are saying that the vg has some lvol mounted than the same has more disks than 2. I would do like this :

1. Try backing up the lvols on teh vg first.
2. vgcfgrestore /dev/vgprod /dev/dsk/disk1 and then the disk2.

ofcourse this wont work online ( bcoz it shows equal no of Curretn adnActive PV's) then we do vgcahnge -a n /dev/vgprod and then vgcfgrestore ,


Manoj Srivastava