0

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]

2

1 Answer 1

0

After cleaned up disk fragmentation with xfs_fsr,the missing disk space came back!

[root@localhost /]# xfs_db -c frag -r /dev/mapper/cl-root actual 430606, ideal 421725, fragmentation factor 2.06% Note, this number is largely meaningless. Files on this filesystem average 1.02 extents per file [root@localhost /]# xfs_fsr /dev/mapper/cl-root / start inode=0 [root@localhost /]# xfs_db -c frag -r /dev/mapper/cl-root actual 428060, ideal 421496, fragmentation factor 1.53% Note, this number is largely meaningless. Files on this filesystem average 1.02 extents per file [root@localhost /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/cl-root 149G 7.0G 142G 5% / devtmpfs 32G 0 32G 0% /dev tmpfs 32G 0 32G 0% /dev/shm tmpfs 32G 41M 32G 1% /run tmpfs 32G 0 32G 0% /sys/fs/cgroup /dev/vda1 1014M 178M 837M 18% /boot tmpfs 6.3G 0 6.3G 0% /run/user/1000 [root@localhost /]# du -sh 6.8G . [root@localhost /]#

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .