Why are partition size and df output different?

One reason the partition capacities can differ is that some space is reserved for root, in the event the partitions become full. If there is no space reserved for root, and the partitions become full, the system cannot function. However, this difference is usually of the order of 1%, so that does not explain the difference in your case. From the man page for df

If an argument is the absolute file name of a disk device node containing a mounted file system, df shows the space available on that file system rather than on the file system containing the device node (which is always the root file system).

So df is really showing the size of your filesystem, which is usually the size of the device, but this may not be true in your case. Does your filesystem extend over the whole of your partition?

Does

resize2fs /dev/sda1

make any difference? This command tries to increase your filesystem to cover the entire partition. But make sure you have a backup if you try this.


The main difference is because some things say 1 kilobyte is 1000 bytes, and others say 1 kilobyte is 1024 bytes.

Gnome Disk Utility shows the capacity using 1 kilobyte = 1000 bytes, because disk manufacturers describe disk sizes this way. This means your disk capacity is close to 154,000,000,000 bytes.

On the other hand, most operating systems say 1 kilobyte = 1024 bytes. All the tools like df and fdisk use this convention. So 154,000,000,000 bytes / 1024 / 1024 / 1024 = 143.4 GB.

As jlliagre rightly points out (and Gilles implies when asking for your fdisk output), disk utility is telling you the size of your whole hard disk. But /dev/sda1 is a single partition on your hard disk. For example, your hard disk probably has some other partitions on it such as a 4-8 GB partition for swap (also known as virtual memory), and a boot partition which is usually around 100 MB.

You didn't post the output of fdisk -l /dev/sda, so let's assume your swap partition is 8 GB. Now we're down to 135 GB.

Then, there are some other things that contribute to the difference.

For example, the file system uses some of the disk partition for metadata. Metadata is things like file names, file permissions, which parts of the partition belong to which files, and which parts of the partition are free. On my system, about 2% of the partition is used for this. Assuming yours is similar, it would bring the free space down to about 132 GB.

The file system can also reserve some space that can only be used by the root user. On my system, it's 5% of the partition, so in your case, it would mean a total capacity of about 125 GB.

The exact numbers depend on whether you are using ext2, ext3, ext4, fat, ntfs, btrfs, etc, and what settings were used when formatting the partition.

If you are using ext2 or ext3, sudo tune2fs -l /dev/sda1 can help understand where the space is going.


Probably they are used by inodes. Some amount may be used up by MBR.