How do I extend my disk space?
Overview
In some Ubuntu installations, you might notice that not all of your disk space is being utilized. This can happen if your system's logical volume isn't taking advantage of all the available space. In this tutorial, we'll show you how to extend your disk space using a few simple commands via SSH.
This guide is specifically for Ubuntu installations.
1. Log in via SSH
First, log in to your server using SSH. You can do this using an SSH client like ssh from your terminal:
ssh username@your-server-ip
Replace username with your actual username and your-server-ip with your server's IP address.
2. Extend the Logical Volume
To make all the free space available to your system, run the following command:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
This command extends the logical volume to use all the remaining free space on the physical volume.
3. Resize the Filesystem
Next, resize the filesystem to ensure it can use the newly extended space:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
This command resizes the filesystem on the logical volume to fill the newly available space.
4. Reboot the Server
Finally, reboot your server to apply the changes:
sudo reboot
Conclusion
Your disk space should now be fully extended and available for use. If you encounter any issues or if anything is unclear, feel free to submit a support ticket, and we'll be happy to assist you.
Updated on: 08/08/2024
Thank you!