S
S
syxoi2016-06-06 12:03:57
linux
syxoi, 2016-06-06 12:03:57

Why do gparted and df show different values ​​for the same partition?

Hi all! For a long time I noticed one incomprehensible glitch / bug: df and gparted show a different disk size. And gparted displays it somehow strangely.
6269b8f1784a425a94072338fd5a3030.JPG
I mean, how is it?
The total volume of the disk is 20 gigabytes.
df says 20479 mebibytes=20 GiB, so far so good.
17984 mib used and 779 mib available for a total of 18763 mib ~ 18.3 gib! That is, how to understand it?
Well, let's try to write files "at the end", wrote 786 mib (from du output), 15 mib left free. 786+15=801, but this is most likely due to compression.
What does gparted tell us?
At first he said the following:
688ee2cd4a194312b95562527bbe046c.JPG
and now:
4899d02a6f974fc1a93d1dd02fb2dbfc.JPG
Free as much as 1.85 gigabytes, but in fact - 15 mib.
df is lying about the occupied space (although it turns out that the free space is determined correctly), and gparted is lying this way and that, although df shows a little more occupied space.
How to understand all this? I'm totally confused.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sly_tom_cat ., 2016-06-06
@Sly_tom_cat

df for btrfs shows the average temperature of a spherical horse in vacuum.
Actually, taking into account the use of compression / snapshots / sub-volumes / deduplication - for btrfs it is very difficult to say how much is busy, and how much is free / how much can be written ....
+ do not forget that any FS creates service structures for storing data (metadata in the form of directories and file attributes + all sorts of service indexes and containers). And in this regard, BTRFS can eat quite a lot for its own/overhead needs. The same default metadata on the HDD is written in two copies (on ssd - in one).
You should look at this article and see the usage and maybe it will not hurt to do the balancing.
Another thing to remember is the difference between K/M/G and KiB/MiB/GiB
Actually, for *iB, I want to tear out all the limbs of marketers from HDD manufacturers who introduced K=1000 in information systems when initially K was 1024 for IT and 1000 for physicists.

M
Maxim Moseychuk, 2016-06-06
@fshp

btrfs filesystem usage /

S
syxoi, 2016-06-06
@syxoi

Such shnyaga not only with btrfs. Here is ext4.5280323ae97c40bcac44f3174177a2e0.JPG

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question