1:在终端中运行cd命令,提示:
e: Write error - write (28 No space left on device) E: Cant mmap an empty file |
2:使用 df -h 查看磁盘空间情况:
/dev/xvda1 20G 20G 0G 100% / |
3:继续查看大文件所在目录:#du --max-depth=1 -h /
4.0K /opt 9.6M /bin 408K /run 4.0K /srv 4.0K /lib64 0 /sys 9.0M /sbin 34M /boot 224K /home 4.0K /dev du: cannot access ‘/proc/31292/task/31292/fd/4’: No such file or directory du: cannot access ‘/proc/31292/task/31292/fdinfo/4’: No such file or directory du: cannot access ‘/proc/31292/fd/4’: No such file or directory du: cannot access ‘/proc/31292/fdinfo/4’: No such file or directory 0 /proc 284M /lib 80K /tmp 13G /root 4.0K /media 1.3G /mnt 1.2G /usr 16K /lost+found 5.2G /var 6.1M /etc 21G / |
可见 /root下面存在大文件,继续查看:#du --max-depth=1 -h /root
8.0K /root/.ssh 13G /root/.pm2 6.0M /root/.forever 17M /root/.npm 4.0K /root/.cache 13G /root |
可见,大文件在.pm2下面,进入此目录进行查看:pm2# ll
total 13326616 drwxr-xr-x 4 root root 4096 May 11 21:20 ./ drwx------ 7 root root 4096 Aug 22 08:35 ../ -rw-r--r-- 1 root root 1561 Jun 20 2015 conf.js -rw-r--r-- 1 root root 22557 Apr 19 00:28 dump.pm2 drwxr-xr-x 2 root root 4096 Apr 21 08:37 logs/ -rw-r--r-- 1 root root 2 Jun 20 2015 module_conf.json drwxr-xr-x 2 root root 4096 Aug 22 08:38 pids/ -rw-r--r-- 1 root root 13646360576 Aug 22 08:38 pm2.log -rw-r--r-- 1 root root 5 May 11 21:20 pm2.pid srwxr-xr-x 1 root root 0 May 11 21:20 pub.sock= srwxr-xr-x 1 root root 0 May 11 21:20 rpc.sock= |
发现pm2.log日志文件为13G,将其删除。