I used du to list all folders and sort by size, the results simply doesn't add up to how much disk space is used(using df). There's about 20G in discrepency, why?
[root@xxx lib]# du --max-depth=1 -h /| sort -n -r
310M /lib
123M /root
96K /dev
88M /etc
75G /
73G /var
30M /sbin
20M /boot
20K /tmp
18M /lib64
16K /mnt
16K /lost+found
12K /home
8.0K /srv
8.0K /selinux
8.0K /opt
8.0K /misc
8.0K /media
7.0M /bin
1.2G /usr
0 /sys
0 /proc
[root@xxx lib]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
298G 94G 189G 34% /
/dev/sda1 99M 26M 69M 28% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
du -smc /* | sort -n -rvs.df -minstead (also fixes the broken sort) – sehe May 26 '11 at 08:12du --max-depth=1 -h / | sort -hr. This will put "75G /" first. – May 30 '13 at 10:35