1999-02-21 21:23:42 +00:00
|
|
|
.\" Copyright (c) 1999 Robert Nordier
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
|
|
|
.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
|
|
.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
|
|
.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
|
|
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
|
|
.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 01:35:59 +00:00
|
|
|
.\" $FreeBSD$
|
1999-02-21 21:23:42 +00:00
|
|
|
.\"
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dd October 1, 2013
|
1999-02-21 21:23:42 +00:00
|
|
|
.Dt BOOT0CFG 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm boot0cfg
|
|
|
|
.Nd boot manager installation/configuration utility
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
1999-02-21 21:23:42 +00:00
|
|
|
.Op Fl Bv
|
|
|
|
.Op Fl b Ar boot0
|
|
|
|
.Op Fl d Ar drive
|
2008-12-03 14:53:59 +00:00
|
|
|
.Op Fl e Ar bell character
|
1999-02-21 21:23:42 +00:00
|
|
|
.Op Fl f Ar file
|
2008-12-03 14:53:59 +00:00
|
|
|
.Op Fl i Ar volume-id
|
1999-06-19 21:44:43 +00:00
|
|
|
.Op Fl m Ar mask
|
1999-02-21 21:23:42 +00:00
|
|
|
.Op Fl o Ar options
|
2000-08-17 18:42:13 +00:00
|
|
|
.Op Fl s Ar slice
|
1999-02-21 21:23:42 +00:00
|
|
|
.Op Fl t Ar ticks
|
|
|
|
.Ar disk
|
|
|
|
.Sh DESCRIPTION
|
2000-11-14 11:20:58 +00:00
|
|
|
The
|
|
|
|
.Fx
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sq boot0
|
2002-05-14 21:09:05 +00:00
|
|
|
boot manager permits the operator to select from which disk and
|
1999-02-21 21:23:42 +00:00
|
|
|
slice an i386 machine (PC) is booted.
|
|
|
|
.Pp
|
|
|
|
Note that what are referred to here as
|
|
|
|
.Dq slices
|
|
|
|
are typically called
|
|
|
|
.Dq partitions
|
2001-08-14 10:01:54 +00:00
|
|
|
in
|
|
|
|
.No non- Ns Bx
|
|
|
|
documentation relating to the PC.
|
2000-09-11 10:19:15 +00:00
|
|
|
Typically, only non-removable disks are sliced.
|
1999-02-21 21:23:42 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility optionally installs the
|
|
|
|
.Sq boot0
|
|
|
|
boot manager on the specified
|
|
|
|
.Ar disk ;
|
|
|
|
and allows various operational parameters to be configured.
|
|
|
|
.Pp
|
|
|
|
On PCs, a boot manager typically occupies sector 0 of a disk, which is
|
2020-06-22 07:46:24 +00:00
|
|
|
known as the Master Boot Record (MBR).
|
2000-09-11 10:19:15 +00:00
|
|
|
The MBR contains both code (to which control is passed by the PC BIOS)
|
|
|
|
and data (an embedded table of defined slices).
|
1999-02-21 21:23:42 +00:00
|
|
|
.Pp
|
|
|
|
The options are:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl B
|
|
|
|
Install the
|
|
|
|
.Sq boot0
|
2000-09-11 10:19:15 +00:00
|
|
|
boot manager.
|
2002-05-14 21:09:05 +00:00
|
|
|
This option causes MBR code to be replaced, without
|
1999-02-21 21:23:42 +00:00
|
|
|
affecting the embedded slice table.
|
|
|
|
.It Fl b Ar boot0
|
|
|
|
Specify which
|
|
|
|
.Sq boot0
|
2000-09-11 10:19:15 +00:00
|
|
|
image to use.
|
2000-09-11 10:21:10 +00:00
|
|
|
The default is
|
2004-07-07 19:57:16 +00:00
|
|
|
.Pa /boot/boot0
|
2004-06-17 12:01:25 +00:00
|
|
|
which will use the video card as output, alternatively
|
|
|
|
.Pa /boot/boot0sio
|
|
|
|
can be used for output to the COM1 port.
|
|
|
|
(Be aware that nothing will be output to the COM1 port unless the
|
|
|
|
modem signals DSR and CTS are active.)
|
1999-02-21 21:23:42 +00:00
|
|
|
.It Fl d Ar drive
|
|
|
|
Specify the drive number used by the PC BIOS in referencing the drive
|
|
|
|
which contains the specified
|
|
|
|
.Ar disk .
|
|
|
|
Typically this will be 0x80 for the first hard drive, 0x81 for the
|
|
|
|
second hard drive, and so on; however any integer between 0 and 0xff
|
|
|
|
is acceptable here.
|
2008-12-03 14:53:59 +00:00
|
|
|
.It Fl e Ar bell character
|
|
|
|
Set the character to be printed in case of input error.
|
1999-02-21 21:23:42 +00:00
|
|
|
.It Fl f Ar file
|
|
|
|
Specify that a backup copy of the preexisting MBR should be written to
|
|
|
|
.Ar file .
|
2002-05-14 21:09:05 +00:00
|
|
|
This file is created if it does not exist, and replaced if it does.
|
2008-12-03 14:53:59 +00:00
|
|
|
.It Fl i Ar volume-id
|
|
|
|
Specifies a volume-id (in the form XXXX-XXXX) to be saved at location
|
|
|
|
0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista
|
|
|
|
to identify the disk drive. The option is only compatible with version 2.00
|
|
|
|
of the 512-byte boot block.
|
1999-06-19 21:44:43 +00:00
|
|
|
.It Fl m Ar mask
|
|
|
|
Specify slices to be enabled/disabled, where
|
|
|
|
.Ar mask
|
|
|
|
is an integer between 0 (no slices enabled) and 0xf (all four slices
|
|
|
|
enabled).
|
2012-02-04 13:12:52 +00:00
|
|
|
Each mask bit enables corresponding slice if set to 1.
|
|
|
|
The least significant bit of the mask corresponds to slice 1,
|
|
|
|
the most significant bit of the mask corresponds to slice 4.
|
1999-02-21 21:23:42 +00:00
|
|
|
.It Fl o Ar options
|
|
|
|
A comma-separated string of any of the following options may be
|
|
|
|
specified (with
|
|
|
|
.Dq no
|
|
|
|
prepended as necessary):
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It packet
|
2004-06-04 19:22:20 +00:00
|
|
|
Use the disk packet (BIOS INT 0x13 extensions) interface,
|
2000-10-02 23:16:58 +00:00
|
|
|
as opposed to the legacy (CHS) interface, when doing disk I/O.
|
|
|
|
This allows booting above cylinder 1023, but requires specific
|
|
|
|
BIOS support.
|
|
|
|
The default is
|
2004-09-14 21:48:25 +00:00
|
|
|
.Sq packet .
|
1999-02-21 21:23:42 +00:00
|
|
|
.It setdrv
|
1999-02-26 14:57:17 +00:00
|
|
|
Forces the drive containing the disk to be referenced using drive
|
2000-09-11 10:19:15 +00:00
|
|
|
number definable by means of the -d option.
|
|
|
|
The default is
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sq nosetdrv .
|
|
|
|
.It update
|
2000-09-11 10:19:15 +00:00
|
|
|
Allow the MBR to be updated by the boot manager.
|
|
|
|
(The MBR may be updated to flag slices as
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sq active ,
|
2000-09-11 10:19:15 +00:00
|
|
|
and to save slice selection information.)
|
|
|
|
This is the default; a
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sq noupdate
|
|
|
|
option causes the MBR to be treated as read-only.
|
|
|
|
.El
|
2000-08-17 18:42:13 +00:00
|
|
|
.It Fl s Ar slice
|
|
|
|
Set the default boot selection to
|
|
|
|
.Ar slice .
|
|
|
|
Values between 1 and 4 refer to slices; a value of 5 refers to the
|
2000-09-11 10:19:15 +00:00
|
|
|
option of booting from a second disk.
|
2011-12-20 15:19:29 +00:00
|
|
|
The special string
|
|
|
|
.Dq PXE
|
|
|
|
or a value of 6 can be used to boot via PXE.
|
1999-02-22 09:36:54 +00:00
|
|
|
.It Fl t Ar ticks
|
1999-02-21 21:23:42 +00:00
|
|
|
Set the timeout value to
|
|
|
|
.Ar ticks .
|
|
|
|
(There are approximately 18.2 ticks per second.)
|
2002-05-25 01:46:44 +00:00
|
|
|
.It Fl v
|
|
|
|
Verbose: display information about the slices defined, etc.
|
1999-02-21 21:23:42 +00:00
|
|
|
.El
|
2001-07-18 07:12:46 +00:00
|
|
|
.Sh FILES
|
2004-06-17 12:01:25 +00:00
|
|
|
.Bl -tag -width /boot/boot0sio -compact
|
2001-07-18 07:12:46 +00:00
|
|
|
.It Pa /boot/boot0
|
|
|
|
The default
|
|
|
|
.Sq boot0
|
|
|
|
image
|
2004-06-17 12:01:25 +00:00
|
|
|
.It Pa /boot/boot0sio
|
|
|
|
Image for serial consoles (COM1,9600,8,N,1,MODEM)
|
2001-07-18 07:12:46 +00:00
|
|
|
.El
|
2005-01-18 20:02:45 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
2002-05-25 01:46:44 +00:00
|
|
|
.Sh EXAMPLES
|
2003-04-15 21:03:19 +00:00
|
|
|
To boot slice 2 on the next boot:
|
2002-05-25 01:46:44 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "boot0cfg -s 2 ada0"
|
2003-04-15 21:03:19 +00:00
|
|
|
.Pp
|
2012-02-04 13:12:52 +00:00
|
|
|
To enable just slices 1 and 3 in the menu:
|
2003-04-15 21:03:19 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "boot0cfg -m 0x5 ada0"
|
2007-05-12 10:40:20 +00:00
|
|
|
.Pp
|
2007-06-06 21:28:50 +00:00
|
|
|
To go back to non-interactive booting, use
|
2015-09-02 14:08:43 +00:00
|
|
|
.Xr gpart 8
|
2007-06-06 21:28:50 +00:00
|
|
|
to install the default MBR:
|
2007-05-12 10:40:20 +00:00
|
|
|
.Pp
|
2015-09-02 14:08:43 +00:00
|
|
|
.Dl "gpart bootcode -b /boot/mbr ada0"
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sh SEE ALSO
|
2005-04-07 20:04:55 +00:00
|
|
|
.Xr geom 4 ,
|
1999-02-21 21:23:42 +00:00
|
|
|
.Xr boot 8 ,
|
2011-11-06 20:42:32 +00:00
|
|
|
.Xr gpart 8
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sh AUTHORS
|
2014-06-20 09:57:27 +00:00
|
|
|
.An Robert Nordier Aq Mt rnordier@FreeBSD.org
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sh BUGS
|
|
|
|
Use of the
|
|
|
|
.Sq packet
|
|
|
|
option may cause
|
|
|
|
.Sq boot0
|
|
|
|
to fail, depending on the nature of BIOS support.
|
|
|
|
.Pp
|
1999-02-26 14:57:17 +00:00
|
|
|
Use of the
|
1999-02-21 21:23:42 +00:00
|
|
|
.Sq setdrv
|
2009-01-13 21:55:39 +00:00
|
|
|
option with an incorrect -d operand may cause the boot0 code
|
|
|
|
to write the MBR to the wrong disk, thus trashing its previous
|
|
|
|
content. Be careful.
|