I use df and du to check disk usage of centos,then I get different results from these tools.
[root@localhost home]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/cl-root xfs 149G 31G 119G 21% /
devtmpfs devtmpfs 32G 0 32G 0% /dev
tmpfs tmpfs 32G 0 32G 0% /dev/shm
tmpfs tmpfs 32G 41M 32G 1% /run
tmpfs tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/vda1 xfs 1014M 178M 837M 18% /boot
tmpfs tmpfs 6.3G 0 6.3G 0% /run/user/1000
tmpfs tmpfs 6.3G 16K 6.3G 1% /run/user/1001
[root@localhost /]# du -sh / 2>/dev/null
7.0G /
However, I've rebooted the system several times and make sure that there is no big file deleted and recalculated.
This problem is really confused me for tow days,so I want to know if there is any way I can find out which blocks of disk is used? If yes,I can get where the missed 23.3Gs gone ?
[root@localhost home]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 150G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 149G 0 part
├─cl-root 253:0 0 148.6G 0 lvm /
└─cl-swap 253:1 0 412M 0 lvm [SWAP]
mount
maybe). Example: I mount a certain subvolume of Btrfs on/
.du
works on file level and sees only this subvolume. There are other subvolumes that take space anddf
reflects this.