Missing storage space?

Have you ever ran out of storage only to find out that you should have more space available you? Your output of df -h might have looked something like this.

Filesystem      Size  Used Avail Use% Mounted on
udev            956M 	 0  965M   0% /dev
tmpfs         	197M  428K  197M   1% /run
/dev/vda2       1007G 956G     0 100% /
tmpfs           984M     0  984M   0% /dev/shm
tmpfs           5,0M     0  5,0M   0% /run/lock
tmpfs           197M     0  197M   0% /run/user/1000

For this example, we will use one of our 1024G storage plans. You might face this issue on any size of plan however it becomes more noticeable the more storage you have. As you can see from the sniped above, the system indicates 100% of the space on the disk is used, even though, there should be at least 50GB more available. In this article, we will let you know what's causing this and how to resolve it.

First, you can check if the size of the block storage allocated to your VPS is the correct size. You can do this by running the command fdisk -l You will get an output similar to this:

Disk /dev/vda: 1 TiB, 1099511627776 bytes, 2147483648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EACB65FD-0385-4A1B-91E3-063390A8BF58

Device          Start        End    Sectors  Size Type
/dev/vda1        2048       4095       2048    1M BIOS boot
/dev/vda2        4096 2145383935 2145379840 1023G Linux filesystem
/dev/vda3  2145383936 2147481087    2097152    1G Linux swap

As you can see the size of the block itself is 1024GB so what gives? The 'issue' is actually a default Linux behavior. By default, 5% of the storage space is reserved for privileged processes to ensure that the system doesn't crash even if all the space is taken up. This, however, can be as much as 50GB when your disk is 1024GB.

Running out of space can be frustrating, especially when managing large datasets or backups. If you find yourself constantly battling disk usage, consider upgrading to one of our AlphaVPS Storage VPS plans. They’re optimized for mass storage, high I/O performance, and full filesystem control, making them ideal for exactly these kinds of scenarios.

To reduce the size of the reserved space you can run the command tune2fs -m 0.5 /dev/vda2 which will make the system reserve only 0.5% or 5GB

If you want to have a more detailed look at the block of size and other stats of the partition you can use the command tune2fs -l /dev/vda2