1

I'm trying to grow a LVM logical volume, and resized the physical volume. Now, vgs shows free extents, but when I try to assign them to the logical volume with lvresize, it says 0 extents available.

Setup details

The system uses a btrfs, which is in a logical lvm volume inside of a physical LVM partition that is encrypted with LUKS. Originally, the whole file system was 1.35TB large, I now resized that to 1.45TB by growing the LUKS partition in gparted, then running pvresize to resize the physical LVM volume in it. Afterwards, trying to run lvresize to assign the space to the logical volume is where I failed.

Logs

recovery@recovery:~$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/mapper/luks-[some-id]
  VG Name               data
  PV Size               <1.46 TiB / not usable 3.00 MiB
  Allocatable           NO
  PE Size               4.00 MiB
  Total PE              382667
  Free PE               28001
  Allocated PE          354666
  PV UUID               [some-id]

recovery@recovery:~$ sudo pvs PV VG Fmt Attr PSize PFree
/dev/mapper/luks-[some-id] data lvm2 u-- <1.46t <109.38g recovery@recovery:~$ sudo vgdisplay --- Volume group --- VG Name data System ID
Format lvm2 Metadata Areas 1 Metadata Sequence No 9 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size <1.46 TiB PE Size 4.00 MiB Total PE 382667 Alloc PE / Size 354666 / 1.35 TiB Free PE / Size 28001 / <109.38 GiB VG UUID [some-id]

recovery@recovery:~$ sudo vgs VG #PV #LV #SN Attr VSize VFree
data 1 1 0 wz--n- <1.46t <109.38g recovery@recovery:~$ sudo lvdisplay --- Logical volume --- LV Path /dev/data/root LV Name root VG Name data LV UUID [some-id] LV Write Access read/write LV Creation host, time recovery, 2020-09-08 08:42:57 +0000 LV Status available

open 0

LV Size 1.35 TiB Current LE 354666 Segments 1 Allocation inherit Read ahead sectors auto

  • currently set to 256

Block device 253:1

recovery@recovery:~$ sudo lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root data -wi-a----- 1.35t

First attempt - resizing it to max available space - just doesn't change anything:

recovery@recovery:~$ sudo lvresize -l+100%FREE /dev/data/root
  Size of logical volume data/root unchanged from 1.35 TiB (354666 extents).
  Logical volume data/root successfully resized.

Attempts at manually resizing it say there are no extents available

recovery@recovery:~$ sudo lvresize -l+28001 /dev/data/root
  Insufficient free space: 28001 extents needed, but only 0 available
recovery@recovery:~$ sudo lvresize -L+100g /dev/data/root
  Insufficient free space: 25600 extents needed, but only 0 available

But the vgs and vgdisplay commands above clearly showed free available extents. Any ideas what could cause this and how I could fix this?

Heinzi
  • 201

1 Answers1

1

I found the solution here: lvm physical volume set not allocatable after server move to virtual machine. Can I change it?

In summary, for some reason that I don't understand, the physical volume got set to allocatable=NO and changing that to YES via the following and worked

$ sudo pvchange -x y /my/physical/volume
Heinzi
  • 201