2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
25 .Nd Utility to manage boot environments on ZFS
36 .Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot
45 .Ar beName Ns Op Cm @ Ns Ar snapshot
55 .Oo Bro Fl o Ar key Ns Cm = Ns Ar value | Fl u Ar key Brc Oc Ns ...
57 .Op Ar utility Op Ar argument ...
63 .Oo Bro Fl c Ar property | Fl C Ar property Brc Oc
73 .Brq Cm ujail | unjail
74 .Brq Ar jailId | jailName | beName
76 .Brq Cm umount | unmount
85 command is used to setup and interact with ZFS boot environments, which are
86 bootable clones of datasets.
89 allow the system to be upgraded, while preserving the old system environment in
90 a separate ZFS dataset.
92 The following commands are supported by
94 .Bl -tag -width activate
102 as the default boot filesystem.
105 flag is given, this takes effect only for the next boot.
108 removes temporary boot once configuration.
109 Without temporary configuration, the next boot will use zfs dataset specified
116 Performs a silent sanity check on the current system.
117 If boot environments are supported and used,
119 will exit with a status code of 0.
120 Any other status code is not currently defined and may, in the future, grow
121 special meaning for different degrees of sanity check failures.
125 .Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot
128 Create a new boot environment named
133 flag is given, a recursive boot environment will be made.
137 flag is specified, the new environment will be cloned from the given
140 .Ar beName Ns Cm @ Ns Ar snapshot .
141 Otherwise, the new environment will be created from the currently booted environment.
145 is creating from another boot environment, a snapshot of that boot environment will be created to clone from.
151 Create a snapshot of the boot environment named
156 flag is given, a recursive snapshot of the boot environment will be created.
157 A snapshot is created for each descendant dataset of the boot environment.
159 No new boot environment is created with this command.
163 .Ar beName Ns Op Cm @ Ns Ar snapshot
168 .Ar beName Ns Cm @ Ns Ar snapshot
169 snapshot without confirmation, unlike in
173 will automatically unmount without confirmation.
177 will warn that it is not destroying the origin of
181 flag may be specified to destroy the origin as well.
182 .It Cm export Ar sourceBe
188 must be piped or redirected to a file.
189 .It Cm import Ar targetBe
197 .Oo Bro Fl o Ar key Ns Cm = Ns Ar value | Fl u Ar key Brc Oc Ns ...
199 .Op Ar utility Op Ar argument ...
201 Create a jail of the given boot environment.
206 arguments may be specified.
208 will set a jail parameter, and
210 will unset a jail parameter.
212 By default, jails are created in interactive mode and
215 executed within the jail.
218 is specified, it will be executed instead of
220 The jail will be destroyed and the boot environment unmounted when the command
221 finishes executing, unless the
223 argument is specified.
227 argument enables batch mode, thereby disabling interactive mode.
230 argument will be ignored in batch mode.
237 must be set, the default values are specified below.
240 .Ar key Ns Cm = Ns Ar value
241 pairs are interpreted as jail parameters as described in
243 The following default parameters are provided:
244 .Bl -column "allow.mount.devfs" ""
245 .It Va allow.mount Ta Cm true
246 .It Va allow.mount.devfs Ta Cm true
247 .It Va enforce_statfs Ta Cm 1
248 .It Va name Ta Set to jail ID.
249 .It Va host.hostname Ta Va bootenv
250 .It Va path Ta Set to a path in Pa /tmp
255 All default parameters may be overwritten.
259 .Oo Bro Fl c Ar property | Fl C Ar property Brc Oc
262 Display all boot environments.
265 field indicates whether the boot environment is active now
269 is used on next boot once
274 .Bl -tag -width indent
276 Display all datasets.
278 Display the full space usage for each boot environment, assuming all
279 other boot environments were destroyed.
282 Do not print headers and separate fields by a single tab instead of
283 arbitrary white space.
285 Display all snapshots as well.
287 Sort boot environments by given property name.
288 The following properties are supported:
290 .Bl -tag -width 4n -offset indent -compact
291 .It name (default output)
302 option, but displays in descending order.
307 option is ignored when either the
312 .It Cm mount Ar beName Op Ar mountpoint
313 Temporarily mount the boot environment.
314 Mount at the specified
317 .It Cm rename Ar origBeName newBeName
322 The boot environment will not be unmounted in order for this rename to occur.
323 .It Cm ujail Brq Ar jailId | jailName | beName
324 .It Cm unjail Brq Ar jailId | jailName | beName
325 Destroy the jail created from the given boot environment.
336 Unmount the given boot environment, if it is mounted.
339 will force the unmount if busy.
343 prints usage information if
351 \" To fill in with jail upgrade example when behavior is firm.
363 and was implemented as a project for the 2017 Summer of Code, along with
368 .An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in .
371 was written and is maintained by
372 .An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl .
374 .An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net
377 manual page that this one is derived from.