fwrite(): write of 540 bytes failed with errno=28 No space left on device or /dev/vda1 is 100% Used

Updated: Apr 02, 2022

If you get any error like below

Follow this tutorial to fix the issue.

First check for available left and which partition is filled up by using the following command:

df -h

The output would look something like this:

Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           395M  1.8M  393M   1% /run
/dev/vda1        25G   20G  4.4G  82% /

Then depending on the partition which is filling up you could use the following command to find any files that are larger than 500MB for example:

sudo find / -type f -size +500M -exec ls -lh {} \;


The output should look something like this:

-rw-r--r-- 1 root root 1.8G May 13 15:43 /home/user1/large-file.txt
-rw-r--r-- 1 root root 1.8G May 13 15:42 /home/bobby/large-file.txt


If there are no large files found then there is a chance that a lot of small files are using all this space, what you could do is use the ducommand which will get the file space usage:

du -h --max-depth=1 /

Repeat that for the respective subdirectories (e.g. du -hx --max-depth=1 /dev) until you reach those directories which contain much data.

Finally, you can delete that folder if that folder in not important by using below command

sudo rm -R /folder_name