1

The issue that I have is that df -h displays certain usage on a CentOS-based server, however du does not detect as much disk usage.

In this particular case, I have:

[root@localhost /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mount        50G   47G  2.0G  88% /
sysfs            50G   47G  2.0G  88% /sys

While du returns less than 2 GB usage:

[root@localhost /]# du -sh
du: cannot access `./proc/11587/task/11587/fd/4': No such file or directory
du: cannot access `./proc/11587/task/11587/fdinfo/4': No such file or directory
du: cannot access `./proc/11587/fd/4': No such file or directory
du: cannot access `./proc/11587/fdinfo/4': No such file or directory
1833M    .

I checked for open deleted files with lsof, and for different mounts however I could not find anything.

Can anyone give some other suggestions?

  • If df is really showing just 2 mounted filesystems, you may be running in a containerized environment. You'll need to get access to the underlying system to really see what is using up space. – Mark Plotnick Feb 29 '16 at 19:55
  • Indeed, the server is container-based, however I am not certain what files are taking up this space and how to check them. Do you have some sort of suggestion on how to investigate what is taking up space since the files/directories do not seem to be present? – user3551277 Mar 01 '16 at 01:43
  • `du` (and `lsof`, if there are large deleted files) are the right tools to use, but you need to use them outside of the container. The container is doing its job - preventing its users from seeing (and making changes) outside of it. – Mark Plotnick Mar 01 '16 at 03:21

2 Answers2

0

du -sh * is most likely what you should use. This is an example of my own directory:

$ du -sh *
172K    css
12K index.html
228K    js
4.0K    README.md
52K sh
Toby Speight
  • 27,591
  • 48
  • 66
  • 103
osleonard
  • 595
  • 5
  • 22
0

Try this way:

du -h * --max-depth=0
Justin Howard
  • 5,504
  • 1
  • 21
  • 48
Jorgeley
  • 482
  • 1
  • 6
  • 12
  • It shows the same regardless of the du parameters/arguments used. The files cannot actually be accessed, however they still seem to take up space, I am not certain how to check what is taking up this space.. it is not reserved. – user3551277 Mar 01 '16 at 01:42
  • the "du" command above on / does not show the 47G total of used space? what the command "fdisk -l" shows? – Jorgeley Mar 03 '16 at 13:21