xref: /freebsd/stand/i386/zfsboot/zfsboot.8 (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1.\" Copyright (c) 2014 Andriy Gapon <avg@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd March 27, 2018
28.Dt ZFSBOOT 8
29.Os
30.Sh NAME
31.Nm zfsboot
32.Nd bootcode for ZFS on BIOS-based computers
33.Sh DESCRIPTION
34.Nm
35is used on BIOS-based computers to boot from a filesystem in
36a ZFS pool.
37.Nm
38is installed in two parts on a disk or a partition used by a ZFS pool.
39The first part, a single-sector starter boot block, is installed
40at the beginning of the disk or partition.
41The second part, a main boot block, is installed at a special offset
42within the disk or partition.
43Both areas are reserved by the ZFS on-disk specification for boot use.
44If
45.Nm
46is installed in a partition, then that partition should be made
47bootable using appropriate configuration and boot blocks described in
48.Xr boot 8 .
49.Sh BOOTING
50The
51.Nm
52boot process is very similar to that of
53.Xr gptzfsboot 8 .
54One significant difference is that
55.Nm
56does not currently support the GPT partitioning scheme.
57Thus only whole disks and MBR partitions, traditionally referred to as
58slices, are probed for ZFS disk labels.
59See the BUGS section in
60.Xr gptzfsboot 8
61for some limitations of the MBR scheme support.
62.Sh USAGE
63.Nm
64supports all the same prompt and configuration file arguments as
65.Xr gptzfsboot 8 .
66.Sh FILES
67.Bl -tag -width /boot/zfsboot -compact
68.It Pa /boot/zfsboot
69boot code binary
70.It Pa /boot.config
71parameters for the boot block
72.Pq optional
73.It Pa /boot/config
74alternative parameters for the boot block
75.Pq optional
76.El
77.Sh EXAMPLES
78.Nm
79is typically installed using
80.Xr dd 1 .
81To install
82.Nm
83on the
84.Pa ada0
85drive:
86.Bd -literal -offset indent
87dd if=/boot/zfsboot of=/dev/ada0 count=1
88dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024
89.Ed
90.Pp
91If the drive is currently in use, the GEOM safety will prevent writes
92and must be disabled before running the above commands:
93.Bd -literal -offset indent
94sysctl kern.geom.debugflags=0x10
95.Ed
96.Pp
97.Nm
98can also be installed in an MBR slice:
99.Bd -literal -offset indent
100gpart create -s mbr ada0
101gpart add -t freebsd ada0
102gpart bootcode -b /boot/boot0 ada0
103gpart set -a active -i 1 ada0
104dd if=/dev/zero of=/dev/ada0s1 count=2
105dd if=/boot/zfsboot of=/dev/ada0s1 count=1
106dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024
107.Ed
108.Pp
109Note that commands to create and populate a pool are not shown
110in the example above.
111.Sh SEE ALSO
112.Xr dd 1 ,
113.Xr boot.config 5 ,
114.Xr boot 8 ,
115.Xr gptzfsboot 8 ,
116.Xr loader 8 ,
117.Xr zpool 8
118.Sh HISTORY
119.Nm
120appeared in FreeBSD 7.3.
121.Sh AUTHORS
122This manual page was written by
123.An Andriy Gapon Aq avg@FreeBSD.org .
124.Sh BUGS
125Installing
126.Nm
127with
128.Xr dd 1
129is a hack.
130ZFS needs a command to properly install
131.Nm
132onto a ZFS-controlled disk or partition.
133