xref: /freebsd/stand/i386/gptzfsboot/gptzfsboot.8 (revision 1a14a0bfb71d935583ca1a3f3ce7e3c6648c10f9)
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.\" $FreeBSD$
26ca987d46SWarner Losh.\"
27ca987d46SWarner Losh.Dd September 15, 2014
28ca987d46SWarner Losh.Dt GPTZFSBOOT 8
29ca987d46SWarner Losh.Os
30ca987d46SWarner Losh.Sh NAME
31ca987d46SWarner Losh.Nm gptzfsboot
32ca987d46SWarner Losh.Nd GPT bootcode for ZFS on BIOS-based computers
33ca987d46SWarner Losh.Sh DESCRIPTION
34ca987d46SWarner Losh.Nm
35ca987d46SWarner Loshis used on BIOS-based computers to boot from a filesystem in
36ca987d46SWarner Losha ZFS pool.
37ca987d46SWarner Losh.Nm
38ca987d46SWarner Loshis installed in a
39ca987d46SWarner Losh.Cm freebsd-boot
40ca987d46SWarner Loshpartition of a GPT-partitioned disk with
41ca987d46SWarner Losh.Xr gpart 8 .
42ca987d46SWarner Losh.Sh IMPLEMENTATION NOTES
43ca987d46SWarner LoshThe GPT standard allows a variable number of partitions, but
44ca987d46SWarner Losh.Nm
45ca987d46SWarner Loshonly boots from tables with 128 partitions or less.
46ca987d46SWarner Losh.Sh BOOTING
47ca987d46SWarner Losh.Nm
48ca987d46SWarner Loshtries to find all ZFS pools that are composed of BIOS-visible
49ca987d46SWarner Loshhard disks or partitions on them.
50ca987d46SWarner Losh.Nm
51ca987d46SWarner Loshlooks for ZFS device labels on all visible disks and in discovered
52ca987d46SWarner Loshsupported partitions for all supported partition scheme types.
53ca987d46SWarner LoshThe search starts with the disk from which
54ca987d46SWarner Losh.Nm
55ca987d46SWarner Loshitself was loaded.
56ca987d46SWarner LoshOther disks are probed in BIOS defined order.
57ca987d46SWarner LoshAfter a disk is probed and
58ca987d46SWarner Losh.Nm
59ca987d46SWarner Loshdetermines that the whole disk is not a ZFS pool member, the
60ca987d46SWarner Loshindividual partitions are probed in their partition table order.
61ca987d46SWarner LoshCurrently GPT and MBR partition schemes are supported.
62ca987d46SWarner LoshWith the GPT scheme, only partitions of type
63ca987d46SWarner Losh.Cm freebsd-zfs
64ca987d46SWarner Loshare probed.
65ca987d46SWarner LoshThe first pool seen during probing is used as a default boot pool.
66ca987d46SWarner Losh.Pp
67ca987d46SWarner LoshThe filesystem specified by the
68ca987d46SWarner Losh.Cm bootfs
69ca987d46SWarner Loshproperty of the pool is used as a default boot filesystem.
70ca987d46SWarner LoshIf the
71ca987d46SWarner Losh.Cm bootfs
72ca987d46SWarner Loshproperty is not set, then the root filesystem of the pool is used as
73ca987d46SWarner Loshthe default.
74*1a14a0bfSWarner Losh.Xr loader 8
75ca987d46SWarner Loshis loaded from the boot filesystem.
76ca987d46SWarner LoshIf
77ca987d46SWarner Losh.Pa /boot.config
78ca987d46SWarner Loshor
79ca987d46SWarner Losh.Pa /boot/config
80ca987d46SWarner Loshis present in the boot filesystem, boot options are read from it
81ca987d46SWarner Loshin the same way as
82ca987d46SWarner Losh.Xr boot 8 .
83ca987d46SWarner Losh.Pp
84ca987d46SWarner LoshThe ZFS GUIDs of the first successfully probed device and the first
85ca987d46SWarner Loshdetected pool are made available to
86*1a14a0bfSWarner Losh.Xr loader 8
87ca987d46SWarner Loshin the
88ca987d46SWarner Losh.Cm vfs.zfs.boot.primary_vdev
89ca987d46SWarner Loshand
90ca987d46SWarner Losh.Cm vfs.zfs.boot.primary_pool
91ca987d46SWarner Loshvariables.
92ca987d46SWarner Losh.Sh USAGE
93ca987d46SWarner LoshNormally
94ca987d46SWarner Losh.Nm
95ca987d46SWarner Loshwill boot in fully automatic mode.
96ca987d46SWarner LoshHowever, like
97ca987d46SWarner Losh.Xr boot 8 ,
98ca987d46SWarner Loshit is possible to interrupt the automatic boot process and interact with
99ca987d46SWarner Losh.Nm
100ca987d46SWarner Loshthrough a prompt.
101ca987d46SWarner Losh.Nm
102ca987d46SWarner Loshaccepts all the options that
103ca987d46SWarner Losh.Xr boot 8
104ca987d46SWarner Loshsupports.
105ca987d46SWarner Losh.Pp
106ca987d46SWarner LoshThe filesystem specification and the path to
107*1a14a0bfSWarner Losh.Xr loader 8
108ca987d46SWarner Loshare different from
109ca987d46SWarner Losh.Xr boot 8 .
110ca987d46SWarner LoshThe format is
111ca987d46SWarner Losh.Pp
112ca987d46SWarner Losh.Sm off
113ca987d46SWarner Losh.Oo zfs:pool/filesystem: Oc Oo /path/to/loader Oc
114ca987d46SWarner Losh.Sm on
115ca987d46SWarner Losh.Pp
116ca987d46SWarner LoshBoth the filesystem and the path can be specified.
117ca987d46SWarner LoshIf only a path is specified, then the default filesystem is used.
118ca987d46SWarner LoshIf only a pool and filesystem are specified, then
119*1a14a0bfSWarner Losh.Pa /boot/loader
120ca987d46SWarner Loshis used as a path.
121ca987d46SWarner Losh.Pp
122ca987d46SWarner LoshAdditionally, the
123ca987d46SWarner Losh.Ic status
124ca987d46SWarner Loshcommand can be used to query information about discovered pools.
125ca987d46SWarner LoshThe output format is similar to that of
126ca987d46SWarner Losh.Cm zpool status
127ca987d46SWarner Losh.Pq see Xr zpool 8 .
128ca987d46SWarner Losh.Pp
129ca987d46SWarner LoshThe configured or automatically determined ZFS boot filesystem is
130ca987d46SWarner Loshstored in the
131*1a14a0bfSWarner Losh.Xr loader 8
132ca987d46SWarner Losh.Cm loaddev
133ca987d46SWarner Loshvariable, and also set as the initial value of the
134ca987d46SWarner Losh.Cm currdev
135ca987d46SWarner Loshvariable.
136ca987d46SWarner Losh.Sh FILES
137ca987d46SWarner Losh.Bl -tag -width /boot/gptzfsboot -compact
138ca987d46SWarner Losh.It Pa /boot/gptzfsboot
139ca987d46SWarner Loshboot code binary
140ca987d46SWarner Losh.It Pa /boot.config
141ca987d46SWarner Loshparameters for the boot block
142ca987d46SWarner Losh.Pq optional
143ca987d46SWarner Losh.It Pa /boot/config
144ca987d46SWarner Loshalternative parameters for the boot block
145ca987d46SWarner Losh.Pq optional
146ca987d46SWarner Losh.El
147ca987d46SWarner Losh.Sh EXAMPLES
148ca987d46SWarner Losh.Nm
149ca987d46SWarner Loshis typically installed in combination with a
150ca987d46SWarner Losh.Dq protective MBR
151ca987d46SWarner Losh.Po
152ca987d46SWarner Loshsee
153ca987d46SWarner Losh.Xr gpart 8
154ca987d46SWarner Losh.Pc .
155ca987d46SWarner LoshTo install
156ca987d46SWarner Losh.Nm
157ca987d46SWarner Loshon the
158ca987d46SWarner Losh.Pa ada0
159ca987d46SWarner Loshdrive:
160ca987d46SWarner Losh.Bd -literal -offset indent
161ca987d46SWarner Loshgpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
162ca987d46SWarner Losh.Ed
163ca987d46SWarner Losh.Pp
164ca987d46SWarner Losh.Nm
165ca987d46SWarner Loshcan also be installed without the PMBR:
166ca987d46SWarner Losh.Bd -literal -offset indent
167ca987d46SWarner Loshgpart bootcode -p /boot/gptzfsboot -i 1 ada0
168ca987d46SWarner Losh.Ed
169ca987d46SWarner Losh.Sh SEE ALSO
170ca987d46SWarner Losh.Xr boot.config 5 ,
171ca987d46SWarner Losh.Xr boot 8 ,
172ca987d46SWarner Losh.Xr gpart 8 ,
173ca987d46SWarner Losh.Xr loader 8 ,
174ca987d46SWarner Losh.Xr zpool 8
175ca987d46SWarner Losh.Sh HISTORY
176ca987d46SWarner Losh.Nm
177ca987d46SWarner Loshappeared in FreeBSD 7.3.
178ca987d46SWarner Losh.Sh AUTHORS
179ca987d46SWarner LoshThis manual page was written by
180ca987d46SWarner Losh.An Andriy Gapon Aq avg@FreeBSD.org .
181ca987d46SWarner Losh.Sh BUGS
182ca987d46SWarner Losh.Nm
183ca987d46SWarner Loshlooks for ZFS meta-data only in MBR partitions
184ca987d46SWarner Losh.Pq known on FreeBSD as slices .
185ca987d46SWarner LoshIt does not look into BSD
186ca987d46SWarner Losh.Xr disklabel 8
187ca987d46SWarner Loshpartitions that are traditionally called partitions.
188ca987d46SWarner LoshIf a disklabel partition happens to be placed so that ZFS meta-data can be
189ca987d46SWarner Loshfound at the fixed offsets relative to a slice, then
190ca987d46SWarner Losh.Nm
191ca987d46SWarner Loshwill recognize the partition as a part of a ZFS pool,
192ca987d46SWarner Loshbut this is not guaranteed to happen.
193