How to Fix “No Space Left on Device” on a Contabo VPS Without Deleting Files
Why your Linux server shows 100% disk usage even after a storage upgrade—and how to claim your missing gigabytes in under 5 minutes.
Running a server update only to be blocked by a flashing No space left on device error is a rite of passage for sysadmins. But on a Contabo VPS, this issue often comes with a confusing twist: you know you paid for a larger disk, but the operating system insists it is completely full.
If you run lsblk and notice that your physical disk (e.g., 800 GB) is much larger than your root partition (e.g., 198 GB), you don’t need to delete your data. You just need to tell Linux to use the unallocated space.
Here is exactly how to break out of the 99% disk utilization trap, install the necessary expansion tools when you have zero room to breathe, and safely scale your filesystem online.
Partition Space Check
To figure out exactly which partition needs to be expanded, you need to compare what the hardware sees versus what the operating system filesystem actually sees.
You can determine this quickly using two standard terminal commands.
Step 1: Check the Operating System View (df -h)
Run the disk-free command to see which partition is running out of space or locked at 100%:
df -h
Look for the line where the Mounted on column is exactly a single forward slash (/). This is your root filesystem.
Filesystem column: Tells you the logical name (e.g., /dev/sda1 or /dev/vda1).
Size column: This will likely show your old size (e.g., 193G), confirming that the OS hasn’t claimed the new space yet.
Step 2: Check the Physical Hardware View (lsblk)
Run the block devices command to see the actual raw disk size provided by Contabo:
lsblk
This prints a visual tree layout of your storage hierarchy:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 800G 0 disk
└─sda3 8:1 0 193G 0 part /
The Catch-22: You Need Space to Install the Expansion Tool
To expand your drive, you need a utility called growpart. However, if your drive is at 100% capacity, running apt install will immediately fail. You must create a tiny bit of temporary breathing room first.
Step 1: Clear the APT Cache and System Logs
Safely dump cached package files and old system logs to free up a few gigabytes:
apt-get clean
journalctl --vacuum-time=1d
Verify you have at least a small cushion of space by checking your drive:
df -h /
Claiming Your Missing Storage
Once you have a few gigabytes of free space, you can install the automation utilities and expand your partition map.
Step 2: Install the Cloud Guest Utilities
Install the package that contains the partition resizing tools:
apt update && apt install -y cloud-guest-utils
Step 3: Grow the Partition Layout
Tell the system to expand your root partition (sda3 in most Contabo environments) to fill the remainder of the disk (sda).
growpart /dev/sda 3
(Note: Ensure there is a space between the disk name sda and the partition number 3).
Step 4: Resize the Live Filesystem
Growing the partition changes the boundary, but the filesystem inside it doesn’t know it yet. Run an online resize to stretch the filesystem to the new partition edges without unmounting your drive or losing data:
resize2fs /dev/sda3
Verifying the Fix
To confirm that your server successfully claimed the rest of your storage, check your root directory usage one last time:
df -h /
Your capacity should instantly jump to reflect your full allocation (e.g., from ~194G to ~785G), dropping your critical disk usage percentage down to a healthy fraction of what it was. With hundreds of gigabytes of fresh headroom, you can now safely run your system updates (apt upgrade) and ensure your mail servers or database applications run smoothly.



