不知道为什么,但下面的两个命令的结果是不匹配的。 我正在尝试确定哪个文件夹使用多less磁盘空间。 对我而言只有2.5G使用,而DF则说592G使用。
[root@w10 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 855G 592G 220G 73% / /dev/mapper/isw_djeiehjhh_Volume0p1 99M 19M 75M 21% /boot tmpfs 24G 0 24G 0% /dev/shm [root@w10 /]# du -hs / du: cannot access `/proc/2819': No such file or directory du: cannot access `/proc/2820': No such file or directory du: cannot access `/proc/2821': No such file or directory du: cannot access `/proc/2822': No such file or directory 2.5G /
(可能的解释)在posix文件系统文件可能被删除,而它仍然在使用。 发生这种情况时,数据必须保留在磁盘上,直到导致该文件的所有文件描述符都closures。
你可以试试lsof | grep deleted 如果你的系统上有这样的文件, lsof | grep deleted 。
另一种解释可能是文件系统损坏,或者机器被入侵。
后期编辑:另一种解释可能是,你做错了……用du -hs /命令,你正在计算/dev和/proc中的所有文件,其中一些可能会变得很大。 您应该添加-x来在一个文件系统上计数文件。 所以命令看起来更像du -xhs / 。