Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
            }
    }

}

share|improve this question
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. –  JodieC May 29 '12 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 '12 at 20:11
    
changed the question, thx –  maruti May 31 '12 at 7:57
    
Anything in /etc/lvm/backup/datastore1 ? –  Jiri Xichtkniha May 31 '12 at 9:11
add comment

1 Answer 1

up vote 3 down vote accepted
+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

share|improve this answer
    
does not seem to work.......after step #2: vgchange -ay ...."0 logical volumes in datastore1 active" –  maruti Jun 1 '12 at 6:19
    
@maruti maybe you can share your /etc/lvm/backup/datarestore1 ? –  warl0ck Jun 1 '12 at 6:36
    
@maruti seems broken , I see two unmatched '{' –  warl0ck Jun 1 '12 at 7:01
    
@warlock.....I missed some earlier ...check now... –  maruti Jun 1 '12 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 ... –  warl0ck Jun 1 '12 at 7:14
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.