Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fdisk problem with new disk

6 views
Skip to first unread message

Federico Lupi

unread,
Jul 26, 2000, 3:00:00 AM7/26/00
to
I have added the following disk to a NetBSD machine:
IBM DCAS-32160, SCSI-3
Formatted device capacity: 2.16GB
Sector size: 512
Data heads: 3
Disks: 2

The output from dmesg is:
sd0: 2063MB, 8188 cyl, 3 head, 172 sec, 512 bytes/sect x 4226725 sectors
^^^^^^^

but 8188*3*172 is 4225008 and not 4226725.
^^^^^^^
Where do the extra 1717 sectors come from?

The output from fdisk is:
loge# fdisk sd0
NetBSD disklabel disk geometry:
cylinders: 8188 heads: 3 sectors/track: 172 (516 sectors/cylinder)

BIOS disk geometry:
cylinders: 524 heads: 128 sectors/track: 63 (8064 sectors/cylinder)

Partition table:
0: sysid 6 (Primary 'big' DOS, 16-bit FAT (> 32MB))
start 63, size 4225473 (2063 MB), flag 0x0
beg: cylinder 0, head 1, sector 1
end: cylinder 523, head 127, sector 63
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>

It looks like 63+4225473=4225536 sectors are used, which is the
total number of sectors according to the BIOS geometry:
524*128*63 = 4225536
^^^^^^^

What is the correct number of total sectors?
Which values should I use to repartition the HD and make one big NetBSD
partition?

tia

--
Federico Lupi

Home page
http://www.mclink.it/personal/MG2508/

Manuel Bouyer

unread,
Jul 26, 2000, 3:00:00 AM7/26/00
to
On Wed, Jul 26, 2000 at 10:38:09PM +0200, Federico Lupi wrote:
> I have added the following disk to a NetBSD machine:
> IBM DCAS-32160, SCSI-3
> Formatted device capacity: 2.16GB
> Sector size: 512
> Data heads: 3
> Disks: 2
>
> The output from dmesg is:
> sd0: 2063MB, 8188 cyl, 3 head, 172 sec, 512 bytes/sect x 4226725 sectors
> ^^^^^^^
>
> but 8188*3*172 is 4225008 and not 4226725.

hehe, real vs fake geometry. For modern disks the number of sector per track
isn't constant (disk speed and density is constant, so something has to
be variable :), so the above math does't work.
Disk still reports C/H/S geometry but they don't exactly match the hardware.

--
Manuel Bouyer <bou...@antioche.eu.org>
--

Federico Lupi

unread,
Jul 26, 2000, 3:00:00 AM7/26/00
to

Thanks a lot for the answer (as usual :-)

If I understand correctly, the BIOS uses yet another "fake" geometry
which comes close to the total number of sectors but is not exact. So,
as long as I stick to the BIOS geometry (cylinders: 524 heads: 128
sectors/track: 63 => 4225536 sectors) in partitioning everything will
be ok, although some sectors (4226725-4225536=1189 sectors= 594 KB)
will remain unused.

0 new messages