Sizes reported by Disk Usage Analyzer (baobab), du, df, and (c)fdisk, revisited

Mario Vukelic mario.vukelic at
Mon May 19 18:53:04 UTC 2008

After several threads erupted recently about the disk size and usage
that is reported by these tools, I ran into a little mystery myself:
baobab reports my external USB disks much smaller than they are, and
reports the usage completely wrong. 

I hope someone can help me to make sense from the following baobab data,
and I hope my own research can shine some lights at the problems others
have had:

HD300 is a regular external USB disk, ext3. It has 300
GB (manufacturer claim, therefore 1 GB = 10^9 bytes), that is, ca. 279
GiB [1], or roughly 300,000,000,000 bytes.

HD320-backup is an external USB disk, ext3, that is used for backup. Its
main contents therefore are backups created by a custom rdiff-backup
script, plus a few APT dumps, evolution backup, etc. I mention this
because rdiff-backup works intensively with hard links, which might have
a remote chance of triggering size reporting bugs.
HD320-backup has 320 GB (manufacturer claim, therefore 1 GB = 10^9
bytes), that is, ca. 298 GiB [1], or roughly 319,975,063,552 bytes.


fdisk and cfdisk report the disks as follows:
HD300:		 300066407424 bytes, 300.0 GB
HD320-backup:	320070288384 bytes, 320.0 GB

This is correct, if slightly misleading, with "GB" meaning 10^9 bytes.
I'd prefer them to report GiB and clearly state so. (Might this have
been a source of confusion for Karl?)

Nautilus report:
HD300: "275.1 GB" (really, GiB) formatted space, "207.9 GB" (GiB)
used, and "67.2 GB" (GiB) free.

HD320-backup: "293.4 GB" (really, GiB) formatted space,"260.2
GB" (GiB) used, and "33.2 GB" (GiB) free.

Numbers for both disks make sense, and the numbers are also in line with
what I believe _should be the case. Note that the 320 disk has a
slightly higher percentage of formatted space compared to total space.
This is because when formatting it, I reduced the space to be reserved
for root to 2% (from the default 5% that was used for HD300).

sudo du -h --max-depth=1 /media/HD300 && sudo du -h \
--max-depth=1 /media/HD320-Backup
194G	total
258G	total

194 and 258 GB used is reasonably close to the Nautilus number, for my
taste. I don't think I have _ever seen GUI tools report the _exact sizes
and usage. I don't know why this is, but I can live with that. Though I
must say that 208 (nautilus, used) vs. 194 (du, used) is a bit

df -h /media/HD300/ && df -h /media/HD320-Backup/
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             276G  194G   68G  75% /media/HD300
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc1             294G  258G   34G  89% /media/HD320-Backup

Size is reasonably close to manufacturer and (c)fdisk, usage numbers
tally with du's output.

Follows Disk Usage Analyzer (baobab), which reports something
_completely different. I start it up and let it run a full scan. In the
preferences I have all storage enabled: my 2 external USB disks, my one
internal Ubuntu partition, my 2 internal windows partitions, and
dvfs-fuse-daemon (but I actually have no networked storage).


HD300:		Size 193.9 GB, Usage 76%   (-> 174.4 GB)
HD320-backup: 	 Size 40.4 GB,  Usage 15.9% (-> 6.4 GB)

Now, obviously, these values make equally little sense interpreted as
10^9 bytes (GB) and as 2^30 bytes (GiB). What gives?

Thanks for input.

More information about the ubuntu-users mailing list