¿Qué me impide extender un volumen lógico LVM?

¿Qué me impide extender un volumen lógico LVM?

Transferí una partición LVM-on-LUKS desde mi vieja computadora y casi logré cambiar su tamaño para usar los 223 GB.

Es una instalación típica de Ubuntu con dos particiones LVM:

~# lsblk

...
└─sda5                                          8:5    0   223G  0 part  
  └─luks-a8df437a-7906-4574-a6ff-16e337f8cb19 252:0    0   223G  0 crypt 
    ├─szop--vg-root                           252:1    0 146.6G  0 lvm   
    └─szop--vg-swap_1                         252:2    0     2G  0 lvm   
...

También tengo PV y VG que ocupan el tamaño completo:

~# pantalla pv

  --- Physical volume ---
  PV Name               /dev/mapper/luks-a8df437a-7906-4574-a6ff-16e337f8cb19
  VG Name               szop-vg
  PV Size               223.04 GiB / not usable 1.84 MiB
  Allocatable           NO
  PE Size               4.00 MiB
  Total PE              57097
  Free PE               19064
  Allocated PE          38033
  PV UUID               oxRbRw-P8xz-wTM9-1p1n-UkP7-zknB-31AHLR

~#vgdisplay

  --- Volume group ---
  VG Name               szop-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  20
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               223.04 GiB
  PE Size               4.00 MiB
  Total PE              57097
  Alloc PE / Size       38033 / 148.57 GiB
  Free  PE / Size       19064 / 74.47 GiB
  VG UUID               IFezjq-rKPJ-Ydko-JV9P-l8RM-4oX8-Tijx9w

Hay dos LV para esta instalación típica de Ubuntu:

~# lvdisplay

  --- Logical volume ---
  LV Path                /dev/szop-vg/root
  LV Name                root
  VG Name                szop-vg
  LV UUID                a7BeRt-5STg-gbsr-cBES-h2q8-P0yT-nuK2Ic
  LV Write Access        read/write
  LV Creation host, time szop, 2016-08-07 16:39:48 +0000
  LV Status              available
  # open                 0
  LV Size                146.59 GiB
  Current LE             37528
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Path                /dev/szop-vg/swap_1
  LV Name                swap_1
  VG Name                szop-vg
  LV UUID                On2jUZ-UTqF-3AxH-YkVq-DYPn-dbUA-2cq3iy
  LV Write Access        read/write
  LV Creation host, time szop, 2016-08-07 16:39:49 +0000
  LV Status              available
  # open                 0
  LV Size                1.97 GiB
  Current LE             505
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

Me gustaría cambiar el tamaño de la partición raíz para usar algo de espacio restante:

~# lvresize -L +10G /dev/mapper/szop--vg-root

  Insufficient free space: 2560 extents needed, but only 0 available

¿Por qué recibo este error?

Respuesta1

Necesitaba marcar mi PV Allocatable yesusando pvchange:

~# pvchange -xy /dev/mapper/szop--vg-root

Physical volume "/dev/mapper/luks-a8df437a-7906-4574-a6ff-16e337f8cb19" changed
1 physical volume changed / 0 physical volumes not changed

Después de esto pude cambiar el tamaño de mi LV con éxito.

información relacionada