$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       260G   16G  231G   7% /
/dev/sda4       550G  323G  200G  62% /home

gparted shows:

enter image description here

Why are the size and used and avail sizes bigger in gparted than in df -h?

Why is size not the sum of used and avail in df -h, whereas it is in gparted?


closed as too broad by Olorin, Mr Shunz, Stephen Harris, Rui F Ribeiro, Christopher Feb 19 at 16:23

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Update (and apology for misleading people in earlier revision)

The first difference to examine is the size of the partition. Ext4 uses some disk space to create storage for inodes - this is apparently approximately 1.6% according to a couple of links, although it may be different depending upon how the disks have been setup. https://stackoverflow.com/a/5425321

Assuming that 1.6% is about correct for your system, taking the partition size and reducing it by 1.6% (558.79/1.016) yields 549.99 GB, shown as the space of the filesystem

Secondly looking at the available disk space. Ext4 reserves some space for root usage, such as defragmentation. This is by default 5% (see man tune2fs, reserved-blocks-percentage)

Assuming again that you have the standard reserved space, your 550GB disk will keep 27.5GB for root purposes. df -h does not show this space as available, or as used. So the 550GB available, less 323GB used, less 27.5GB reserved comes to 199.5GB available (shown as 200)

Finally, the space used. The disk space is allocated into blocks (usually 4096 bytes). If the size of the file is smaller than 4K, it will still consume an entire 4K block by itself https://stackoverflow.com/questions/30133149/can-multiple-files-be-stored-in-the-same-block resulting in additional partition space being used (but empty). For example, if I wrote 8192, 1024 byte files on a disk...

In short, both programs are correct about the space available, used and size of the disk depending upon the perspective that you are looking at the disk. If you are looking at the files and up, df -h is showing how muach data you have written, and if you are looking at the disk and down, gparted is showing how much of the disk has been consumed.

Please don't read anything below this line - it's total trash.

Try df -H with a capitol H.

You can measure size in powers of 2, as in 1024, or in powers of 10, as in 1000. The difference is show in the commands you used as GB, and GiB, where 100 GB is about 93 GiB, or do I have that backwards?

From Wikipedia:

The gibibyte is a multiple of the unit byte for digital information. The binary prefix gibi means 230, therefore one gibibyte is equal to 1073741824bytes = 1024 mebibytes. The unit symbol for the gibibyte is GiB. It is one of the units with binary prefixes defined by the International Electrotechnical Commission (IEC) in 1998.[1][2]

The gibibyte is closely related to the gigabyte (GB), which is defined by the IEC as 109 bytes = 1000000000bytes, 1GiB ≈ 1.074GB. 1024 gibibytes are equal to one tebibyte. In the context of computer memory, gigabyte and GB are customarily used to mean 10243 (230) bytes, although not in the context of data transmission and not necessarily for hard drive size.[3]

  • df -h shows the sizes in GiB (same as df -BG), just like gparted. – Freddy Feb 18 at 4:29
  • @Freddy and df -H? The other form of this would be df -BGB – Charles Green Feb 18 at 4:31
  • Yes, df -H should be in GB as in df -BGB. – Freddy Feb 18 at 4:38
  • 1
    Please do the arithmetic and show how 21GiB equals 16GB, as in the question, or even how 21GB equals 16GiB. – JdeBP Feb 18 at 8:55
  • @JdeBP I have re-written the answer, and can only apologize for a very wrong set of stuff I wrote before. – Charles Green Feb 18 at 15:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.