一.问题描述
今天处理了一例No space left on device,我通过df -h看到,磁盘空间并没有满,真的是奇了怪了。
[17:18:11] mydb>touch a.txt [17:18:11] touch: cannot touch `a.txt': No space left on device [root@mydb tmp]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 296G 123G 158G 44% / tmpfs 7.8G 8.0K 7.8G 1% /dev/shm /dev/mapper/vg_jndg-lv_jndg1 975G 484G 442G 53% /oracle
复制
二.解决方案
在网上找了一下,通过df -i来查看,df -i 显示inode信息。
inode包含的信息:文件的字节数,拥有者id,组id,权限,改动时间,链接数,数据block的位置。相反是不表示文件大小。这就是为什么df -h和df -i 显示的结果是不一样的原因。
在df -h 和df -i 显示使用率100%,基本解决方法都是删除文件。
df -h 是去删除比较大无用的文件-----------大文件占用大量的磁盘容量。
df -i 则去删除数量过多的小文件-----------过多的文件占用了大量的inode号。
[root@mydb tmp]# [root@mydb tmp]# [root@mydb tmp]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vda1 19660800 19660800 0 100% / tmpfs 2041687 3 2041684 1% /dev/shm /dev/mapper/vg_jndg-lv_jndg1 64880640 1525410 63355230 3% /oracle [root@mydb tmp]#
复制
我开始删除一些小日志文件,结果问题依旧。
然后我看了下sendmail的服务,居然有上千个进程
ps aux | grep sendmail* root 32380 0.0 0.0 83060 92 ? S May25 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32392 0.0 0.0 83060 84 ? S May23 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32407 0.0 0.0 83060 52 ? S Apr28 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32411 0.0 0.0 83060 20 ? S May11 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32425 0.0 0.0 83060 892 ? S May17 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32434 0.0 0.0 83060 44 ? S May07 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32455 0.0 0.0 83060 80 ? S May21 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32456 0.0 0.0 83060 36 ? S May01 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32462 0.0 0.0 83060 900 ? S Jun01 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32470 0.0 0.0 83060 908 ? S 10:20 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32477 0.0 0.0 83060 88 ? S May23 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32488 0.0 0.0 83060 540 ? S May13 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root oracle 32489 0.0 0.0 83060 888 ? S May13 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32491 0.0 0.0 83060 196 ? S May26 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32497 0.0 0.0 83060 896 ? S Apr29 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32507 0.0 0.0 83060 888 ? S May31 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32519 0.0 0.0 83060 28 ? S Apr25 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32520 0.0 0.0 83060 904 ? S Jun04 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32528 0.0 0.0 83060 36 ? S May01 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32530 0.0 0.0 83060 56 ? S May17 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32541 0.0 0.0 83060 892 ? S May05 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32559 0.0 0.0 83060 152 ? S May26 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32560 0.0 0.0 83060 924 ? S 16:20 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32590 0.0 0.0 83060 900 ? S May31 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32601 0.0 0.0 83060 892 ? S May03 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32611 0.0 0.0 83060 892 ? S May29 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32617 0.0 0.0 83060 76 ? S May17 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32624 0.0 0.0 83060 904 ? S Jun04 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32630 0.0 0.0 83060 64 ? S May13 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32659 0.0 0.0 83060 172 ? S May26 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32684 0.0 0.0 83060 52 ? S May26 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32686 0.0 0.0 83060 228 ? S May13 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root root 32712 0.0 0.0 83060 908 ? S Jun05 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
复制
不知道为什么有这么多的sendmail服务,直接进行kill吧
ps -aux | grep sendmail* | awk '{print $2}' | xargs kill -9
复制
删除部分小文件、杀掉部分进程后,依旧存在问题
最后想到的只有重启了
reboot
复制
重启耗时了1个多小时才启动成功,当然重启后,问题得到了解决
[root@mydb ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vda1 19660800 77284 19583516 1% / tmpfs 2041687 1 2041686 1% /dev/shm /dev/mapper/vg_jndg-lv_jndg1 64880640 1525419 63355221 3% /oracle
复制
参考:
- https://blog.csdn.net/youmatterhsp/article/details/80382552
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
TA的专栏
目录