Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

13.9. Recover physical volume metadata

If you get the warning "incorrect metadata area header checksum" or something about not being able to find PV with UUID foo, you probably toasted the volume group descriptor area and lvm startup can't occur.

WarningOnly run on non-functional VG
 

Don't do this on a properly working lvm. You need to specify the correct physical volume to pvcreate or you may lose your data.

Extract the exact uuid for the PV that was overwritten from the file /etc/lvm/archive/VolumeGroupName_XXXXX.vg. (Where XXXXX represents the number of the last known good archived lvm metadata).

Use pvcreate to restore the metadata: pvcreate --uuid "<some_long_string>" --restorefile /etc/lvm/archive/VolumeGroupName_XXXXX.vg <PhysicalVolume>

If you are lucky you'll find that the on-disk lvm metadata takes at least so much space as what it was overwritten with. The above command has been know to recover a PV overwritten with mkswap. If whatever overwrote the VGDA writes past that area, LVs may be affected. In this case, fsck might be able to fix the filesystem on the LV, or you may need more drastic measures to pull data off of it. Contact your local friendly filesystem expert for help in that case.

Note

pvcreate only overwrites the lvm metadata areas on disk and doesn't touch the data areas (the logical volumes).

 
 
  Published under the terms of the GNU General Public License Design by Interspire