Rebuilding physical volume metadata
I have a severe problem.
I had a healthly LVM four days ago, but came home to an LVM that no longer had an PV's, and a computer without an PV's listed.
So I had to recreate the physical volumes, and that went ok. When I recreated the volume group, I found that it thought all the PV's were completely empty. Of course this cannot be true. Nothing I did took any time at all, zeroing 700GB's of disk would take a very very long time. I didn't delete any partitions, and so I figure the "maps" or metadata stored on each drive has been deleted somehow.
Is there a way to regenerate these maps using raw sector data? I know my data is there, just getting LVM2 to allow access to it is the problem.
- Sasha Z.
Quoted 2 lines · Sasha Z
I had a healthly LVM four days ago, but came home to an LVM that no longer had an PV's, and a computer without an PV's listed.
What version of LVM2? ('lvm version')
If it's above 2.00.25 then upgrade to 2.00.32.
Versions 2.00.26 to 2.00.31 are best avoided because of problems recognising certain partitioning schemes correctly, which can cause PVs to appear to disappear. [Can often work around by changing lvm.conf.]
Quoted 1 line
So I had to recreate the physical volumes, and that went ok.
No - read the 'vgcfgrestore' man page for instructions.
Alasdair
Signature · 1 line
[email protected]
I have managed to restore the volume group, but I can't mount it as a filesystem, I can't format the logical volume, I can't do anything with lvextend, etc.
Here's a basic operation that fails:
[root@fileserver mapper]# lvextend -L+5G /dev/vg0/lv0
Extending logical volume lv0 to 525.70 GB device-mapper ioctl cmd 9 failed: Invalid argument Couldn't load device 'vg0-lv0'.
Problem reactivating lv0
After doing that, lvdisplay says the logical volume is suspended. What's wrong? /dev/vg0/lv0 is a symlink to /dev/mapper/vg0-lv0
Oh sorry:
root@fileserver mapper]# lvm version
LVM version: 2.00.32 (2004-12-22)
Library version: 1.00.19-ioctl (2004-07-03)
Driver version: 4.3.0
Any thoughts? I'm still unable to mount a filesystem, and the logical volume still seems to get suspended when I try to do anything with it.
I got it to work by reverting to version 2.00.25. 2.00.32 is completely nonfunctional for me.