3

This is my output of lsblk:

 lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0  63.3M  1 loop /snap/core20/1828
loop1          7:1    0  63.3M  1 loop /snap/core20/1852
loop2          7:2    0  67.2M  1 loop /snap/lxd/21835
loop3          7:3    0  91.9M  1 loop /snap/lxd/24061
loop4          7:4    0  49.9M  1 loop /snap/snapd/18357
loop5          7:5    0  49.9M  1 loop /snap/snapd/18596
loop6          7:6    0   3.1G  0 loop /var/tmp
sda            8:0    0   155G  0 disk
├─sda1         8:1    0   1.1G  0 part /boot/efi
└─sda2         8:2    0 138.7G  0 part
  └─vg0-root 253:0    0    74G  0 lvm  /
sr0           11:0    1  1024M  0 rom

but when I want to increase lvm size to max of sda2 it shows Nothing to do message:

root:~# sudo lvresize -tvl +100%FREE /dev/mapper/vg0-root
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Converted 100%FREE into at most 0 physical extents.
  New size (18930 extents) matches existing size (18930 extens).

root:~# sudo lvresize -vl +100%FREE /dev/mapper/vg0-root
  Converted 100%FREE into at most 0 physical extents.
  New size (18930 extents) matches existing size (18930 extents).
root:~# sudo resize2fs -p /dev/mapper/vg0-root

resize2fs 1.45.5 (07-Jan-2020)
The filesystem is already 19384320 (4k) blocks long.  Nothing to do!

output of vgdisplay:

# vgdisplay
  --- Volume group ---
  VG Name               vg0
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <73.95 GiB
  PE Size               4.00 MiB
  Total PE              18930
  Alloc PE / Size       18930 / <73.95 GiB
  Free  PE / Size       0 / 0
  VG UUID               anzb9z-z1ML-h0xn-21Eq-WvLn-Pgpl-NwH5OR

updated:

pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg0
  PV Size               <73.95 GiB / not usable 2.98 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              18930
  Free PE               0
  Allocated PE          18930
  PV UUID               SiNEeE-3Wjm-ZrrC-cTji-9Tzc-DZtw-bWLW4O
0

1 Answer 1

7

You need to resize the PV:

sudo pvresize /dev/sda2

The partition has been enlarged, but the PV isn’t aware of it, so LVM can’t use the additional room.

Once that’s done, the VG will show free space, and you’ll be able to resize the LV.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.