DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on • Edited on

Extend the Default Ubuntu LVM Partition

Reference: https://www.youtube.com/watch?v=58m0hnt0ij8

1. Check the free space:

sudo vgdisplay
Enter fullscreen mode Exit fullscreen mode

Pay attention to Free PE / Size that is the available free space.

2. Check partitions

df -h
Enter fullscreen mode Exit fullscreen mode

The default partition will be something like /dev/mapper/ubuntu--vg-ubuntu--lv, note the current Available Space.

3. Extend

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Enter fullscreen mode Exit fullscreen mode
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
Enter fullscreen mode Exit fullscreen mode

Check extended size:

df -h
Enter fullscreen mode Exit fullscreen mode

Top comments (0)