Operating System - HP-UX
1832646 Members
2756 Online
110043 Solutions
New Discussion

vgcfgrestore does not work

 
SOLVED
Go to solution

vgcfgrestore does not work

I am replacing a crashed disk on a server I vgcfgrestore wont let me restore the LVM configuration to the new disk. The disk was a mirror in vg02 and what I've done is to reduce all LV's that contained this bad disk and then physically replaced the disk.
After that I am trying to restore LVM configuration using
# vgcfgrestore -n vg02 /dev/rdsk/c0t3d0

But I get 'Couldn't query physical volume...The specified path does not correspond to physical volume attached to this volume group'.

If I use the -R flag I get the same error but vgcfgrestore exists saying the the volume group information has been successfully restored. However it doesn't seem so because I cannot mirror the LV's again - I get 'Couldn't query physical volume...'

The disk is configured into lvmtab and vg02.conf (checked using -l flag in vgcfgrestore).

I've run into this problem once before and then I solved it by deactivating the VG but this time it's a live system that cannot be shutdown easily.

How do I restore the LVM configuration to this new disk correctly? The system is a K380 running HP-UX 11.00.
4 REPLIES 4
Dietmar Konermann
Honored Contributor
Solution

Re: vgcfgrestore does not work

vgcfgrestore -R was the right approach... and it's completely normal that it again complains. However, if you see "has been successfully restored" then the vgcfgrestore succeeded.

Have you done the required re-activation afterwards? (vgchange -a [ye] VG)

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)

Re: vgcfgrestore does not work

Nope, I did not run vgchange - didn't know it was required as I never deactivated it. However when I did run it everything worked.

Thanks a lot!
Dietmar Konermann
Honored Contributor

Re: vgcfgrestore does not work

You need to run the vgchange, because the vgcfgrestore command only restores the structures on disk. It's a pure user-land command. The LVM kernel driver is not notified about any change and so still assumes the bad header. A vgchange attempts to attach the PVs again to the VG using LVM ioctl()s... this time the LVM driver recognizes the repaired structure.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jov
Honored Contributor

Re: vgcfgrestore does not work

Hi Anders,

Did you try vgcfgrestore before or after you reduced all the LVs with the bad disk?

Also did you vgreduce the PV from the VG?

If you did, then according to LVM, the replaced disl (pv) is not part of the VG. Which is why you got the error.

To do this all online without deactivating the VG, I'll lvreduce the LV, then pvreduce the PV and start the mirroing process for VG02.


Jov