原创

du 跟 df 显示不一致

前言

最近清理服务器内存,发现一个问题。du -ah -d 1显示的大小跟 df -h显示的大小不一致

解决

[root@sjvcsp85 /]# lsof | grep deleted
redis-ser  3361                 ya   29w      REG              253,3      545985   68100605 /home/opt/redis-4.0.10/src/temp-rewriteaof-bg-10635.aof (deleted)
···
redis-ser  3391  3394           ya   30w      REG              253,3      540246   68080170 /home/opt/redis-4.0.10/src/temp-rewriteaof-bg-10680.aof (deleted)
mongod     3536                 ya    4w      REG              253,3  2944663552   33600269 /home/yadata/mongo1/log/server.log (deleted)
···
mongod     3605 11785           ya    4w      REG              253,3  1178099712  113564998 /home/yadata/mongo2/log/server.log (deleted)
java       5165                 ya  238w      REG              253,3         686   68938688 /home/yadata-sc/tomcat-accesslogs/ya-file/access_log.2021-12-17.log (deleted)
·····
ksmtuned   6415                 root  txt       REG              253,0      964608  100739943 /usr/bin/titan_lua_163187996567 (deleted)
mysqld     7457                mysql    5u      REG              253,0           0   34866472 /tmp/ibeME9W9 (deleted)
···
mysqld     7457 23988          mysql   12u      REG              253,0           0   34866496 /tmp/ibUVtMDz (deleted)
pulseaudi  7622                  gdm    6u      REG                0,4    67108864      48471 /memfd:pulseaudio (deleted)
null-sink  7622  7625            gdm    6u      REG                0,4    67108864      48471 /memfd:pulseaudio (deleted)
java      14027                 ya    1w      REG              253,3 37680096477    5589982 /home/ya/ya-auth/debug.log (deleted)
java      14027                 ya    2w      REG              253,3 37680096477    5589982 /home/ya/ya-auth/debug.log (deleted)
···
java      14027 31410           ya    1w      REG              253,3 37680095930    5589982 /home/ya/ya-auth/debug.log (deleted)
java      14027 31410           ya    2w      REG              253,3 37680095930    5589982 /home/ya/ya-auth/debug.log (deleted)
java      14027 31410           ya  270w      REG              253,3        1881  104257130 /home/yadata-sc/tomcat-accesslogs/ya-auth/access_log.2022-01-05.log (deleted)
bash      26914                 root  txt       REG              253,0      964608  100739943 /usr/bin/titan_lua_163187996567 (deleted)

使用命令lsof | grep deleted,可以查看哪些已经删除的但还是被进程占用,没有释放的文件。
只要重启对应的程序即可释放内存了。

本文来自:du 跟 df 显示不一致-小码农,转载请保留本条链接,感谢!

温馨提示:
本文最后更新于 2022年07月18日,已超过 843 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我
正文到此结束
本文目录