xref: /freebsd/stand/i386/gptzfsboot/gptzfsboot.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1ca987d46SWarner Losh.\" Copyright (c) 2014 Andriy Gapon <avg@FreeBSD.org>
2ca987d46SWarner Losh.\" All rights reserved.
3ca987d46SWarner Losh.\"
4ca987d46SWarner Losh.\" Redistribution and use in source and binary forms, with or without
5ca987d46SWarner Losh.\" modification, are permitted provided that the following conditions
6ca987d46SWarner Losh.\" are met:
7ca987d46SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
8ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
9ca987d46SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
10ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
11ca987d46SWarner Losh.\"    documentation and/or other materials provided with the distribution.
12ca987d46SWarner Losh.\"
13ca987d46SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14ca987d46SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15ca987d46SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16ca987d46SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17ca987d46SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18ca987d46SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19ca987d46SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20ca987d46SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21ca987d46SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22ca987d46SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23ca987d46SWarner Losh.\" SUCH DAMAGE.
24ca987d46SWarner Losh.\"
25ca987d46SWarner Losh.Dd September 15, 2014
26ca987d46SWarner Losh.Dt GPTZFSBOOT 8
27ca987d46SWarner Losh.Os
28ca987d46SWarner Losh.Sh NAME
29ca987d46SWarner Losh.Nm gptzfsboot
30ca987d46SWarner Losh.Nd GPT bootcode for ZFS on BIOS-based computers
31ca987d46SWarner Losh.Sh DESCRIPTION
32ca987d46SWarner Losh.Nm
33ca987d46SWarner Loshis used on BIOS-based computers to boot from a filesystem in
34ca987d46SWarner Losha ZFS pool.
35ca987d46SWarner Losh.Nm
36ca987d46SWarner Loshis installed in a
37ca987d46SWarner Losh.Cm freebsd-boot
38ca987d46SWarner Loshpartition of a GPT-partitioned disk with
39ca987d46SWarner Losh.Xr gpart 8 .
40ca987d46SWarner Losh.Sh IMPLEMENTATION NOTES
41ca987d46SWarner LoshThe GPT standard allows a variable number of partitions, but
42ca987d46SWarner Losh.Nm
43ca987d46SWarner Loshonly boots from tables with 128 partitions or less.
44ca987d46SWarner Losh.Sh BOOTING
45ca987d46SWarner Losh.Nm
46ca987d46SWarner Loshtries to find all ZFS pools that are composed of BIOS-visible
47ca987d46SWarner Loshhard disks or partitions on them.
48ca987d46SWarner Losh.Nm
49ca987d46SWarner Loshlooks for ZFS device labels on all visible disks and in discovered
50ca987d46SWarner Loshsupported partitions for all supported partition scheme types.
51ca987d46SWarner LoshThe search starts with the disk from which
52ca987d46SWarner Losh.Nm
53ca987d46SWarner Loshitself was loaded.
54ca987d46SWarner LoshOther disks are probed in BIOS defined order.
55ca987d46SWarner LoshAfter a disk is probed and
56ca987d46SWarner Losh.Nm
57ca987d46SWarner Loshdetermines that the whole disk is not a ZFS pool member, the
58ca987d46SWarner Loshindividual partitions are probed in their partition table order.
59ca987d46SWarner LoshCurrently GPT and MBR partition schemes are supported.
60ca987d46SWarner LoshWith the GPT scheme, only partitions of type
61ca987d46SWarner Losh.Cm freebsd-zfs
62ca987d46SWarner Loshare probed.
63ca987d46SWarner LoshThe first pool seen during probing is used as a default boot pool.
64ca987d46SWarner Losh.Pp
65ca987d46SWarner LoshThe filesystem specified by the
66ca987d46SWarner Losh.Cm bootfs
67ca987d46SWarner Loshproperty of the pool is used as a default boot filesystem.
68ca987d46SWarner LoshIf the
69ca987d46SWarner Losh.Cm bootfs
70ca987d46SWarner Loshproperty is not set, then the root filesystem of the pool is used as
71ca987d46SWarner Loshthe default.
72*1a14a0bfSWarner Losh.Xr loader 8
73ca987d46SWarner Loshis loaded from the boot filesystem.
74ca987d46SWarner LoshIf
75ca987d46SWarner Losh.Pa /boot.config
76ca987d46SWarner Loshor
77ca987d46SWarner Losh.Pa /boot/config
78ca987d46SWarner Loshis present in the boot filesystem, boot options are read from it
79ca987d46SWarner Loshin the same way as
80ca987d46SWarner Losh.Xr boot 8 .
81ca987d46SWarner Losh.Pp
82ca987d46SWarner LoshThe ZFS GUIDs of the first successfully probed device and the first
83ca987d46SWarner Loshdetected pool are made available to
84*1a14a0bfSWarner Losh.Xr loader 8
85ca987d46SWarner Loshin the
86ca987d46SWarner Losh.Cm vfs.zfs.boot.primary_vdev
87ca987d46SWarner Loshand
88ca987d46SWarner Losh.Cm vfs.zfs.boot.primary_pool
89ca987d46SWarner Loshvariables.
90ca987d46SWarner Losh.Sh USAGE
91ca987d46SWarner LoshNormally
92ca987d46SWarner Losh.Nm
93ca987d46SWarner Loshwill boot in fully automatic mode.
94ca987d46SWarner LoshHowever, like
95ca987d46SWarner Losh.Xr boot 8 ,
96ca987d46SWarner Loshit is possible to interrupt the automatic boot process and interact with
97ca987d46SWarner Losh.Nm
98ca987d46SWarner Loshthrough a prompt.
99ca987d46SWarner Losh.Nm
100ca987d46SWarner Loshaccepts all the options that
101ca987d46SWarner Losh.Xr boot 8
102ca987d46SWarner Loshsupports.
103ca987d46SWarner Losh.Pp
104ca987d46SWarner LoshThe filesystem specification and the path to
105*1a14a0bfSWarner Losh.Xr loader 8
106ca987d46SWarner Loshare different from
107ca987d46SWarner Losh.Xr boot 8 .
108ca987d46SWarner LoshThe format is
109ca987d46SWarner Losh.Pp
110ca987d46SWarner Losh.Sm off
111ca987d46SWarner Losh.Oo zfs:pool/filesystem: Oc Oo /path/to/loader Oc
112ca987d46SWarner Losh.Sm on
113ca987d46SWarner Losh.Pp
114ca987d46SWarner LoshBoth the filesystem and the path can be specified.
115ca987d46SWarner LoshIf only a path is specified, then the default filesystem is used.
116ca987d46SWarner LoshIf only a pool and filesystem are specified, then
117*1a14a0bfSWarner Losh.Pa /boot/loader
118ca987d46SWarner Loshis used as a path.
119ca987d46SWarner Losh.Pp
120ca987d46SWarner LoshAdditionally, the
121ca987d46SWarner Losh.Ic status
122ca987d46SWarner Loshcommand can be used to query information about discovered pools.
123ca987d46SWarner LoshThe output format is similar to that of
124ca987d46SWarner Losh.Cm zpool status
125ca987d46SWarner Losh.Pq see Xr zpool 8 .
126ca987d46SWarner Losh.Pp
127ca987d46SWarner LoshThe configured or automatically determined ZFS boot filesystem is
128ca987d46SWarner Loshstored in the
129*1a14a0bfSWarner Losh.Xr loader 8
130ca987d46SWarner Losh.Cm loaddev
131ca987d46SWarner Loshvariable, and also set as the initial value of the
132ca987d46SWarner Losh.Cm currdev
133ca987d46SWarner Loshvariable.
134ca987d46SWarner Losh.Sh FILES
135ca987d46SWarner Losh.Bl -tag -width /boot/gptzfsboot -compact
136ca987d46SWarner Losh.It Pa /boot/gptzfsboot
137ca987d46SWarner Loshboot code binary
138ca987d46SWarner Losh.It Pa /boot.config
139ca987d46SWarner Loshparameters for the boot block
140ca987d46SWarner Losh.Pq optional
141ca987d46SWarner Losh.It Pa /boot/config
142ca987d46SWarner Loshalternative parameters for the boot block
143ca987d46SWarner Losh.Pq optional
144ca987d46SWarner Losh.El
145ca987d46SWarner Losh.Sh EXAMPLES
146ca987d46SWarner Losh.Nm
147ca987d46SWarner Loshis typically installed in combination with a
148ca987d46SWarner Losh.Dq protective MBR
149ca987d46SWarner Losh.Po
150ca987d46SWarner Loshsee
151ca987d46SWarner Losh.Xr gpart 8
152ca987d46SWarner Losh.Pc .
153ca987d46SWarner LoshTo install
154ca987d46SWarner Losh.Nm
155ca987d46SWarner Loshon the
156ca987d46SWarner Losh.Pa ada0
157ca987d46SWarner Loshdrive:
158ca987d46SWarner Losh.Bd -literal -offset indent
159ca987d46SWarner Loshgpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
160ca987d46SWarner Losh.Ed
161ca987d46SWarner Losh.Pp
162ca987d46SWarner Losh.Nm
163ca987d46SWarner Loshcan also be installed without the PMBR:
164ca987d46SWarner Losh.Bd -literal -offset indent
165ca987d46SWarner Loshgpart bootcode -p /boot/gptzfsboot -i 1 ada0
166ca987d46SWarner Losh.Ed
167ca987d46SWarner Losh.Sh SEE ALSO
168ca987d46SWarner Losh.Xr boot.config 5 ,
169ca987d46SWarner Losh.Xr boot 8 ,
170ca987d46SWarner Losh.Xr gpart 8 ,
171ca987d46SWarner Losh.Xr loader 8 ,
172ca987d46SWarner Losh.Xr zpool 8
173ca987d46SWarner Losh.Sh HISTORY
174ca987d46SWarner Losh.Nm
175ca987d46SWarner Loshappeared in FreeBSD 7.3.
176ca987d46SWarner Losh.Sh AUTHORS
177ca987d46SWarner LoshThis manual page was written by
178ca987d46SWarner Losh.An Andriy Gapon Aq avg@FreeBSD.org .
179ca987d46SWarner Losh.Sh BUGS
180ca987d46SWarner Losh.Nm
181ca987d46SWarner Loshlooks for ZFS meta-data only in MBR partitions
182ca987d46SWarner Losh.Pq known on FreeBSD as slices .
183ca987d46SWarner LoshIt does not look into BSD
184ca987d46SWarner Losh.Xr disklabel 8
185ca987d46SWarner Loshpartitions that are traditionally called partitions.
186ca987d46SWarner LoshIf a disklabel partition happens to be placed so that ZFS meta-data can be
187ca987d46SWarner Loshfound at the fixed offsets relative to a slice, then
188ca987d46SWarner Losh.Nm
189ca987d46SWarner Loshwill recognize the partition as a part of a ZFS pool,
190ca987d46SWarner Loshbut this is not guaranteed to happen.
191