Hi Erwin,
On Mon, Apr 15, 2013 at 11:30:54AM +0200, Erwin Geerdink wrote:
| Hi,
|
| After reading the man pages for fdisk, disklabel and the FAQ, I created
| a FFS2 filesystem on my 1TB usb harddisk (which I want to use for
| backups). The disk contains an OpenBSD MBR partition which spans
| the entire disk. I issued the following commands:
|
| # fdisk -i sd0
| # disklabel -E sd0
| (created partition 'a' covering the whole OpenBSD part)
| # newfs -O 2 sd0a
|
| This works fine, however only 931GB of the disk is allocated, while
| originally it was capable of storing 1000GB (FAT filesystem).
| Since an additional 5% is reserved for root, df -h tells me there is
| just 878GB available.
If you'd want to, you could change that root reserved space to 0% (use
-m 0 (see newfs(8) for details).
| Where has the remaining diskspace gone?
Nowhere. How did you see the '1000GB' on the FAT filesystem ? This
seems like the difference between saying a TB is 1.000.000.000.000
bytes (1000^4) and saying a TB is 1.099.511.627.776 bytes (1024^4).
| # fdisk sd0
|
| Disk: sd0 geometry: 121601/255/63 [1953525168 Sectors]
See how the disksize is reported as 1953525168 sectors. With a 512
byte sector size, this comes down to 1.000.204.886.016 bytes or 1000GB
of the 1000^3 kind.
OpenBSD uses 1024 as its base for calculating these sizes, hence the
difference. So you have more than 1 trillion bytes of storage
available on the disk, but it's not really 1TB in the OpenBSD sense of
the terabyte. When you bought the disk, the packaging probably also
said something about the definition of a terabyte...
Note that some people refer to these things as 'gibibytes' (for the
1024^3 thing) versus gigabytes (for the 1000^3 thing). Something I
find highly annoying, especially since memory vendors still use
gigabyte to refer to memory sizes of 1024^3 bytes.
So it's all there, just a reporting difference.
Cheers,
Paul 'WEiRD' de Weerd
| Offset: 0 Signature: 0xAA55
| Starting Ending LBA Info:
| #: id C H S - C H S [ start: size ]
|
-------------------------------------------------------------------------------
| 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
| 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
| 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
| *3: A6 0 1 2 - 121600 254 63 [ 64: 1953520001 ] OpenBSD
|
| # disklabel sd0
|
| # /dev/rsd0c:
| type: SCSI
| disk: SCSI disk
| label: Bell Carbon
| duid: bd112d36e9fc8c1f
| flags:
| bytes/sector: 512
| sectors/track: 63
| tracks/cylinder: 255
| sectors/cylinder: 16065
| cylinders: 121601
| total sectors: 1953525168
| boundstart: 64
| boundend: 1953520065
| drivedata: 0
|
| 16 partitions:
| # size offset fstype [fsize bsize cpg]
| a: 1953525056 64 4.2BSD 8192 65536 1
| c: 1953525168 0 unused
|
| # df -h
| Filesystem Size Used Avail Capacity Mounted on
| /dev/sd0a 924G 199G 679G 23% /mnt/sd0a
|
|
| Best,
| Erwin
|
--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
http://www.weirdnet.nl/