Skip to main content

How to Expand Your Storage in Linux Ubuntu Server

· 2 min read
Jagdish Kumawat
Founder @ Dewiride

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

Sample Output

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

Sample Output

Verify the new size:

Finally, verify that your root partition has expanded:

df -h

Sample Output

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.

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.