On 06/09/2021 11:33 am, Paco Xu wrote:
Hi, I am not quite familiar with the bug report process of `DF` or os. The Problem - DF shows incorrect disk usage which include disk usage of a mounted path The Scenario We run a registry with docker and the data dir is mounted from NFS or local disk. The docker is using device-mapper. DF result & du result When registry is busy pulling images, there is no big files in registry container, but the `df -h` shows 7.8 G as below(Sometime 9G the below screenshot 8.5G) ``` [root@10-23-15-8 ~]# df -h | grep /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e /dev/dm-10 10G 7.8G 2.3G 78% /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e ``` The /var/lib/registry/docker is mounted ``` { "Type": "bind", "Source": "/var/local/dce/registry", "Destination": "/var/lib/registry", "Mode": "rw", "RW": true, "Propagation": "rprivate" } ``` [文本 描述已自动生成] And at the time, I run `du`. ``` [root@10-23-15-8 ~]# du -h /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e | tail -n 1 478M /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e ``` The du details shows that `df -h` is not correct. The expected behavior When it became normal, the disk usage is about 400~500M. ``` [root@10-23-15-8 ~]# df -h | grep /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e /dev/dm-10 10G 478M 9.5G 6% /var/lib/docker/devicemapper/mnt/a0ba326c248009e14e9650c84818fdb45af904338bdc90e7d786a584f63ed47e ``` No matter what happened, the `df -h` should not take `mounted path ./var/lib/registry/docker` into account. Further Information I searched in stackoverflow and other place and only find some issues about `df and du show different` problem. I am not sure which is my case. Thanks. Best regards, Paco ________________________________ 本邮件及附件含 DaoCloud 保密信息,仅限发送给上面地址中列出的个人或群组,禁止任何其他人以任何形式使用本邮件中的信息。若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
du -hx perhaps? -- Chris Elvidge 5 Ebor Park, Appleton Roebuck, York. YO23 7DZ. Tel (Mob): +447443472958 mailto:celvi...@outlook.com Calle Padre Raimundo Codesal 1, Vélez-Málaga, 29700, España