在 aws 上编译 lxml,现在了硬盘不够用的问题。之前清理过,但是命令什么都忘了,便想写个笔记记录一下,这个no space left on devices
。
testapi.c:52172:1: fatal error: error writing to /tmp/cc7IY2vY.s: No space left on device
}
^
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [testapi.o] Error 1
make[2]: Leaving directory `/root/libxml2-2.9.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libxml2-2.9.2'
make: *** [all] Error 2
查看磁盘空间
(play-env)➜ libxml2-2.9.2 df -alh
Filesystem Size Used Avail Use% Mounted on
rootfs - - - - /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devtmpfs 491M 56K 491M 1% /dev
devpts 0 0 0 - /dev/pts
tmpfs 499M 0 499M 0% /dev/shm
/dev/xvda1 16G 16G 0 100% /
none 0 0 0 - /proc/sys/fs/binfmt_misc
查看每个目录的情况
(play-env)➜ /usr du -ah --max-depth=1
0 ./tmp
544M ./share
431M ./lib
4.0K ./etc
2.4G ./local
31M ./sbin
625M ./lib64
165M ./include
220M ./src
4.0K ./games
571M ./bin
69M ./libexec
5.0G .
找到根源:
➜ wwwlogs du -ah --max-depth=1
800K ./report.html
4.0K ./.goaccessrc
12K ./goaccess.conf
0 ./report.csv
8.1M ./xz.phodal.net.log
480K ./report.json
860M ./blog.phodal.com.log
2.1M ./leanjs.net.log
2.1M ./nginx_error.log
860M ./www.hug8217.com.log
3.4M ./b.phodal.com.log
2.5G ./access.log
4.2G .
然后就是:rm -rf xxx.log
释放 rm rf 空间
可是这并没有删除文件,空间还是没有增多,必须再执行:
sudo /usr/sbin/lsof | grep deleted
可问题没有解决:
➜ wwwlogs df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 16G 16G 171M 99% /
devtmpfs 491M 56K 491M 1% /dev
tmpfs 499M 0 499M 0% /dev/shm
因为 Nginx 并没有结束,因此需要重启,才能释放它所占用的空间:
➜ wwwlogs /etc/init.d/nginx restart
Stoping nginx... done
Starting nginx... done
➜ wwwlogs df -alh
Filesystem Size Used Avail Use% Mounted on
rootfs - - - - /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devtmpfs 491M 56K 491M 1% /dev
devpts 0 0 0 - /dev/pts
tmpfs 499M 0 499M 0% /dev/shm
/dev/xvda1 16G 12G 4.3G 73% /
none 0 0 0 - /proc/sys/fs/binfmt_misc
围观我的Github Idea墙, 也许,你会遇到心仪的项目