简体   繁体   中英

linux disk utilisation conflict

I having some trouble with disk utilisation, it might be simple but i am not getting at this point what's going on with "/" mount Which having 69% utilization

[12:07:37 root@abc.com:~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              20G   13G  6.0G  69% /
tmpfs                  16G     0   16G   0% /dev/shm
/dev/sda1             121M   31M   83M  28% /boot
/dev/sda7             1.7T  1.2T  419G  75% /data1
/dev/sdb1             1.8T  1.3T  469G  74% /data2
/dev/sdc1             1.8T  1.2T  541G  69% /data3
/dev/sdd1             1.8T  1.3T  478G  73% /data4
/dev/sda2              58G  581M   54G   2% /srv
/dev/sda3              50G  2.1G   45G   5% /var
cm_processes           16G  100K   16G   1% /var/run/cloudera-scm-agent/process

Then I check with du but both numbers didn't match for "/" mount

12:10:31 root@abc.com:~]# du -hs /* | sort -hr
du: cannot access `/proc/25036/task/25036/fd/4': No such file or directory
du: cannot access `/proc/25036/task/25036/fdinfo/4': No such file or directory
du: cannot access `/proc/25036/fd/4': No such file or directory
du: cannot access `/proc/25036/fdinfo/4': No such file or directory
1.3T    /data4
1.3T    /data2
1.2T    /data3
1.2T    /data1
2.3G    /usr
2.3G    /opt
2.0G    /var
401M    /srv
134M    /lib
26M     /boot
25M     /etc
21M     /lib64
15M     /sbin
8.2M    /bin
6.3M    /root
4.1M    /home
208K    /command
204K    /tmp
204K    /dev
24K     /jenkins
16K     /lost+found
4.0K    /service
4.0K    /selinux
4.0K    /mnt
4.0K    /media
4.0K    /=0.6.28 
0       /sys
0       /proc

I rebooted the server also, but didn't resolve this.

Anyone know whats wrong here ?

du / will add all sizes until you get the total size underneath / directory (ie, "everything" mounter either directly or indirectly underneath / .

df -h will show you each partition's sizes ( / contains many directory mount points to many other partitions, for example you have /data3 (on which /dev/sdc1 partition is mounted) which is a 1.8T partition that currently have 1.2T of data in it)

So they differ, nothing wrong with it.

It is possible that you have data "underneath" some mount points. If you can reboot in single user mode, and umount all mounted partitions, you'll be able to do a du -ks / without anything mounted on top. That will give you the real / partition occupation.

Another way on linux to see the / partition (alone) as it would appear without any mounted filesystem on top : use mount --bind to mount it again under a 2nd directory (see Gille's answer at https://superuser.com/a/200697/174998 for explanations and an example)

And another thing: df adds blocks taken by files and directories, du will add bytes of files and directories. So df will usually report a larger size (as files most often don't always fill completely their last block). See : /srv 's partition size occupation and /srv du output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM