]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/bectl/bectl.8
dts: Import DTS for arm64
[FreeBSD/FreeBSD.git] / sbin / bectl / bectl.8
1 .\"
2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 .\"
4 .\" Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\"
17 .\"     @(#)be.1
18 .\"
19 .\" $FreeBSD$
20 .\"
21 .Dd August 22, 2018
22 .Dt BECTL 8
23 .Os
24 .Sh NAME
25 .Nm bectl
26 .Nd Utility to manage Boot Environments on ZFS
27 .Sh SYNOPSIS
28 .Nm
29 .Cm activate
30 .Op Fl t
31 .Ar beName
32 .Nm
33 .Cm create
34 .Op Fl r
35 .Op Fl e Brq Ar nonActiveBe | beName@snapshot
36 .Ar beName
37 .Nm
38 .Cm create
39 .Op Fl r
40 .Ar beName@snapshot
41 .Nm
42 .Cm destroy
43 .Op Fl F
44 .Brq Ar beName | beName@snapshot
45 .Nm
46 .Cm export
47 .Ar sourceBe
48 .Nm
49 .Cm import
50 .Ar targetBe
51 .Nm
52 .Cm jail
53 .Brq Fl b | Fl U
54 .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ...
55 .Brq Ar jailID | jailName
56 .Ar bootenv
57 .Op Ar utility Op Ar argument ...
58 .Nm
59 .Cm list
60 .Op Fl DHas
61 .Nm
62 .Cm mount
63 .Ar beName
64 .Op mountpoint
65 .Nm
66 .Cm rename
67 .Ar origBeName
68 .Ar newBeName
69 .Nm
70 .Brq Cm ujail | unjail
71 .Brq Ar jailID | jailName
72 .Ar bootenv
73 .Nm
74 .Brq Cm umount | unmount
75 .Op Fl f
76 .Ar beName
77 .Sh DESCRIPTION
78 The
79 .Nm
80 command is used to setup and interact with ZFS boot environments, which are
81 bootable clones of datasets.
82 .Pp
83 .Em Boot Environments
84 allows the system to be upgraded, while preserving the old system environment in
85 a separate ZFS dataset.
86 .Sh COMMANDS
87 The following commands are supported by
88 .Nm :
89 .Bl -tag -width activate
90 .It Xo
91 .Cm activate
92 .Op Fl t
93 .Ar beName
94 .Xc
95 Activate the given
96 .Ar beName
97 as the default boot filesystem.
98 If the
99 .Op Fl t
100 flag is given, this takes effect only for the next boot.
101 .It Xo
102 .Cm create
103 .Op Fl r
104 .Op Fl e Brq Ar nonActiveBe | beName@snapshot
105 .Ar beName
106 .Xc
107 Creates a new boot environment named
108 .Ar beName .
109 If the
110 .Fl e
111 argument is specified, the new environment will be cloned from the given
112 .Brq Ar nonActiveBe | Ar beName@snapshot .
113 If the
114 .Fl r
115 flag is given, a recursive boot environment will be made.
116 .It Xo
117 .Cm create
118 .Op Fl r
119 .Ar beName@snapshot
120 .Xc
121 Creates a snapshot of the existing boot environment named
122 .Ar beName .
123 If the
124 .Fl r
125 flag is given, a recursive boot environment will be made.
126 .It Xo
127 .Cm destroy
128 .Op Fl F
129 .Brq Ar beName | beName@snapshot
130 .Xc
131 Destroys the given
132 .Ar beName
133 boot environment or
134 .Ar beName@snapshot
135 snapshot.
136 Specifying
137 .Fl F
138 will automatically unmount without confirmation.
139 .It Cm export Ar sourceBe
140 Export
141 .Ar sourceBe
142 to
143 .Dv stdout .
144 .Dv stdout
145 must be piped or redirected to a file.
146 .It Cm import Ar targetBe
147 Import
148 .Ar targetBe
149 from
150 .Dv stdin .
151 .It Xo
152 .Cm jail
153 .Brq Fl b | Fl U
154 .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ...
155 .Brq Ar jailID | jailName
156 .Ao Ar bootenv Ac
157 .Op Ar utility Op Ar argument ...
158 .Xc
159 Creates a jail of the given boot environment.
160 Multiple
161 .Fl o
162 and
163 .Fl u
164 arguments may be specified.
165 .Fl o
166 will set a jail parameter, and
167 .Fl u
168 will unset a jail parameter.
169 .Pp
170 By default, jails are created in interactive mode and
171 .Pa /bin/sh
172 is
173 executed within the jail.
174 If
175 .Ar utility
176 is specified, it will be executed instead of
177 .Pa /bin/sh .
178 The jail will be destroyed and the boot environment unmounted when the command
179 finishes executing, unless the
180 .Fl U
181 argument is specified.
182 .Pp
183 The
184 .Fl b
185 argument enables batch mode, thereby disabling interactive mode.
186 The
187 .Fl U
188 argument will be ignored in batch mode.
189 .Pp
190 The
191 .Va name ,
192 .Va host.hostname ,
193 and
194 .Va path
195 may not actually be unset.
196 Attempts to unset any of these will revert them to the default values specified
197 below, if they have been overwritten by
198 .Fl o .
199 .Pp
200 All
201 .Ar key Ns = Ns Ar value
202 pairs are interpreted as jail parameters as described in
203 .Xr jail 8 .
204 The following default parameters are provided:
205 .Bl -column "allow.mount.devfs" ""
206 .It Va allow.mount Ta Cm true
207 .It Va allow.mount.devfs Ta Cm true
208 .It Va enforce_statfs Ta Cm 1
209 .It Va name Ta Va bootenv
210 .It Va host.hostname Ta Va bootenv
211 .It Va path Ta Set to a path in /tmp generated by
212 .Xr libbe 3 .
213 .El
214 .Pp
215 All default parameters may be overwritten.
216 .It Cm list Op Fl DHas
217 Displays all boot environments.
218 The Active field indicates whether the boot environment is active now (N);
219 active on reboot (R); or both (NR).
220 .Pp
221 If
222 .Fl a
223 is used, display all datasets.
224 If
225 .Fl D
226 is used, display the full space usage for each boot environment, assuming all
227 other boot environments were destroyed.
228 The
229 .Fl H
230 option is used for scripting.
231 It does not print headers and separate fields by a single tab instead of
232 arbitrary white space.
233 If
234 .Fl s
235 is used, display all snapshots as well.
236 .It Cm mount Ar beName Op Ar mountpoint
237 Temporarily mount the boot environment.
238 Mount at the specified
239 .Ar mountpoint
240 if provided.
241 .It Cm rename Ar origBeName newBeName
242 Renames the given nonactive
243 .Ar origBeName
244 to the given
245 .Ar newBeName .
246 .It Cm unjail Brq Ar jailID | jailName | beName
247 Destroys the jail created from the given boot environment.
248 .It Xo
249 .Cm unmount
250 .Op Fl f
251 .Ar beName
252 .Xc
253 Unmount the given boot environment, if it is mounted.
254 Specifying
255 .Fl f
256 will force the unmount if busy.
257 .El
258 .Sh EXAMPLES
259 .Bl -bullet
260 .It
261 To fill in with jail upgrade example when behavior is firm.
262 .El
263 .Sh SEE ALSO
264 .Xr jail 8 ,
265 .Xr zfs 8 ,
266 .Xr zpool 8
267 .Sh HISTORY
268 .Nm
269 is based on
270 .Nm beadm
271 and was implemented as a project for the 2017 Summer of Code, along with
272 .Xr libbe 3 .
273 .Sh AUTHORS
274 .Nm
275 was written by
276 .An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in .
277 .Pp
278 .Nm beadm
279 was written and is maintained by
280 .An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl .
281 .Pp
282 .An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net
283 wrote the original
284 .Nm beadm
285 manual page that this one is derived from.