0

I have an LVM VG with a single LV that is a raid5 volume with three PVs. I would like to add an additional PV to the volume group and extend the raid5 LV to use it.

Here I am using 4 100MB files as test disks to practice.

$ sudo vgs
  WARNING: Not using lvmetad because a repair command was run.
  VG     #PV #LV #SN Attr   VSize   VFree 
  testvg   4   1   0 wz--n- 384.00m 96.00m
$ sudo pvs
  WARNING: Not using lvmetad because a repair command was run.
  PV           VG     Fmt  Attr PSize  PFree 
  /dev/loop0p1 testvg lvm2 a--  96.00m     0 
  /dev/loop1p1 testvg lvm2 a--  96.00m     0 
  /dev/loop2p1 testvg lvm2 a--  96.00m     0 
  /dev/loop3p1 testvg lvm2 a--  96.00m 96.00m
$ sudo lvs
  WARNING: Not using lvmetad because a repair command was run.
  LV       VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  testraid testvg rwi-a-r--- 184.00m                                    100.00    

If I try changing the number of stripes to bring in the additional disk, the command returns errors but the new PV now shows subLVs, and the LV shows increased space available. But the subLVs show an out-of-sync attribute, and running a repair on the LV fails.

$ sudo lvconvert --stripes 3 /dev/testvg/testraid
  Using default stripesize 64.00 KiB.
  WARNING: Adding stripes to active logical volume testvg/testraid will grow it from 46 to 69 extents!
  Run "lvresize -l46 testvg/testraid" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5 LV testvg/testraid? [y/n]: y
  Insufficient free space: 4 extents needed, but only 0 available
  Failed to allocate out-of-place reshape space for testvg/testraid.
  Insufficient free space: 4 extents needed, but only 0 available
  Failed to allocate out-of-place reshape space for testvg/testraid.
  Reshape request failed on LV testvg/testraid.
$ sudo pvs -a -o +pv_pe_count,pv_pe_alloc_count
  PV                    VG     Fmt  Attr PSize  PFree PE  Alloc
  /dev/loop0p1          testvg lvm2 a--  96.00m    0   24    24
  /dev/loop1p1          testvg lvm2 a--  96.00m    0   24    24
  /dev/loop2p1          testvg lvm2 a--  96.00m    0   24    24
  /dev/loop3p1          testvg lvm2 a--  96.00m    0   24    24
$ sudo lvs -a
  LV                  VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  testraid            testvg rwi-a-r--- 276.00m                                    100.00          
  [testraid_rimage_0] testvg iwi-aor---  92.00m                                                    
  [testraid_rimage_1] testvg iwi-aor---  92.00m                                                    
  [testraid_rimage_2] testvg iwi-aor---  92.00m                                                    
  [testraid_rimage_3] testvg Iwi-aor---  92.00m                                                    
  [testraid_rmeta_0]  testvg ewi-aor---   4.00m                                                    
  [testraid_rmeta_1]  testvg ewi-aor---   4.00m                                                    
  [testraid_rmeta_2]  testvg ewi-aor---   4.00m                                                    
  [testraid_rmeta_3]  testvg ewi-aor---   4.00m 
$ sudo lvconvert --repair /dev/testvg/testraid 
  WARNING: Not using lvmetad because of repair.
  Active raid has a wrong number of raid images!
  Metadata says 4, kernel says 3.
Attempt to replace failed RAID images (requires full device resync)? [y/n]: y
  WARNING: Disabling lvmetad cache for repair command.
  Unable to repair testvg/testraid.  Source devices failed before the RAID could synchronize.
  You should choose one of the following:
    1) deactivate testvg/testraid, revive failed device, re-activate LV, and proceed.
    2) remove the LV (all data is lost).
    3) Seek expert advice to attempt to salvage any data from remaining devices.
  Failed to replace faulty devices in testvg/testraid.

What steps should I take to grow my LV by an additional identical disk?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.