F5 Drive 1
Other operating systems, in particular Windows® 95, have been known to overwrite an existing MBR with their own. If this happens to you, or you want to replace your existing MBR with the FreeBSD MBR then use the following command:
# fdisk -B -b /boot/boot0 device
Where device is the device that you boot from, such as ad0 for the first IDE disk, ad2 for the first IDE disk on a second IDE controller, da0 for the first SCSI disk, and so on.
If you are a Linux user, however, and prefer that LILO control the boot process, you can edit the /etc/lilo.conf file for FreeBSD, or select Leave The Master Boot Record Untouched during the FreeBSD installation process. If you have installed the FreeBSD boot manager, you can boot back into Linux and modify the LILO configuration file /etc/lilo.conf and add the following option:
which will permit the booting of FreeBSD and Linux via LILO. In our example, we use XY to determine drive number and partition. If you are using a SCSI drive, you will want to change /dev/hdXY to read something similar to /dev/sdXY, which again uses the XY syntax. The loader=/boot/chain.b can be omitted if you have both operating systems on the same drive. You can now run /sbin/lilo -v to commit your new changes to the system, this should be verified with screen messages.
7.3.2 Stage One, /boot/boot1, and Stage Two, /boot/boot2
Conceptually the first and second stages are part of the same program, on the same area of the disk. Because of space constraints they have been split into two, but you would always install them together.
They are found on the boot sector of the boot slice, which is where boot0, or any other program on the MBR expects to find the program to run to continue the boot process. The files in the /boot directory are copies of the real files, which are stored outside of the FreeBSD file system.
boot1 is very simple, since it too can only be 512 bytes in size, and knows just enough about the FreeBSD disklabel, which stores information about the slice, to find and execute boot2.
boot2 is slightly more sophisticated, and understands the FreeBSD file system enough to find files on it, and can provide a simple interface to choose the kernel or loader to run.
Since the loader is much more sophisticated, and provides a nice easy-to-use boot configuration, boot2 usually runs it, but previously it was tasked to run the kernel directly.
Example 7-2. boot2 Screenshot
>> FreeBSD/i386 BOOT
If you ever need to replace the installed boot1 and boot2 use disklabel(8):
# disklabel -B diskslice
where diskslice is the disk and slice you boot from, such as ad0s1 for the first slice on the first IDE disk.
Dangerously Dedicated Mode: If you use just the disk name, such as ad0, in the disklabel(8) command you will create a dangerously dedicated disk, without slices. This is almost certainly not what you want to do, so make sure you double check the disklabel(8) command before you press Return.