Resize LVM partition?

ncage

Member
Jan 28, 2022
8
0
6
50
I'm in the process of upgrading my last node in my 3 node cluster from V8 to V9. Unfortunately I hit an issue. When running `pve8to9`
Code:
WARN: Less than 5 GB free space on root file system, upgrade may fail.
.

I am a newbie at lvm & want to make sure i don't mess this up.


Code:
df -h
/dev/mapper/pve-root          ext4       14G  8.6G  4.1G  68% /

It looks like i created both the root & swap partition with a volume group. So i need to expand the size of my root partition.

It looks like I originally created the volume group at about 31GB:
Code:
vgdisplay
  --- Volume group ---
  VG Name               pve
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <31.00 GiB
  PE Size               4.00 MiB
  Total PE              7935
  Alloc PE / Size       4447 / 17.37 GiB
  Free  PE / Size       3488 / 13.62 GiB
  VG UUID               HTqo01-FKDy-DvAE-qZiF-wOLx-8lww-YYfmAD

Code:
lvdisplay
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                bZUdJs-SEFK-KQhd-ELZT-mVLD-9TKa-85R8yY
  LV Write Access        read/write
  LV Creation host, time proxmox, 2024-03-15 15:49:10 -0500
  LV Status              available
  # open                 2
  LV Size                3.75 GiB
  Current LE             960
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                ZvGuU2-DF8p-Cjsw-EeS4-oZ3p-Y2n4-0XGjN7
  LV Write Access        read/write
  LV Creation host, time proxmox, 2024-03-15 15:49:10 -0500
  LV Status              available
  # open                 1
  LV Size                13.62 GiB
  Current LE             3487
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

The lvm group is on a single disk with plenty of disk space available:
1755530659051.png

The best option would probably be to expand the volume group to maybe 50GB but since there is space available in the volume group but for now just increasing the size of the root partition is probably ok for now. So i could run:

Code:
lvextend -l +3488  /dev/pve/root

& after that i just need to resize the partition with `resize2fs`?

QUESTIONS:

I have heard you should also increase the lvm metadata size? If so how much should increase it by? Then i would of course have to reduce how much i'm giving the root partition. Can you see anything else i'm not doing right?
 
Your storage layout is very strange. Your whole VG is only used 33GB~ and I see no data pool. What did you select in the installer and why?
Please share this
Bash:
lsblk -o+FSTYPE
pvs
vgs
lvs
Unless I see that I have to make certain assumptions.
Run cfdisk /dev/sdb and extend sdb3. Afterwards you can resize the PV on it with pvresize /dev/sdb3 and then the root LV with lvresize -r -L +5G /dev/pve/root. That resizes the file system as well. Leave at least 10% or so free/unallocated in the VG.
 
Last edited: