NetBSD/share/man/man8/man8.i386/installboot.8

205 lines
6.4 KiB
Groff
Raw Normal View History

2001-08-18 16:25:25 +04:00
.\" $NetBSD: installboot.8,v 1.14 2001/08/18 12:25:25 enami 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.
.\"
.Dd June 13, 1997
1997-03-14 05:40:31 +03:00
.Dt INSTALLBOOT 8 i386
.Os
.Sh NAME
.Nm installboot
.Nd install disk bootstrap software
.Sh SYNOPSIS
.Nm installboot
.Op Fl nvf
1998-12-19 22:22:18 +03:00
.Op Fl b Ar bn
.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
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).
.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
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
.Dq /dev/r*
\&.
1997-03-14 05:40:31 +03:00
.El
.Sh EXAMPLES
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
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
.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 .
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
.Pp
1997-03-14 05:40:31 +03:00
.Sh BUGS
.Pp
.Nx
is in transition from using the 386BSD MBR partition-ID of 165 (0xa5),
to using a new, unique partition-ID of 169 (0xa9).
.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
.Nm
to 1.3.3 or newer, rerun
.Nm
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
.Nx
kernels, which do not recognize the new ID.
.Pp
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
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
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
partition is mounted.
.Sh SEE ALSO
2001-08-18 16:25:25 +04:00
.Xr vnd 4 ,
1997-03-14 05:40:31 +03:00
.Xr boot 8 ,
.Xr disklabel 8 ,
.Xr init 8 ,
2001-08-18 16:25:25 +04:00
.Xr sysctl 8
1997-03-14 05:40:31 +03:00
.Sh HISTORY
The
.Nx Ns Tn /i386
1997-03-14 05:40:31 +03:00
.Nm
command first appeared in
.Nx 1.3 .