Frequently Asked Questions for FreeBSD 2.X : Installation : Which geometry should I use for a disk drive?
Previous: Can I install on my laptop over PLIP (Parallel Line IP)?
Next: Any restrictions on how I divide the disk up?

2.15. Which geometry should I use for a disk drive?

(By the "geometry" of a disk, we mean the number of cylinders, heads and sectors/track on a disk - I'll refer to this as C/H/S for convenience. This is how the PC's BIOS works out which area on a disk to read/write from).

This seems to cause a lot of confusion for some reason. First of all, the physical geometry of a SCSI drive is totally irrelevant, as FreeBSD works in term of disk blocks. In fact, there is no such thing as "the" physical geometry, as the sector density varies across the disk - what manufacturers claim is the "true" physical geometry is usually the geometry that they've worked out results in the least wasted space. For IDE disks, FreeBSD does work in terms of C/H/S, but all modern drives will convert this into block references internally as well.

All that matters is the logical geometry - the answer that the BIOS gets when it asks "what is your geometry?" and then uses to access the disk. As FreeBSD uses the BIOS when booting, it's very important to get this right. In particular, if you have more than one operating system on a disk, they must all agree on the geometry, otherwise you will have serious problems booting!

For SCSI disks, the geometry to use depends on whether extended translation support is turned on in your controller (this is often referred to as "support for DOS disks >1GB" or something similar). If it's turned off, then use N cylinders, 64 heads and 32 sectors/track, where 'N' is the capacity of the disk in MB. For example, a 2GB disk should pretend to have 2048 cylinders, 64 heads and 32 sectors/track.

If it is turned on (it's often supplied this way to get around certain limitations in MSDOS) and the disk capacity is more than 1GB, use M cylinders, 63 sectors per track (*not* 64), and 255 heads, where 'M' is the disk capacity in MB divided by 7.844238 (!). So our example 2GB drive would have 261 cylinders, 63 sectors per track and 255 heads.

If you are not sure about this, or FreeBSD fails to detect the geometry correctly during installation, the simplest way around this is usually to create a small DOS partition on the disk. The correct geometry should then be detected (and you can always remove the DOS partition in the partition editor if you don't want to keep it, or leave it around for programming network cards and the like).

Alternatively, there is a freely available utility distributed with FreeBSD called ``pfdisk.exe'' (located in the tools subdirectory on the FreeBSD CDROM or on the various FreeBSD ftp sites) which can be used to work out what geometry the other operating systems on the disk are using. You can then enter this geometry in the partition editor.


Frequently Asked Questions for FreeBSD 2.X : Installation : Which geometry should I use for a disk drive?
Previous: Can I install on my laptop over PLIP (Parallel Line IP)?
Next: Any restrictions on how I divide the disk up?