我一直在处理一个问题,即 df 报告从 USB 驱动器安装到我的系统上的 exfat 分区的使用量大得多。
df -h
给出:
Filesystem Size Used Avail Use% Mounted on
/dev/sdb3 4.6T 4.2T 396G 92% /media/smb
而du -ch
报告称:
3.7T .
3.7T total
这促使我使用相同的方法调查 inode 数量。
从df -i
我得到:
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdb3 19M 17M 1.6M 92% /media/smb
并du -ch --inodes
显示:
3.5K .
3.5K total
直观地讲,知道该分区上的文件数量,3.5K 读取是正确的数字,而 17M 似乎df
夸大了。
我怎样才能弄清楚为什么使用的 inode 数量差异如此之大?
我已经重新启动了机器,但问题仍然存在,同样,我重新启动了机器上所有将该驱动器上的文件夹作为卷挂载的docker容器。
运行lsof +L1
(和lsof +L1 /media/smb
)显示很少有孤立文件
root@couch:~# lsof +L1 /media/smb
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/123/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
networkd- 845 root txt REG 179,2 5490352 0 2228342 /usr/bin/python3.8 (deleted)
unattende 963 root txt REG 179,2 5490352 0 2228342 /usr/bin/python3.8 (deleted)
unattende 963 root 3w REG 179,2 113 0 1181000 /var/log/unattended-upgrades/unattended-upgrades-shutdown.log.1 (deleted)
Xorg 1198 gdm 28u REG 0,1 4 0 33475 /memfd:xshmfence (deleted)
pulseaudi 1342 gdm 6u REG 0,1 67108864 0 33746 /memfd:pulseaudio (deleted)
none 1523 root txt REG 0,1 17032 0 37099 / (deleted)
container 431005 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431020 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431046 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431089 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431100 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431109 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431144 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)
container 431203 root txt REG 179,2 10556952 0 2232052 /usr/bin/containerd-shim-runc-v2 (deleted)