Skip to content

Instantly share code, notes, and snippets.

@bydmm
Last active March 9, 2017 02:58
Show Gist options
  • Save bydmm/9950c4f877829203f0b2224cbd57f41d to your computer and use it in GitHub Desktop.
Save bydmm/9950c4f877829203f0b2224cbd57f41d to your computer and use it in GitHub Desktop.
文件删除了但是磁盘没释放怎么办

有时候删除了文件,但是磁盘还是满的,那是因为被删除的文件还没被某个进程释放。

这时我们可以看看到底是谁在作怪。

$lsof | grep deleted
> ruby 6519 ubuntu 1w REG 202,1 66567512064 812757 /home/ubuntu/www/data_center/shared/log/sidekiq.log (deleted)

这次原来是sidekiq的进程不会跟着service restart一起重启的原因。

kill -9 6519 # 拜拜了您那

搞定

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment