1

I have a 18TB HDD. (MG09ACA18TE)

$ df -TH
Filesystem              Type      Size  Used Avail Use% Mounted on    
/dev/dm-7               btrfs      19T   13T  5,8T  69% /mnt/point

$ df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/dm-7 btrfs 17T 12T 5,3T 69% /mnt/point

From the man page:

   -h, --human-readable
          print sizes in powers of 1024 (e.g., 1023M)

-H, --si print sizes in powers of 1000 (e.g., 1.1G)

How is it possible to have an extra TB?


Requested commands:

$ df
Filesystem                1K-blocks        Used  Available Use% Mounted on
/dev/dm-5               17578311680 13643014304 3933951744  78% /mnt/point

$ lsblk -b NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sde 8:64 0 18000207937536 0 disk
└─luks-.. 253:5 0 18000191160320 0 crypt /mnt/point

Giacomo1968
  • 58,727
Ocean
  • 153
  • 1
  • 7

1 Answers1

3

My tests indicate df -H rounds numbers up. The size in bytes is 18000191160320, it is more than 18000000000000 and therefore you see 19T.

Actually the number from lsblk -b describes the block device. What matters for df is the size of the filesystem. The size of your filesystem may be smaller than 18000191160320 bytes, but apparently it's still larger than 18000000000000, so rounding up results in 19 TB. Rounding up is responsible for what you see in the output of df -H.

For comparison, these are some of my partitions/filesystems:

device lsblk -bdevice size in bytes df -B 1filesysystem size in bytes df -Hfilesystem size my comment
sdc1 12000137413120 12000137412608 13T not 12T
sda1 5000980012544 5000980008960 5.1T not 5.0T

The same applies for df -h. 18000191160320 B is about 16.371 TiB which is closer to 16 TiB than to 17 TiB. Yet df -h shows you 17T, it also rounds up like df -H. 17T from df -h is almost as inflated as 19T from df -H and the reason is the same: the tool rounds numbers up.