gcc: No space left on device?

一曲冷凌霜 提交于 2019-12-21 19:21:31

问题


I'm trying to make some C code with a simple gcc command in Ubuntu 10, but for some reason, I keep getting an error:

Cannot create temporary file in /tmp/: No space left on device

The thing is, though, I have plenty of space on the disk. Here is output of df -h:

Filesystem            Size  Used Avail Use% Mounted on
/                     3.7G  2.4G  1.1G  70% /
devtmpfs              312M  112K  312M   1% /dev
none                  312M   24K  312M   1% /dev/shm
none                  312M   80K  312M   1% /var/run
none                  312M     0  312M   0% /var/lock
none                  312M     0  312M   0% /lib/init/rw

And df -i, in case you are wondering about the inodes:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/                     240960  195198   45762   82% /
devtmpfs               79775     609   79166    1% /dev
none                   79798       3   79795    1% /dev/shm
none                   79798      41   79757    1% /var/run
none                   79798       2   79796    1% /var/lock
none                   79798       1   79797    1% /lib/init/rw

I can also touch /tmp/test successfully, so I know I have space on the drive. Any ideas as to why gcc decided to throw a fit all of a sudden? (It was working earlier) Thanks beforehand.


回答1:


It looks to me that your /tmp directory is actually mounted as a devtmpfs which if I remember correctly is actually your computer's RAM.

You can always reboot and see if that helps, increase your virtual memory partition, or you can close running programs to see if that helps. Additionally, you can maybe delete some unnecessary files from /tmp as they are volatile to at least the life of the session.




回答2:


The intermediate files are too big for /tmp, so perhaps using another temporary directory (TMPDIR=/var/tmp g++ ...) helps.



来源:https://stackoverflow.com/questions/14693131/gcc-no-space-left-on-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!