INSTALLBOOT(8)

NAME
installboot - install disk bootstrap software

SYNOPSIS
installboot [-nvf] [-b bn] bootfile rawdiskdevice

DESCRIPTION
The installboot utility prepares a disk for bootstrapping.

The NetBSD/i386 disk bootstrap software is split into two parts: a small first-stage boot program that is written into the disklabel area of a disk and a second-stage boot program that resides in a FFS file system on the disk (named /boot). Both parts of the boot are derived from a single object file which is split by installboot during the installation process. The first-stage boot program is loaded into memory by the BIOS. After receiving control of the system, it loads the second-stage boot program from a set of filesystem block numbers that have been hard-coded into it by installboot during execution. The second-stage boot program then locates and loads the kernel.

The options recognized by installboot are as follows:

-n  Do not actually write anything on the disk.

-v  Verbose mode.

-b bn
    Ignore the file system type and write the second-stage boot loader contigously from internal block number bn.

-f  Force a write of the boot blocks (with the first stage put at offset zero) even if no disk label is detected. This is useful if there is no disk label (as is often the case with floppy or vnode devices).

The arguments are:

bootfile
    The name of the special object file (typically /usr/mdec/biosboot.sym) where the first and second stage boot programs to be installed reside.

rawdiskdevice
    The name of the raw device corresponding to the partition on which the boot program is to be installed. The partition should start at the beginning of the NetBSD portion of the disk and must contain a FFS filesystem. The installboot program enforces its name to be in the form “/dev/r*” .

EXAMPLES
Assuming the file containing the boot program is in its typical place, and you wished to make /dev/fd0a bootable. To install the boot blocks, one then would issue the command:

    installboot -f /usr/mdec/biosboot.sym /dev/rfd0a

Note that the -f option is needed if the floppy is unlabeled -- see disklabel(8).

BUGS

NetBSD is in transition from using the 386BSD MBR partition-ID of 165 (0xa5), to using a new, unique partition-ID of 169 (0xa9). NetBSD versions newer than 1.3.3 will use the new partition-ID if one is found, and if not, fall back to the old ID of 165 with a warning. To eliminate the warning, update your bootblocks and installboot to 1.3.3 or newer, rerun installboot on the affected drives, and lastly use fdisk(8) to change the MBR partition-ID of NetBSD partitions to 169.

Note that the final step of changing MBR partition-IDs from 165 to 169 renders a disk unbootable by older NetBSD kernels, which do not recognize the new ID.

The NetBSD/i386 boot blocks can only read from the first 1024 cylinders of the disk because they use the BIOS to do their I/O. Thus, it is advisable that “a” partitions reside entirely within the first 1024 cylinders.

The BIOS partition table must reflect the correct location of the NetBSD portion according to disk geometry used by the BIOS. (This is automatically the case if the NetBSD portion is located at the beginning of the disk.)

installboot requires access to the disks' raw partition. That is not allowed with the kernel securelevel variable ( see sysctl(8)) set to a value greater than one, or with securelevel set to one if the “boot” partition is mounted.

SEE ALSO
boot(8), disklabel(8), init(8), sysctl(8), vnd(4)

HISTORY
The NetBSD/i386 installboot command first appeared in NetBSD 1.3.