# To extend the logical volume, use the lvextend command. But first, get the mount point of the logical volume using the lvdisplay command: sudo lvdisplay # logical volumes info output on linux From the lvdisplay output, you can see that the disk is mounted on the path /dev/ubuntu-vg/ubuntu-lv. # Next, increase the logical volume space using the following command: sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv # 100% means using up the entire space, so assign the required percentage according to your needs, e.g. 50%, 60%, etc. # For the changes to take effect you also need to resize the file system comprising the logical volume. Get the file system path from the df -h command; in this case, it is /dev/mapper/ubuntu--vg-ubuntu--lv. sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv # Now if you run the df -h command again, you will see that your root drive has increased in size.
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter