Frequently Asked Questions for FreeBSD 2.X : System Administration : Will a ``dangerously dedicated'' disk endanger my health?
Previous: How do I boot FreeBSD and Linux using BootEasy?
Next: How can I add more swap space?

8.10. Will a ``dangerously dedicated'' disk endanger my health?

The installation procedure allows you to chose two different methods in partitioning your harddisk(s). The default way makes it compatible with other operating systems on the same machine, by using fdisk table entries (called ``slices'' in FreeBSD), with a FreeBSD slice that employs partitions of its own. Optionally, one can chose to install a boot-selector to switch between the possible operating systems on the disk(s). The alternative uses the entire disk for FreeBSD, and makes no attempt to be compatible with other operating systems.

So why it is called ``dangerous''? A disk in this mode doesn't contain what normal PC utilities would consider a valid fdisk table. Depending on how well they have been designed, they might complain at you once they are getting in contact with such a disk, or even worse, they might damage the BSD bootstrap without even asking or notifying you. In addition, the ``dangerously dedicated'' disk's layout is known to confuse many BIOSsen, including those from AWARD (eg. as found in HP Netserver and Micronics systems as well as many others) and Symbios/NCR (for the popular 53C8xx range of SCSI controllers). This isn't a complete list, there are more. Symptoms of this confusion include the "read error" message printed by the FreeBSD bootstrap when it can't find itself, as well as system lockups when booting.

Why have this mode at all then? It only saves a few kbytes of disk space, and it can cause real problems for a new installation. ``Dangerously dedicated'' mode's origins lie in a desire to avoid one of the most common problems plaguing new FreeBSD installers - matching the BIOS ``geometry'' numbers for a disk to the disk itself.

``Geometry'' is an outdated concept, but one still at the heart of the PC's BIOS and its interaction with disks. When the FreeBSD installer creates slices, it has to recoord the location of these slices on the disk in a fashion that corresponds with the way the BIOS expects to find them. If it gets it wrong, you won't be able to boot.

``Dangerously dedicated'' mode tries to work around this by making the problem simpler. In some cases, it gets it right. But it's meant to be used as a last-ditch alternative - there are better ways to solve the problem 99 times out of 100.

So, how do you avoid the need for ``DD'' mode when you're installing? Start by making a note of the geometry that your BIOS claims to be using for your disks. You can arrange to have the kernel print this as it boots by specifying ``-v'' at the ``boot:'' prompt, or using ``boot -v'' in the loader. Just before the installer starts, the kernel will print a list of BIOS geometries. Don't panic - wait for the installer to start and then use scrollback to read the numbers. Typically the BIOS disk units will be in the same order that FreeBSD lists your disks, first IDE, then SCSI.

When you're slicing up your disk, check that the disk geometry displayed in the FDISK screen is correct (ie. it matches the BIOS numbers); if it's wrong, use the ``g'' key to fix it. You may have to do this if there's absolutely nothing on the disk, or if the disk has been moved from another system. Note that this is only an issue with the disk that you're going to boot from; FreeBSD will sort itself out just fine with any other disks you may have.

Once you've got the BIOS and FreeBSD agreeing about the geometry of the disk, your problems are almost guaranteed to be over, and with no need for ``DD'' mode at all. If, however, you are still greeted with the dreaded ``read error'' message when you try to boot, it's time to cross your fingers and go for it - there's nothing left to lose.

To return a ``dangerously dedicated'' disk for normal PC use, there are basically two options. The first is, you write enough NULL bytes over the MBR to make any subsequent installation believe this to be a blank disk. You can do this for example with

        dd if=/dev/zero of=/dev/rsd0 count=15
      

Alternatively, the undocumented DOS ``feature''

        fdisk /mbr
      

will to install a new master boot record as well, thus clobbering the BSD bootstrap.


Frequently Asked Questions for FreeBSD 2.X : System Administration : Will a ``dangerously dedicated'' disk endanger my health?
Previous: How do I boot FreeBSD and Linux using BootEasy?
Next: How can I add more swap space?