command df and du reports different output

General support questions
Post Reply
ludaca
Posts: 3
Joined: 2020/09/04 14:58:00

command df and du reports different output

Post by ludaca » 2020/09/04 15:08:02

Hello,

CentOS Linux release 7.4.1708 (Core)
df -k /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 291533568 238124656 53408912 82% /

du -sh /
6.5G

Already run lsof - no "dead" files.
System rebooted - unchanged.

Any help will be appreciated.
Thanks in advance

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: command df and du reports different output

Post by TrevorH » 2020/09/04 16:23:07

Step 1: run yum update. Your system is over 3 years out of date. The current version is 7.8.

Post all of the output from df -m
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ludaca
Posts: 3
Joined: 2020/09/04 14:58:00

Re: command df and du reports different output

Post by ludaca » 2020/09/05 10:36:06

performed yum update and sysrtem reboot

more /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

df -m
Filesystem 1M-blocks Used Available Use% Mounted on
devtmpfs 257830 0 257830 0% /dev
tmpfs 257842 0 257842 0% /dev/shm
tmpfs 257842 10 257832 1% /run
tmpfs 257842 0 257842 0% /sys/fs/cgroup
/dev/mapper/centos-root 284701 232800 51902 82% /
/dev/sda2 1016 223 794 22% /boot
/dev/sda1 200 12 189 6% /boot/efi
tmpfs 51569 0 51569 0% /run/user/0

ludaca
Posts: 3
Joined: 2020/09/04 14:58:00

Re: command df and du reports different output

Post by ludaca » 2020/09/05 18:14:18

Resolved.
Removed /var/lib/docker/* and rebooted.
Thanks for referring to my post.

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: command df and du reports different output

Post by tunk » 2020/09/07 10:07:25

I guess that "df -k /" only shows the root file system, and
"du -sh /" includes all files, directories and file systems.

Post Reply