1

I have a problem with overlay2 disk usage

When I executing df -h, I have 222G used disk space: Filesystem Size Used Avail Use% Mounted on /dev/mapper/docker-docker 264G 222G 43G 85% /docker

When I executing du -shc *, in /docker directory, I have 36G used disk space: 17G containers 14M image 256K network 19G overlay2 0 plugins 0 swarm 0 tmp 0 trust 32K volumes 36G total Why such difference in used disk space?

PS if I restart docker, disk space freed up

PSS I don't have 'Exited' containers, and unused images/volume

1 Answers1

3

du command somehow counts space multiple times. I think it depends on fact that each docker directory is a separate mount. For analyzing disk space you can use docker system df command.

Please read documentation about.

Also, you can read this discussion about analyzing disk space.

ozlevka
  • 1,988
  • 16
  • 28
  • I already read this documentation and this discussion. docker system df did not show any relevant information.` [user@localhost ~]$ sudo docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 37 36 6.428 GB 531.1 MB (8%) Containers 69 69 2.582 MB 0 B (0%) Local Volumes 2 2 0 B 0 B [user@localhost ~]$ ` – Andrey Mitrofanov Feb 26 '19 at 08:54
  • And? ```du``` does not print correct information too. When open issue? – ozlevka Feb 26 '19 at 13:16
  • And? Your answer is useless – Andrey Mitrofanov Feb 26 '19 at 13:42
  • My answer is useful. If you want to use this information. Read links more one time... – ozlevka Feb 26 '19 at 17:37
  • I can read your answer more and more times, but that won't make it useful. Pls don't write in this topik. I already found the cause of the error. – Andrey Mitrofanov Feb 26 '19 at 18:07