All of lore.kernel.org
 help / color / mirror / Atom feed
* df report incorrect free space for a filesystem (ext4)
@ 2016-08-08  8:15 Tom
  0 siblings, 0 replies; only message in thread
From: Tom @ 2016-08-08  8:15 UTC (permalink / raw)
  To: linux-ext4

Greetings,

This is my first message to community - so please forgive me message
format and mistakes I did :-)
I am writing to you, as I have a strong suspect that problem related to
filesystem/kernel internals.

I are continuosly having problems with inconsistency of free space
reported by `df` and calculating free size from SB. I are using LVM and
ext4 for our volumes (/, /tmp, /opt and etc).
Here is an example of / volume on bare metal server.

Reported by df:
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-lv_root   20G   16G  2.8G  86% /

Super-Block:
Last mounted on:          /
Filesystem magic number:  0xEF53
Filesystem state:         clean
Filesystem OS type:       Linux
Inode count:              1290240
Block count:              5242880
Reserved block count:     227170
Free blocks:              3616906
Free inodes:              1201391
First block:              0
Block size:               4096
Fragment size:            4096

`df` reports 2.8G free space for /, but by binding fs and calculating
with `du` clearly seen that about ~12GB is free:
    root@none:~# mount -o bind / /tmp/root/
    root@none:~# du -sk /tmp/root/* | awk '{sum += $1} END {print sum}'
    8688976

I tried to remount the fs without any results:
    root@none:~# mount /dev/rootvg/lv_root -oremount,rw
    root@none:~# df -h
    Filesystem                  Size  Used Avail Use% Mounted on
    /dev/mapper/rootvg-lv_root   20G   17G  2.7G  86% /

The problem was resolved by remounting the fs with RO option:
    root@none:~# df -h
    Filesystem                  Size  Used Avail Use% Mounted on
    /dev/mapper/rootvg-lv_root   20G   17G  2.7G  86% /
    root@none:~# mount /dev/rootvg/lv_root -oremount,ro
    mount: / is busy
    root@none:~# mount /dev/rootvg/lv_root -oremount,rw
    root@none:~# df -h
    Filesystem                  Size  Used Avail Use% Mounted on
    /dev/mapper/rootvg-lv_root   20G  8.1G   11G  44% /

By looking for a solution, I found that this topic relatively hot and
there are no clear and certain answers.
My questions are:
- what cause to df report wrong information?
- what can be done to proactively avoid it (usually we get an alert on
partition and discover the problem)?

P.S.
Here is a link to question i created - http://serverfault.com/questions
/795324/df-report-incorrect-free-space-for-a-filesystem-ext4

Cheers,
Tom 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-08  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08  8:15 df report incorrect free space for a filesystem (ext4) Tom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.