home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Recovering LVM information - no /etc/lvm folder available

  • Subject: Re: [OCLUG-Tech] Recovering LVM information - no /etc/lvm folder available
  • From: Allan Fields <afields [ at ] ncf [ dot ] ca>
  • Date: Sun, 03 Feb 2008 23:49:08 -0500

On 3-Feb-08, at 10:52 PM, Maximo Ramos wrote:

Hello there!!

One of my hard disks just died, and it messed up my LVM setup.

My LVM Setup (LVM partitions: 1, 2 and 3):

Disk 1 = root particion and LVM 3
Disk 2 = LVM 1
Disk 3 = LVM 2

Disk 1 is dead, and with it, the /etc/lvm folder with all the
information regarding my LVM setup. My research about recovering LVM
setups involves having access to the /etc/lvm folder and hacking it,
which is not my case.

Which kernel/lvm release?

IRC, LVM2 should have on-disk metadata associated with each PV including volume group (VG) definitions and LVs. Did you have a logical volume spanning multiple disks, or just volumes on each physical disk?

The first question in this case would be: should you first use RAID? But some sites, may have choose these types of arrangements on LVM w/ o RAID due to existing configuration, site policy, predicted disk load/space utilization, etc.

There was a really good presentation back in 2004-2005 timeframe at OCLUG regarding LVM. Thanks again to the presenter. Also the O'Reilly book: "Managing RAID on Linux" covers multiple disk volumes / partitioning arrangements.

Links:
	* http://en.wikipedia.org/wiki/Logical_volume_management
* http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk- space-with-lvm.html
	* http://www.oreilly.com/catalog/mraidlinux/
	* http://sources.redhat.com/lvm2/

An example topology might include:
hda	[PV1    (VG1   LV1  {LV2} )   					]
hdb	[PV2    (VG1   LV3  {LV2} )(VG2   {LV4}           )	]
hdc	[PV3 	                               (VG2   {LV4}  LV5 )	]

in which case if hda dies, PV1 is gone and half of VG1 is toast, but PV{2,3} are around and thus you can still access VG2 and associated: LV4 and LV5. The question is how easy is it to access LV3 (valid file system) and the remainder of LV2 (partial/broken FS). I've never ran into a situation where LVM VGs were part accessible if that is the situation. That would be a good test case for LVM2 Utilities.

I just installed a new hard disk (new Disk 1) with a fresh install of
Fedora. Is there any way to -at least- recover the information in my
LVM setup (Disk 2 and 3), always taking into account that I don't have
the original /etc/lvm folder, not even in backups.

You may be able to use a Linux livecd and use the pvscan, vgscan and lvscan tools. The lvm interactive CLI is included with most modern distributions.

Thanks for your attention.

Maximo

Allan Fields <afields [ at ] ncf [ dot ] ca>