Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Nov 2003 01:45:52 -0800
From:      andi payn <andi_payn@speedymail.org>
To:        Odhiambo Washington <wash@wananchi.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How does FreeBSD calculate disk sizes
Message-ID:  <1067852752.825.674.camel@verdammt.falcotronic.net>
In-Reply-To: <20031103090715.GC20234@ns2.wananchi.com>
References:  <20031103090715.GC20234@ns2.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I think this is (mostly) a GiB vs. GB confusion.

In case you have no idea what I'm talking about, here's some background
(if you do, skip the next paragraph):

Giga is the metric prefix meaning billion (or thousand million, if
you're British)--that is, 10^9. Computer people tend to use it to mean
2^30, which is actually 1.073741824 * 10^9. However, hard disk
manufacturers use the metric meaning. So, a hard disk maker's GB is 7%
bigger than the rest of the computer industry's GB. To clear up the
confusion, the standards people decided that from now on you're supposed
to use GiB to mean 2^30 (and MiB for 2^20, KiB for 2^10,
etc.--pronounced "gibibyte," "mibibyte," "kibibyte," etc.). And so far,
just about nobody has listened....

So, when fdisk says 69460MB, it means 69460 * 2^20, which is
72,834,088,960 bytes. When your disk manufacturer says 72GB, they mean
72,000,000,000 bytes. (They've given you 834MB for free. How nice.)

Meanwhile, when df says your partition is 64GB, it means 64 * 2^30. And
your 2GB swap is, similarly, 2 * 2^30. Do the math:

64 * 2^30 = 68,719,476,736
 2 * 2^30 =  2,147,483,648
            --------------
            70,866,960,384

In other words, you're not missing 6GB.

As for the rest of it:

> sucks# disklabel -n da0s1a

da0s1a is a partition, not a slice. You're asking it for the partitions
within a partition; it's bound to get confused. Try this:

# disklabel -n da0s1

(without the a)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1067852752.825.674.camel>