-4

I use AWS and I got an EC2 instance. When I run the command
du -h --max-depth=1

I get:

enter image description here

and When I run the command df -h

I get:

enter image description here

It look I use only 1GB but it show that I am using 7.1GB. So I run the command lsof +L1 to locate some deleted file that process are still using and I found 2 of them:

enter image description here

Then I try to kill those processes,also try to use /proc/PID/fd (> FD) and I try to restart my EC2 instance but none of those thing help me to free the space. The process are always return and I can't figure up why.

Ishpreet
  • 5,230
  • 2
  • 19
  • 35
Blackstar
  • 97
  • 1
  • 2
  • 8
  • 2
    possible dup of: https://unix.stackexchange.com/questions/41863/how-to-remember-the-difference-between-du-and-df – Nir Alfasi Aug 24 '17 at 04:47

1 Answers1

3

du begins in the current directory. Change the directory:

cd /

Then try your du command again.

Alternatively, tell du to start with the root directory:

du -h --max-depth=1 /

Reference and further reading: http://www.linfo.org/du.html

cddt
  • 539
  • 5
  • 14