DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on • Edited on

Extend Disk Size - The Default Ubuntu LVM Partition

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

cfdisk
Enter fullscreen mode Exit fullscreen mode

You must see free space.

  • Select /dev/sda3, then from the bottom choose the option to resize, then it will show space, just press enter

  • Then, from bottom choose option write and type yes to confirm

  • Then, from bottom choose option quite

  • Run pvresize /dev/sda3

  • Check the free space:

sudo vgdisplay
Enter fullscreen mode Exit fullscreen mode

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

  • 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.

  • 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)