2001-12-26 04:45:35 +03:00
|
|
|
.\" $NetBSD: installboot.8,v 1.17 2001/12/26 01:45:35 wiz Exp $
|
1997-03-14 05:40:31 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1997 Perry E. Metzger. All rights reserved.
|
|
|
|
.\" Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
|
|
|
.\" Copyright (c) 1995 Paul Kranenburg. 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.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by Paul Kranenburg.
|
1999-04-07 00:24:37 +04:00
|
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
1997-03-14 05:40:31 +03:00
|
|
|
.\" derived from this software without specific prior written permission
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
|
|
|
|
.\"
|
1997-06-14 02:14:58 +04:00
|
|
|
.Dd June 13, 1997
|
1997-03-14 05:40:31 +03:00
|
|
|
.Dt INSTALLBOOT 8 i386
|
2001-09-06 03:53:22 +04:00
|
|
|
.Os
|
1997-03-14 05:40:31 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm installboot
|
|
|
|
.Nd install disk bootstrap software
|
|
|
|
.Sh SYNOPSIS
|
2001-11-24 19:38:07 +03:00
|
|
|
.Nm /usr/mdec/installboot
|
1997-03-14 05:40:31 +03:00
|
|
|
.Op Fl nvf
|
1998-12-19 22:22:18 +03:00
|
|
|
.Op Fl b Ar bn
|
1999-09-10 20:59:04 +04:00
|
|
|
.Op Fl t Ar timeout
|
|
|
|
.Op Fl p Ar password
|
1997-03-14 05:40:31 +03:00
|
|
|
.Ar bootfile
|
|
|
|
.Ar rawdiskdevice
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm installboot
|
|
|
|
utility prepares a disk for bootstrapping.
|
|
|
|
.Pp
|
1998-02-06 08:54:12 +03:00
|
|
|
The
|
|
|
|
.Nx Ns Tn /i386
|
|
|
|
disk bootstrap software is split into two parts:
|
1997-03-14 05:40:31 +03:00
|
|
|
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
|
|
|
|
.Pa /boot ) .
|
|
|
|
Both parts of the boot are derived from a single object file
|
|
|
|
which is split by
|
|
|
|
.Nm
|
|
|
|
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
|
|
|
|
.Nm
|
|
|
|
during execution.
|
|
|
|
The second-stage boot program then locates and loads the kernel.
|
|
|
|
.Pp
|
|
|
|
The options recognized by
|
|
|
|
.Nm installboot
|
|
|
|
are as follows:
|
|
|
|
.Bl -tag -width flag
|
|
|
|
.It Fl n
|
|
|
|
Do not actually write anything on the disk.
|
|
|
|
.It Fl v
|
|
|
|
Verbose mode.
|
1998-12-19 22:22:18 +03:00
|
|
|
.It Fl b Ar bn
|
|
|
|
Ignore the file system type and write the second-stage boot loader
|
|
|
|
contigously from internal block number
|
|
|
|
.Ar bn .
|
1997-03-14 05:40:31 +03:00
|
|
|
.It Fl 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).
|
1999-09-10 20:59:04 +04:00
|
|
|
.It Fl t Ar timeout
|
|
|
|
Set the timeout before the automatic boot begins to the given number
|
|
|
|
of seconds.
|
|
|
|
.It Fl p Ar password
|
|
|
|
If supported by the boot program, set the password which must be
|
|
|
|
entered before the boot menu can be accessed.
|
1997-03-14 05:40:31 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The arguments are:
|
|
|
|
.Bl -tag -width rawdiskdevice
|
|
|
|
.It Ar bootfile
|
|
|
|
The name of the special object file
|
|
|
|
(typically
|
|
|
|
.Pa /usr/mdec/biosboot.sym )
|
|
|
|
where the first and second stage boot programs to be installed reside.
|
|
|
|
.It Ar rawdiskdevice
|
1997-06-14 02:14:58 +04:00
|
|
|
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
|
|
|
|
.Nx
|
|
|
|
portion of the disk and must contain a FFS filesystem. The
|
|
|
|
.Nm
|
|
|
|
program enforces its name to be in the form
|
1997-06-19 15:46:44 +04:00
|
|
|
.Dq /dev/r*
|
1997-06-14 02:14:58 +04:00
|
|
|
\&.
|
1997-03-14 05:40:31 +03:00
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
2000-10-13 05:20:58 +04:00
|
|
|
Assuming the system containing the boot program is in its typical place,
|
1997-03-14 05:40:31 +03:00
|
|
|
and you wished to make
|
|
|
|
.Pa /dev/fd0a
|
1997-06-14 02:14:58 +04:00
|
|
|
bootable. To install the boot blocks, one then would issue the command:
|
1997-03-14 05:40:31 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
installboot -f /usr/mdec/biosboot.sym /dev/rfd0a
|
|
|
|
.Ed
|
2000-10-13 05:20:58 +04:00
|
|
|
.Pp
|
1997-03-14 05:40:31 +03:00
|
|
|
Note that the -f option is needed if the floppy is unlabeled -- see
|
|
|
|
.Xr disklabel 8 .
|
2000-10-13 05:20:58 +04:00
|
|
|
Also, be sure to
|
|
|
|
.Xr newfs 8
|
|
|
|
the floppy before running installboot, as this is needed to copy a
|
|
|
|
kernel to it later, that the bootloader can boot then.
|
|
|
|
.Pp
|
|
|
|
It is also possible to make a bootstrap-only floppy without any
|
|
|
|
filesystem by using the following command:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
/usr/mdec/installboot -f -b 200 /usr/mdec/biosboot.sym /dev/rfd0a
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
To install new bootblocks on your
|
|
|
|
.Pa wd0
|
|
|
|
harddisk, use the following command:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
/usr/mdec/installboot /usr/mdec/biosboot.sym /dev/rwd0a
|
|
|
|
.Ed
|
2001-12-26 04:45:35 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr vnd 4 ,
|
|
|
|
.Xr boot 8 ,
|
|
|
|
.Xr disklabel 8 ,
|
|
|
|
.Xr init 8 ,
|
|
|
|
.Xr sysctl 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nx Ns Tn /i386
|
|
|
|
.Nm
|
|
|
|
command first appeared in
|
|
|
|
.Nx 1.3 .
|
1997-03-14 05:40:31 +03:00
|
|
|
.Sh BUGS
|
1998-11-09 03:41:17 +03:00
|
|
|
.Nx
|
|
|
|
is in transition from using the 386BSD MBR partition-ID of 165 (0xa5),
|
2001-09-06 03:53:22 +04:00
|
|
|
to using a new, unique partition-ID of 169 (0xa9).
|
1998-11-09 03:41:17 +03:00
|
|
|
.Nx
|
|
|
|
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
|
2001-09-06 03:53:22 +04:00
|
|
|
.Nm
|
1998-11-09 03:41:17 +03:00
|
|
|
to 1.3.3 or newer, rerun
|
2001-09-06 03:53:22 +04:00
|
|
|
.Nm
|
1998-11-09 03:41:17 +03:00
|
|
|
on the affected drives, and lastly use
|
|
|
|
.Xr fdisk 8
|
|
|
|
to change the MBR partition-ID of NetBSD partitions to 169.
|
|
|
|
.Pp
|
|
|
|
Note that the final step of changing MBR partition-IDs from 165 to 169
|
|
|
|
renders a disk unbootable by older
|
2001-09-06 03:53:22 +04:00
|
|
|
.Nx
|
1998-11-09 03:41:17 +03:00
|
|
|
kernels, which do not recognize the new ID.
|
|
|
|
.Pp
|
1998-02-06 08:54:12 +03:00
|
|
|
The
|
|
|
|
.Nx Ns Tn /i386
|
|
|
|
boot blocks can only read from the first 1024
|
1997-03-14 05:40:31 +03:00
|
|
|
cylinders of the disk because they use the BIOS to do their I/O. Thus,
|
|
|
|
it is advisable that
|
|
|
|
.Dq a
|
|
|
|
partitions reside entirely within the first 1024 cylinders.
|
|
|
|
.Pp
|
1997-06-14 02:14:58 +04:00
|
|
|
The BIOS partition
|
|
|
|
table must reflect the correct location of the
|
|
|
|
.Nx
|
|
|
|
portion according to disk geometry used by the BIOS. (This is automatically
|
|
|
|
the case if the
|
|
|
|
.Nx
|
|
|
|
portion is located at the beginning of the disk.)
|
|
|
|
.Pp
|
1997-03-14 05:40:31 +03:00
|
|
|
.Nm
|
1997-06-14 02:14:58 +04:00
|
|
|
requires access to the disks' raw partition.
|
1997-03-14 05:40:31 +03:00
|
|
|
That is not allowed with the kernel
|
|
|
|
.Dv securelevel
|
|
|
|
variable
|
|
|
|
.Po
|
|
|
|
see
|
|
|
|
.Xr sysctl 8
|
|
|
|
.Pc
|
|
|
|
set to a value greater than one, or with
|
|
|
|
.Dv securelevel
|
|
|
|
set to one if the
|
|
|
|
.Dq boot
|
1997-06-14 02:14:58 +04:00
|
|
|
partition is mounted.
|