5

Centos- 6, LVM2 after a system hang and hard reboot.

lvdisplay and lvscan return no volumes. It had volumes earlier...how to recover?

there is data on LV (logical volume) - shared as NFS export..

VG is listed under /etc/lvm/backup/datastore1. any ideas to restore the LV?

vgdisplay  
  -- Volume group --  
  VG Name               datastore1  
  System ID  
  Format                lvm2  
  Metadata Areas        1  
  Metadata Sequence No  1  
  VG Access             read/write  
  VG Status             resizable  
  MAX LV                0  
  Cur LV                0  
  Open LV               0  
  Max PV                0  
  Cur PV                1  
  Act PV                1  
  VG Size               10.92 TiB  
  PE Size               4.00 MiB  
  Total PE              2861467  
  Alloc PE / Size       0 / 0  
  Free  PE / Size       2861467 / 10.92 TiB  
  VG UUID               7uq001-dUxd-I1WS-PPu2-ljT3-FybY-D9ddx2

cat /etc/lvm/backup/datastore1

datastore1 {
    id = "7uq001-dUxd-I1WS-PPu2-ljT3-FybY-D9ddx2"
    seqno = 2
    status = ["RESIZEABLE", "READ", "WRITE"]
    flags = []
    extent_size = 8192              # 4 Megabytes
    max_lv = 0
    max_pv = 0
    metadata_copies = 0

    physical_volumes {

            pv0 {
                    id = "kRGDrz-YFyf-EIKk-0om6-9H78-jgle-9z0B27"
                    device = "/dev/cciss/c0d1p1"    # Hint only

                    status = ["ALLOCATABLE"]
                    flags = []
                    dev_size = 23441142637  # 10.9156 Terabytes
                    pe_start = 2048
                    pe_count = 2861467      # 10.9156 Terabytes
            }
    }

}
4
  • 3
    you might run vgscan or vgdisplay to see the status of the volume groups. If a volume group is inactive, you'll have the issues you've described. You'll have to run vgchange with the appropriate parameters to reactivate the VG. Consult your system documentation for the appropriate flags. You'll be able to run vgscan and then lvscan afterwards to bring up your LVs.
    – Jodie C
    May 29, 2012 at 19:03
  • Normally LVM should preserve all settings. This is neither a NFS-problem, nor a LVM problem. Perhaps you should change the title of your question...
    – Nils
    May 29, 2012 at 20:11
  • changed the question, thx
    – JMS77
    May 31, 2012 at 7:57
  • Anything in /etc/lvm/backup/datastore1 ?
    – jirib
    May 31, 2012 at 9:11

1 Answer 1

5
+50

If you're about to restore the LVM partiton scheme from backup file , you could try:

vgcfgrestore datarestore1

If everything is ok , try activate all LVs by:

vgchange -ay

And do a fsck on all volums with fsck , e.g fsck /dev/datarestore1/XX

If no errors occured , try mount them by mount -a

8
  • does not seem to work.......after step #2: vgchange -ay ...."0 logical volumes in datastore1 active"
    – JMS77
    Jun 1, 2012 at 6:19
  • @maruti maybe you can share your /etc/lvm/backup/datarestore1 ?
    – daisy
    Jun 1, 2012 at 6:36
  • @maruti seems broken , I see two unmatched '{'
    – daisy
    Jun 1, 2012 at 7:01
  • @warlock.....I missed some earlier ...check now...
    – JMS77
    Jun 1, 2012 at 7:04
  • @maruti bad news , i think it's not recoverable from backup cfg file , normally you should see a entry named "logical_volumes" , which contains info of LVs , your config seems to have PV info only ...
    – daisy
    Jun 1, 2012 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .