xref: /freebsd/stand/i386/zfsboot/zfsboot.8 (revision a64729f5077d77e13b9497cb33ecb3c82e606ee8)
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.Dd March 27, 2018
26.Dt ZFSBOOT 8
27.Os
28.Sh NAME
29.Nm zfsboot
30.Nd bootcode for ZFS on BIOS-based computers
31.Sh DESCRIPTION
32.Nm
33is used on BIOS-based computers to boot from a filesystem in
34a ZFS pool.
35.Nm
36is installed in two parts on a disk or a partition used by a ZFS pool.
37The first part, a single-sector starter boot block, is installed
38at the beginning of the disk or partition.
39The second part, a main boot block, is installed at a special offset
40within the disk or partition.
41Both areas are reserved by the ZFS on-disk specification for boot use.
42If
43.Nm
44is installed in a partition, then that partition should be made
45bootable using appropriate configuration and boot blocks described in
46.Xr boot 8 .
47.Sh BOOTING
48The
49.Nm
50boot process is very similar to that of
51.Xr gptzfsboot 8 .
52One significant difference is that
53.Nm
54does not currently support the GPT partitioning scheme.
55Thus only whole disks and MBR partitions, traditionally referred to as
56slices, are probed for ZFS disk labels.
57See the BUGS section in
58.Xr gptzfsboot 8
59for some limitations of the MBR scheme support.
60.Sh USAGE
61.Nm
62supports all the same prompt and configuration file arguments as
63.Xr gptzfsboot 8 .
64.Sh FILES
65.Bl -tag -width /boot/zfsboot -compact
66.It Pa /boot/zfsboot
67boot code binary
68.It Pa /boot.config
69parameters for the boot block
70.Pq optional
71.It Pa /boot/config
72alternative parameters for the boot block
73.Pq optional
74.El
75.Sh EXAMPLES
76.Nm
77is typically installed using
78.Xr dd 1 .
79To install
80.Nm
81on the
82.Pa ada0
83drive:
84.Bd -literal -offset indent
85dd if=/boot/zfsboot of=/dev/ada0 count=1
86dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024
87.Ed
88.Pp
89If the drive is currently in use, the GEOM safety will prevent writes
90and must be disabled before running the above commands:
91.Bd -literal -offset indent
92sysctl kern.geom.debugflags=0x10
93.Ed
94.Pp
95.Nm
96can also be installed in an MBR slice:
97.Bd -literal -offset indent
98gpart create -s mbr ada0
99gpart add -t freebsd ada0
100gpart bootcode -b /boot/boot0 ada0
101gpart set -a active -i 1 ada0
102dd if=/dev/zero of=/dev/ada0s1 count=2
103dd if=/boot/zfsboot of=/dev/ada0s1 count=1
104dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024
105.Ed
106.Pp
107Note that commands to create and populate a pool are not shown
108in the example above.
109.Sh SEE ALSO
110.Xr dd 1 ,
111.Xr boot.config 5 ,
112.Xr boot 8 ,
113.Xr gptzfsboot 8 ,
114.Xr loader 8 ,
115.Xr zpool 8
116.Sh HISTORY
117.Nm
118appeared in FreeBSD 7.3.
119.Sh AUTHORS
120This manual page was written by
121.An Andriy Gapon Aq avg@FreeBSD.org .
122.Sh BUGS
123Installing
124.Nm
125with
126.Xr dd 1
127is a hack.
128ZFS needs a command to properly install
129.Nm
130onto a ZFS-controlled disk or partition.
131