forked from vermaden/beadm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beadm.1
276 lines (276 loc) · 5.33 KB
/
beadm.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
.\"
.\" beadm - Illumos/Solaris-like utility for FreeBSD to manage
.\" Boot Environments on ZFS filesystems
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\"
.\" @(#)beadm.1
.\" $FreeBSD$
.\"
.Dd September 4, 2012
.Dt BEADM 1
.Os FreeBSD
.Sh NAME
.Nm beadm
.Nd Utility to manage Boot Environments with ZFS
.Sh SYNOPSIS
.Nm
activate
.Op Fl n
.Ao Ar beName Ac
.Nm
create
.Op Fl r Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
.Ao Ar beName Ac
.Nm
create
.Ao Fl r Ar beName@snapshot Ac
.Nm
destroy
.Op Fl F
.Op Fl n
.Ao Ar beName | beName@snapshot Ac
.Nm
export
.Ao Ar beName Ac
.Ao Ar newFile Ac
.Nm
import
.Ao Ar file Ac
.Ao Ar newBeName Ac
.Nm
list
.Op Fl a
.Op Fl D
.Op Fl H
.Op Fl s
.Nm
mount
.Ao Ar beName Ac
.Op Fl n
.Op mountpoint
.Nm
rename
.Op Fl n
.Ao Ar origBeName Ac
.Ao Ar newBeName Ac
.Nm
{ umount | unmount }
.Op Fl f
.Op Fl n
.Ao Ar beName Ac
.Sh DESCRIPTION
The
.Nm
command is used to setup and interact with Boot Environments with ZFS.
.Pp
.Em Boot Environments
allows the system to be upgraded, while preserving the old system environment in a separate ZFS dataset.
.Pp
.Sh COMMANDS
The following commands are supported by
.Nm :
.Bl -tag -width indent
.It Ic activate Ar <beName>
.Pp
Activate the given
.Ar beName
for the next boot.
.Pp
.It Ic create
.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
.Ao Ar beName Ac
.Pp
Creates a new boot environment named
.Ar beName .
If the -e param is specified, the new environment will be cloned from the given
.Ar nonActiveBe | Ar beName@snapshot .
If the -r param is specified, the current BE nickname will be cloned
and the old BE nickname will be replaced with the specified nickname.
.Pp
.It Ic create
.Ao Ar beName@snapshot Ac
.Pp
Creates a snapshot of the existing boot environment named
.Ar beName .
If the -r param is specified, the current BE nickname will be cloned
and the old BE nickname will be replaced with the specified nickname.
.Pp
.It
.Ic destroy
.Op Fl F
.Op Fl n
.Ao Ar beName | beName@snapshot Ac
.Pp
Destroys the given
.Ar beName
boot environment or
.Ar beName@snapshot
snapshot.
Specifying
.Fl F
will automatically unmount without confirmation.
If
.Fl n
used, resolve the BE nickname
.Pp
.It Ic export
.Ao Ar beName Ac Ao Ar fileName Ac
.Pp
Exports the
.Ar beName
to the given
.Ar fileName
.Pp
.It Ic import
.Ao Ar fileName Ac Ao Ar beName Ac
.Pp
Imports the
.Ar fileName
to the given
.Ar beName
.Pp
.It Ic umount
.Op Fl f
.Op Fl n
.Ao Ar beName Ac
.Pp
.It Ic list
.Op Fl a
.Op Fl D
.Op Fl H
.Op Fl s
.Pp
Displays all boot environments.
The Active field indicates whether the boot environment is active now (N); active on reboot (R); or both (NR).
.PP
If
.Fl a
is used, display all datasets.
If
.Fl D
is used, display the full space usage for each boot environment, assuming all other boot environments were destroyed.
The
.Fl H
option is used for scripting. It does not print headers and separate fields by a single tab instead of arbitrary white space.
If
If
.Fl s
is used, display all snapshots as well.
.Pp
.It Ic mount
.Op Fl n
.Ao Ar beName Ac
.Op mountpoint
.Pp
Temporarily mount the boot environment.
Mount at the specified
.Ar mountpoint
if provided.
If
.Fl n
used, resolve the BE nickname
.Pp
.It Ic rename
.Op Fl n
.Ao Ar origBeName Ac Ao Ar newBeName Ac
.Pp
Renames the given nonactive
.Ar origBeName
to the given
.Ar newBeName
If
.Fl n
used, rename the nickname property only
.Pp
.It Ic umount
.Op Fl f
.Op Fl n
.Ao Ar beName Ac
.Pp
Unmount the given boot environment, if it is mounted.
Specifying
.Fl f
will force the unmount if busy.
If
.Fl n
used, resolve the BE nickname
.Pp
.El
.Sh EXAMPLES
.Bl -bullet
.It
Perform a system upgrade in a
.Xr jail 8
.Pp
Create a new boot environment called
.Em jailed :
.Pp
.Dl beadm create -e default jailed
.Pp
Set mountpoint for new jail to
.Pa /usr/jails/jailed :
.Pp
.Dl beadm mount jailed /usr/jails/jailed
.Pp
The currently active boot environment is now replicated into the jailed system and ready for upgrade.
Startup the jail, login and perform the normal upgrade process.
Once this is done, stop the jail and disable it in
.Pa /etc/rc.conf.
.Pp
Now activate the boot environment for the next boot
.Pp
.Dl beadm activate jailed
.Pp
Reboot into the new environment
.Pp
.Dl reboot
.El
.Sh HOWTO
A HOWTO guide is posted at the FreeBSD forums:
.Bl -bullet
.It
.Ar http://forums.freebsd.org/showthread.php?t=31662
.El
.Pp
.Sh SEE ALSO
.Xr jail 8 ,
.Xr zfs 8 ,
.Xr zpool 8
.Sh HISTORY
.Xr beadm 1M
originally appeared in Solaris.
.Sh AUTHORS
.Bl -bullet
.It
Slawomir Wojciech Wojtczak (vermaden)
.Pp
Creator and maintainer of
.Nm .
.It
Bryan Drewery (bdrewery)
.Pp
Wrote this manual page and contributed child dataset fixes.
.It
Mike Clarke (rawthey)
.Pp
Wrote fast implementation of
.Nm Ar list .
.Pp
Contributed a lot of fixes and usability changes.
.It
Kris Moore (kmoore134)
.Pp
Added support for nicknames, and exporting / importing BEs