From: Tom <0x6d3468@gmail.com>
To: linux-ext4@vger.kernel.org
Subject: df report incorrect free space for a filesystem (ext4)
Date: Mon, 08 Aug 2016 11:15:46 +0300 [thread overview]
Message-ID: <1470644146.31920.2.camel@gmail.com> (raw)
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
reply other threads:[~2016-08-08 8:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470644146.31920.2.camel@gmail.com \
--to=0x6d3468@gmail.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.