ubuntu server how to xtend lv partition

  1. Check the size of your physical volume (PV) and volume group (VG) using sudo pvdisplay and sudo vgdisplay commands. Note the free space available in your VG.
  2. Extend your PV to use the extra disk space using sudo pvresize /dev/sda5 command. This will resize your PV to match the size of your partition /dev/sda5.
  3. Check the size of your LV using sudo lvdisplay command. Note the current size and path of your LV.
  4. Extend your LV to use the free space in your VG using sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv command. This will resize your LV to use all the available space in your VG.
  5. Resize the file system on your LV using sudo resize2fs /dev/ubuntu-vg/ubuntu-lv command. This will expand the file system to match the size of your LV.

You can verify the new size of your LV and file system using sudo lvdisplay and df -h commands. I hope this helps. 😊

Leave a Reply