1.\"	$OpenBSD: installboot.8,v 1.5 2021/07/20 14:51:56 kettenis Exp $
2.\"
3.\" Copyright (c) 2013, 2014 Joel Sing
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 20 2021 $
18.Dt INSTALLBOOT 8
19.Os
20.Sh NAME
21.Nm installboot
22.Nd install bootstrap on a disk
23.Sh SYNOPSIS
24.Nm installboot
25.Op Fl npv
26.Op Fl r Ar root
27.Ar disk
28.Op Ar stage1 Op Ar stage2
29.Sh DESCRIPTION
30.Nm
31installs bootstrap on the specified disk.
32The exact process used depends on the system architecture, however there is
33generally a primary bootstrap (often known as a boot block) and a
34secondary bootstrap (often known as a boot loader).
35Some architectures only require a single stage bootstrap, which is written to
36the beginning of the disk.
37.Pp
38The options are as follows:
39.Bl -tag -width Ds
40.It Fl n
41Perform a dry run - do not actually write any bootstrap to the disk.
42.It Fl p
43Prepare filesystem.
44This will create a new filesystem on the partition reserved for the
45boot loader on architectures that require one.
46.It Fl r Ar root
47Specify the mount point of the
48.Ar root
49filesystem to operate on, defaulting to
50.Ar / .
51.It Fl v
52Increase verbosity during operation.
53.It Ar disk
54Specify the
55.Ar disk
56to install the bootstrap on.
57This may be specified using a full pathname, an abbreviated disk form,
58or a disklabel UID.
59.It Ar stage1
60Specify the file to use for the primary bootstrap.
61If not specified, the default for this architecture will be used.
62.It Ar stage2
63Specify the file to use for the secondary bootstrap.
64If not specified, the default for this architecture will be used.
65.El
66.Sh EXAMPLES
67In its most basic form, to install bootstrap on
68.Ar disk
69sd0, using the default primary and secondary bootstrap files:
70.Bd -literal -offset 3n
71# installboot sd0
72.Ed
73.Pp
74To install bootstrap on an
75.Ox
76amd64 machine, using
77.Ar /usr/mdec/biosboot
78as the primary bootstrap and
79.Ar /usr/mdec/boot
80as the secondary bootstrap:
81.Bd -literal -offset 3n
82# installboot -v wd0 /usr/mdec/biosboot /usr/mdec/boot
83.Ed
84.Sh SEE ALSO
85.Xr disklabel 8
86