Skip to content

Resize LVM storage ubuntu

Tested on ubuntu 2404

Fdisk

Using sudo fdisk -l to find the right device.

fdisk /dev/sda
* d
* enter
* n
* enter
* enter
* enter
* N
* p
* w

And reboot before resizing LVM

Resize LVM

Display lvm infos

sh
lsblk /dev/sda

then

sh
sudo pvresize /dev/sda3
sudo lvextend -l +100%FREE -r /dev/mapper/ubuntu--vg-ubuntu--lv

This can take a while, be patient and do not kill the vm during the process.

-l adds GB to the volume -r extends the filesystem

check using sudo vgs or df -hPT

References