3

I have run these commands to determine disk space usage on my Linux system.

Filesystem Size Used Avail Use% Mounted on /dev/mapper/foovg-foo 326G 202G 108G 66% /export/data/foo

du -sk * | awk '{sum += $1}END{print sum}' 132161064 ~ 126GB

So, 202G - 126G = 76G difference.

Where is the 76G disk space? How can I find out which process holding the file handle?
What is the file name deleted?

In Linux, the file descriptors under /proc/pid/fd/ are soft link to the actual file.

4

2 回答 2

2

您在 du 命令中使用了*通配符,因此它不会拾取(隐藏)以 . 开头的目录.。例如,可能有.nfs文件占用空间,而您的命令不会占用这些空间。

您还可以使用该-c选项来告诉du生成总数,而不是使用awk.

请改用以下命令:

# cd /export/data/foo
# du -ch . 

此命令还将为您提供所有子目录的大小,以便您可以找到哪个使用更多空间。

于 2012-05-18T15:22:57.620 回答
2

无论是否是原因,您都可以使用lsof. 这样的事情可能会有所帮助:

lsof | grep '(deleted)$' | sort -rnk 7

换句话说,抓取所有已删除的文件并按大小降序对它们进行排序。

于 2012-05-18T15:21:24.270 回答