Adding unused disk space for file system Ubuntu Server

Installing Ubuntu Server with default settings makes OS use only 100 GB of our disk. If you didn't resize the volume to the operating system during installation, don't worry. You can solve this problem with a few commands. Enjoy reading!



First of all - check your drives with below command. We can see in this case that 100GB is allocated for system and rest of those 929GB part is unused:
lsblk



Checking system memory availability shows that 92% of memory is in use, but we've got only 98GB here:
df -hT /dev/mapper/ubuntu--vg-ubuntu--lv



Just in case you can run test for resizing:
sudo lvresize -tvl +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv



If everything went well start the real resize of logical volume. You shouldn’t loose any data, but of course you can do a backup just in case.
sudo lvresize -vl +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv



Now resize the filesystem accordingly to logical volume size:
sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv



Check if resized:
df -hT /dev/mapper/ubuntu--vg-ubuntu--lv


Popular posts

Basic AKHQ running with docker (HTTP)

AKHQ login with Keycloak

Running keycloak in 4 minutes for development on Windows