How to Expand Your Storage in Linux Ubuntu Server
You can expand the root filesystem to utilize the remaining space in the volume group. Here’s how you can do it:
Expand the logical volume to use the free space:
If there is free space in the volume group, you can extend the logical volume. For example, to extend the root logical volume to use all available space, run:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Resize the filesystem:
After extending the logical volume, you need to resize the filesystem to make use of the newly allocated space. If you’re using ext4 (which is common), you can resize it with:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
Verify the new size:
Finally, verify that your root partition has expanded:
df -h
Summary
You have successfully expanded the root filesystem in your Linux Ubuntu server to utilize the maximum available space. This process involves extending the logical volume and resizing the filesystem accordingly. Always ensure you have backups before performing disk operations to prevent data loss.