简体   繁体   English

linux磁盘利用率冲突

[英]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 我在磁盘利用率方面遇到了一些麻烦,这可能很简单,但此时我仍无法理解“ /”挂载的情况,利用率为69%

[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 然后我用du检查,但是两个数字都不匹配“ /”装载

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 / . du /将添加所有大小,直到获得/目录下的总大小(即直接/间接在/下的“所有”安装程序)。

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) df -h将显示每个分区的大小( /包含指向许多其他分区的许多目录安装点,例如,您有/data3 (已安装/dev/sdc1分区),这是一个1.8T分区,当前具有1.2T数据)

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. 如果您可以在单用户模式下重新启动并卸载所有已安装的分区,则可以执行du -ks /而无需在顶部安装任何内容。 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) 在Linux上查看/分区(单独)的另一种方式是,在顶部没有任何已挂载文件系统的情况下:使用mount --bind将其再次挂载在第二目录下(请参阅Gille的回答, 网址https://superuser.com/a / 200697/174998以获得解释和示例)

And another thing: df adds blocks taken by files and directories, du will add bytes of files and directories. 另一件事: df添加文件和目录占用的块, du将添加文件和目录的字节。 So df will usually report a larger size (as files most often don't always fill completely their last block). 因此, df通常会报告较大的大小(因为文件通常并不总是完全填满最后一个块)。 See : /srv 's partition size occupation and /srv du output. 请参阅:/ srv的分区大小占用和/ srv du输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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