Print | Rate this content

Red Hat Enterprise Linux 7 - Cannot Repair LVM ThinPool Metadata Due to Mismatched Spare Metadata LV Size

Title: Red Hat Enterprise Linux 7 - Cannot Repair LVM ThinPool Metadata Due to Mismatched Spare Metadata LV Size
Object Name: mmr_kc-0126722
Document Type: Support Information
Original owner: KCS - Linux
Disclosure level: Public
Version state: final
Environment
FACT:RHEL7
FACT:LVM Thin Provisioning
Questions/Symptoms
SYMPTOM:"lvconfig --repair" fails with: Internal error: Missing allocatable pvs
			
SYMPTOM:Cannot repair LVM ThinPool metadata 
Cause
CAUSE:When an LVM ThinPool is created, a spare copy of the metadata LV is 
created as well to aid in recovery.  Unfortunately, extending the metadata LV 
(either manually using lvextend or automatically using lvm.conf parameter 
thin_pool_autoextend_threshold) does not extend the spare.  This results in 
a mismatch in the size of the metadata LV and the spare, which prevents the 
ThinPool from being repaired: 

# lvs -a vg01 -o lv_name,vg_name,lv_attr,lv_size,pool_lv
  LV              VG   Attr       LSize  Pool
  lv01            vg01 Vwi-a-tz-- 10.00g pool01
  [lvol0_pmspare] vg01 ewi-------  4.00m        << 4m spare LV
					
  pool01          vg01 twi-aotz--  3.00g
  [pool01_tdata]  vg01 Twi-ao----  3.00g
  [pool01_tmeta]  vg01 ewi-ao----  4.00m        << 4m metadata LV
				

Extend the metadata LV: 

# lvextend -L+8M vg01/pool01_tmeta
  Size of logical volume vg01/pool01_tmeta changed from 4.00 MiB (1 extents) to 12.00 MiB (3 extents).
  Logical volume pool01_tmeta successfully resized# lvs -a vg01 -o lv_name,vg_name,lv_attr,lv_size,pool_lv
  LV              VG   Attr       LSize  Pool
  lv01            vg01 Vwi-a-tz-- 10.00g pool01
  [lvol0_pmspare] vg01 ewi-------  4.00m      << spare remains original size
					
  pool01          vg01 twi-aotz--  3.00g
  [pool01_tdata]  vg01 Twi-ao----  3.00g
  [pool01_tmeta]  vg01 ewi-ao---- 12.00m      << metadata LV has been extended
				

Test the repair procedure: 

# vgchange -an vg01
  0 logical volume(s) in volume group "vg01" now active
# lvconvert --repair vg01/pool01                                               

					Internal error: Missing allocatable pvs.
				

So the ThinPool metadata cannot be repaired. 
Answer/Solution
FIX:The "lvconvert --repair" process will re-create the spare metadata LV 
if it is missing.  So remove the spare: 

# lvremove vg01/lvol0_pmspare 
Removal of pool metadata spare logical volume "lvol0_pmspare" disables automatic recovery attempts after damage to a thin or cache pool. Proceed? [y/n]: y 

# lvs -a vg01 -o lv_name,vg_name,lv_attr,lv_size,pool_lv 
  LV             VG   Attr       LSize  Pool
  lv01           vg01 Vwi---tz-- 10.00g pool01
  pool01         vg01 twi---tz--  3.00g
  [pool01_tdata] vg01 Twi-------  3.00g
  [pool01_tmeta] vg01 ewi------- 12.00m

And repair will generate a new spare, correctly sized: 

# lvconvert --repair vg01/pool01
  WARNING: If everything works, remove "vg01/pool01_meta0".
  WARNING: Use pvmove command to move "vg01/pool01_tmeta" on the best fitting PV.

# lvs -a vg01 -o lv_name,vg_name,lv_attr,lv_size,pool_lv
  LV              VG   Attr       LSize  Pool
  lv01            vg01 Vwi---tz-- 10.00g pool01
  [lvol1_pmspare] vg01 ewi------- 12.00m     << new, correctly sized spare
					
  pool01          vg01 twi---tz--  3.00g
  pool01_meta0    vg01 -wi------- 12.00m
  [pool01_tdata]  vg01 Twi-------  3.00g
  [pool01_tmeta]  vg01 ewi------- 12.00m
					

					
# lvremove vg01/pool01_meta0                 << remove old metadata copy
  Logical volume "pool01_meta0" successfully removed

					
# lvs -a vg01 -o lv_name,vg_name,lv_attr,lv_size,pool_lv
  LV              VG   Attr       LSize  Pool
  lv01            vg01 Vwi---tz-- 10.00g pool01
  [lvol1_pmspare] vg01 ewi------- 12.00m
  pool01          vg01 twi---tz--  3.00g
  [pool01_tdata]  vg01 Twi-------  3.00g
  [pool01_tmeta]  vg01 ewi------- 12.00m

# vgchange -ay vg01
  2 logical volume(s) in volume group "vg01" now active
			

© Copyright 2015 Hewlett-Packard Development Company, L.P.

Legal Disclaimer: Products sold prior to the November 1, 2015 separation of Hewlett-Packard Company into Hewlett Packard Enterprise Company and HP Inc. may have older product names and model numbers that differ from current models.

Provide feedback

Please rate the information on this page to help us improve our content. Thank you!
Document title: Red Hat Enterprise Linux 7 - Cannot Repair LVM ThinPool Metadata Due to Mismatched Spare Metadata LV Size
Document ID: mmr_kc-0126722-5
How helpful was this document?
How can we improve this document?
Note: Only English language comments can be accepted at this time.
Please wait while we process your request.