首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu18.04中耗尽空间(并删除一些文件)后无法恢复磁盘空间

在Ubuntu18.04中耗尽空间(并删除一些文件)后无法恢复磁盘空间
EN

Server Fault用户
提问于 2021-09-04 15:04:55
回答 1查看 569关注 0票数 0

快把我逼疯了!我的服务器空间用完了。我通过删除文件夹清理了一些文件。自由空间的数量并没有上升(% wise)。我现在看到的是:

如您所见,它显示了315 in大小,其中298 in正在使用中。那么,为什么它显示100%使用呢?唯一的原因是我有1.1gb的免费,你可以看到,如果因为删除更多的文件是重新启动。尽管我之前已经处理掉了15+gb的文件:/

我尝试过很多东西,比如lsof +L1

代码语言:javascript
复制
    COMMAND    PID      USER   FD   TYPE DEVICE SIZE/OFF NLINK  NODE NAME
php-fpm7.  726      root    3u   REG    8,0        0     0   605 /tmp/.ZendSem.sRUIJj (deleted)
mysqld     863     mysql    5u   REG    8,0        0     0  2938 /tmp/ibj2MjTy (deleted)
mysqld     863     mysql    6u   REG    8,0        0     0 10445 /tmp/ibgsRaLu (deleted)
mysqld     863     mysql    7u   REG    8,0        0     0 76744 /tmp/ibx2g3Cq (deleted)
mysqld     863     mysql    8u   REG    8,0        0     0 76750 /tmp/ib7D93oi (deleted)
mysqld     863     mysql   12u   REG    8,0        0     0 77541 /tmp/ibSr0xre (deleted)
dovecot   1278      root  139u   REG   0,23        0     0  2021 /run/dovecot/login-master-notify6ae65d15ebbecfbf (deleted)
dovecot   1278      root  172u   REG   0,23        0     0  2022 /run/dovecot/login-master-notify4b18cb63ddb75aab (deleted)
dovecot   1278      root  177u   REG   0,23        0     0  2023 /run/dovecot/login-master-notify05ff81e3cea47ffa (deleted)
cron      2239      root    5u   REG    8,0        0     0  1697 /tmp/#1697 (deleted)
cron      2240      root    5u   REG    8,0        0     0 77563 /tmp/#77563 (deleted)
sh        2243      root   10u   REG    8,0        0     0  1697 /tmp/#1697 (deleted)
sh        2243      root   11u   REG    8,0        0     0  1697 /tmp/#1697 (deleted)
sh        2244      root   10u   REG    8,0        0     0 77563 /tmp/#77563 (deleted)
sh        2244      root   11u   REG    8,0        0     0 77563 /tmp/#77563 (deleted)
imap-logi 2512  dovenull    4u   REG   0,23        0     0  2023 /run/dovecot/login-master-notify05ff81e3cea47ffa (deleted)
imap-logi 3873  dovenull    4u   REG   0,23        0     0  2023 /run/dovecot/login-master-notify05ff81e3cea47ffa (deleted)
pop3-logi 3915  dovenull    4u   REG   0,23        0     0  2021 /run/dovecot/login-master-notify6ae65d15ebbecfbf (deleted)
pop3-logi 3917  dovenull    4u   REG   0,23        0     0  2021 /run/dovecot/login-master-notify6ae65d15ebbecfbf (deleted)
php-fpm7. 4218    fndesk    3u   REG    8,0        0     0   605 /tmp/.ZendSem.sRUIJj (deleted)
php-fpm7. 4268 executive    3u   REG    8,0        0     0   605 /tmp/.ZendSem.sRUIJj (deleted)

但我看不到里面有什么东西能把文件锁起来

EN

回答 1

Server Fault用户

回答已采纳

发布于 2021-09-04 16:22:09

在删除某些内容之前,先找出占用磁盘空间的原因,然后找出原因。

要显示“十大目录”,可以使用du -Sh / | sort -rh | head -10

要显示“十大”文件,可以使用find / -type f -exec du -Sh {} + | sort -rh | head -n 10

通常,您会发现大量或不旋转的日志文件,快速填充日志文件.根据您的发现,有时只需删除一些较旧的日志文件,或配置日志旋转,或配置服务的日志设置。

关于你的计算:这不一定让你发疯:-)

通常,文件系统保留5%的空间供根用户使用。您有315 g磁盘大小,因此5%将是~16G预留空间。有一篇很好的文章解释了背景:https://blog.tinned-software.net/utility-df-shows-inconsistent-calculation-for-ext-filesystems/

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1076642

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档