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.
fdisk -l /dev/sda
(run as root).tune2fs -l /dev/sda1
to examine it. Look at block count and block size and multiply them to get the filesystem size. Also,fdisk -s /dev/sda1
to get the partition size in 1k-blocks. Multiply that by 1024 to get the size in bytes. That number should only be slightly larger than the filesystem. On my 40GB ext4 partition, it's 3072 bytes larger. If your filesystem is oddly smaller, you can try resizing it. For ext2/3/4, useresize2fs /dev/sda1
. You can do this while using the computer normally.