Python Errno 28设备上没有剩余空间

时间:2013-05-22 23:05:48

标签: python ioerror

我有一个简单的python程序:

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

运行此程序会产生以下结果:

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

计算机绝对没有空间。另一篇文章提到检查inode计数,这也是最大的。

1 个答案:

答案 0 :(得分:0)

您使用的是Docker吗?

Docker留下悬空图像可以占用你的空间。要在docker之后清理,请运行以下命令:

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

这将删除已退出和悬空的图像,这有望清除设备空间。