[mythtv-users] LVM Problem -- Please Help

Tom+Dale tdmyth at yahoo.com
Mon Sep 25 00:52:49 UTC 2006



Austin Roberts <mythtv at ausiv.com> wrote: Greetings to all:
This followup is for the benefit of those who may run into a similar problem in the future.  I was, at last, able to solve this problem.  I was right all along...the data was there.  So when I started experimenting with the archive files associated with LVM, I stumbled on success.  Someone suggested "vgcfgrestore" might work; however, I had to use trial & error with the -t (test) parameter in order to figure this out.  By that I mean reading the LVM HowTo and various man pages did not clarify much for me.  So here are the steps that I took: 
--------------------------------------------------------
[root at mythserver lvm]# vgcfgrestore -tf /etc/lvm/archive/VolGroup00_00000.vg
  Test mode: Metadata will NOT be updated.
  Please specify a *single* volume group to restore. 
[root at mythserver lvm]# vgcfgrestore -tf /etc/lvm/archive/VolGroup00_00000.vg Vol
Group00
  Test mode: Metadata will NOT be updated.
  Restored volume group VolGroup00
[root at mythserver lvm]# vgcfgrestore -tvf /etc/lvm/archive/VolGroup00_00000.vg Vo 
lGroup00
  Test mode: Metadata will NOT be updated.
  Restored volume group VolGroup00
    Test mode: Wiping internal cache
    Wiping internal VG cache
[root at mythserver lvm]# vgcfgrestore -tvvf /etc/lvm/archive/VolGroup00_00000.vg V 
olGroup00
  Test mode: Metadata will NOT be updated.
      Setting global/locking_type to  1
      Setting global/locking_dir to /var/lock/lvm
      File-based locking enabled.
      Locking /var/lock/lvm/P_orphans WB 
      Locking /var/lock/lvm/V_VolGroup00 W
      /dev/hda1: No label detected
      /dev/hda2: No label detected
      /dev/hda3: No label detected
      /dev/hda5: lvm2 label detected
      /dev/hdb: lvm2 label detected 
      /dev/hda5: lvm2 label detected
      /dev/hdb: lvm2 label detected
  Restored volume group VolGroup00
      Unlocking /var/lock/lvm/V_VolGroup00
      Unlocking /var/lock/lvm/P_orphans
    Test mode: Wiping internal  cache 
    Wiping internal VG cache
[root at mythserver lvm]# vgcfgrestore -vvf /etc/lvm/archive/VolGroup00_00000.vg Vo
lGroup00
      Setting global/locking_type to 1
      Setting global/locking_dir to /var/lock/lvm 
      File-based locking enabled.
      Locking /var/lock/lvm/P_orphans WB
      Locking /var/lock/lvm/V_VolGroup00 W
      /dev/hda1: No label detected
      /dev/hda2: No label detected
      /dev/hda3: No label detected 
      /dev/hda5: lvm2 label detected
      /dev/hdb: lvm2 label detected
      /dev/hda5: lvm2 label detected
      /dev/hdb: lvm2 label detected
  Restored volume group  VolGroup00
      Unlocking /var/lock/lvm/V_VolGroup00 
      Unlocking /var/lock/lvm/P_orphans
[root at mythserver lvm]# lvscan
  inactive          '/dev/VolGroup00/LogVol00' [364.21 GB] inherit
[root at mythserver lvm]# lvchange -tv -ay /dev/VolGroup00/LogVol00
  Test mode: Metadata will NOT be updated. 
    Using logical volume(s) on command line
    Activating logical volume "LogVol00"
    Found volume group "VolGroup00"
    Test mode: Wiping internal cache
    Wiping internal VG cache 
[root at mythserver lvm]# lvchange -v -ay /dev/VolGroup00/LogVol00
    Using logical volume(s) on command line
    Activating logical volume "LogVol00"
    Found volume group "VolGroup00"
     Loading  VolGroup00-LogVol00
[root at mythserver lvm]# mount -a
------------------------------------------------------------------------
That did it!  We were able to copy our data off the volume and recover the whole system.  I hope this helps someone else down the road. 

-Tom-


Tom:
Today I did something silly that puts me in a perdicament similar to yours. From what I've seen the results I am getting are very similar to the results you were getting at the beginning -- errors about not being able to find the device with a given uuid, etc. 

When I try to reassign the UUID, I get errors about improper UUID format.

What did you do in order to reassign the UUID to the faulty drive? I've not been able to find that in any of your explanations.

 Thanks,
-Austin

Austin,

I'm sorry I didn't respond sooner...I had not seen your post until today.  Unfortunately for you, I didn't go the route of reassigning the UUID to the faulty drive.  When I removed it, I tried to find an answer or someone who could help me with that.  Even the LVM mailing list was not helpful on that issue (it's extremely low volume compared to this list).  Ultimately, I followed someone's suggestion of issuing the command "vgreduce --removemissing VolGroup00" which allowed me to move on without the previously added, faulty drive.

Still, it seems like you should have been able to use vgcfgrestore to get the metadata back, unless you don't have the backup and archive files available.

Also, there's some information about restoring UUIDs here:
http://tldp.org/HOWTO/LVM-HOWTO/recovermetadata.html

Hopefully you were able to recover the volume by now...

-Tom-


 				
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20060924/588db251/attachment.htm 


More information about the mythtv-users mailing list