Question

"No space left on device" error when there should be space

Hi, I have a droplet that has been collecting some data for me, I now want to run a python script, which fails as follows:

out = open('data.tsv', 'w')
IOError: [Errno 28] No space left on device: '/data.tsv'

The problem is, I think there should be plenty of space. Running df -h produces the following:


Filesystem                 Size  Used Avail Use% Mounted on
udev                       235M  4.0K  235M   1% /dev
tmpfs                       50M  344K   49M   1% /run
/dev/disk/by-label/DOROOT   20G  6.8G   12G  37% /
none                       4.0K     0  4.0K   0% /sys/fs/cgroup
none                       5.0M     0  5.0M   0% /run/lock
none                       246M     0  246M   0% /run/shm
none                       100M     0  100M   0% /run/user
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Occasionally, a file will be deleted, but a process is still using it. Linux won’t release the storage associated with the file while the process is still running. You just need to find the process and restart it.

Try to locate the process.

sudo lsof / | grep deleted

The problematic process should be listed, then just restart it.

sudo systemctl restart service_name

If this doesn’t help, then I’ll recommend trying to reboot the droplet and see what happens.

Occasionally, a file will be deleted, but a process is still using it. Linux won’t release the storage associated with the file while the process is still running. You just need to find the process and restart it.

Try to locate the process.

sudo lsof / | grep deleted

The problematic process should be listed, then just restart it.

sudo systemctl restart service_name

If this doesn’t help, then I’ll recommend trying to reboot the droplet and see what happens.

Actually, I believe this may be an issue of you telling it to delete files, but the system hasn’t actually done so, but the pointers are gone.

Run this:

lsof|grep delete

If you see a lot of things return, the simplest solution would be to reboot. It will clear up those files when it restarts.