Python Errno 28 No space left on device

zelinka picture zelinka · May 23, 2013 · Viewed 7.3k times · Source

I have a simple python program:

#!/usr/bin/python
fo = open("foo.txt", "w")
fo.write( "blah\n");
fo.close() #line 4

Running this program produces this:

./result.py
Traceback (most recent call last):
  File "./result.py", line 4, in <module>
    fo.close()
IOError: [Errno 28] No space left on device

The computer is definitely not out of space. Another post mentioned checking the inode count, and that is also nowhere near the max.

Answer

punkrockpolly picture punkrockpolly · Mar 31, 2018

Are you using Docker?

Docker leaves dangling images around that can take up your space. To clean up after docker, run the following:

docker rm $(docker ps -q -f 'status=exited')
docker rmi $(docker images -q -f "dangling=true")

This will remove exited and dangling images, which hopefully clears out device space.