6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / beadm.1m
blob0d973c16b45519859b56abfef1e588f70ec84ea6
1 '\" te
2 .\" Copyright 2013 Nexenta Systems, Inc. All rights reserved.
3 .\" Copyright 2015 Toomas Soome <tsoome@me.com>
4 .TH BEADM 1M "Mar 2, 2015"
5 .SH NAME
6 beadm \- utility for managing zfs boot environments
7 .SH SYNOPSIS
8 .LP
9 .nf
10 \fBbeadm\fR \fBcreate\fR [\fB-a\fR] [\fB-d\fR \fIdescription\fR]
11      [\fB-e\fR \fInon-activeBeName\fR | \fIbeName@snapshot\fR]
12      [\fB-o\fR \fIproperty=value\fR] ... [\fB-p\fR \fIzpool\fR]
13      [\fB-v\fR] \fIbeName\fR
14 .fi
16 .LP
17 .nf
18 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR
19 .fi
21 .LP
22 .nf
23 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR
24 .fi
26 .LP
27 .nf
28 \fBbeadm\fR \fBlist\fR [\fB-a\fR | \fB-ds\fR] [\fB-H\fR]
29     [\fB-k\fR|\fB-K\fR \fBdate\fR | \fBname\fR | \fBspace\fR] [\fB-v\fR] [\fIbeName\fR]
30 .fi
32 .LP
33 .nf
34 \fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR
35 .fi
37 .LP
38 .nf
39 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR
40 .fi
42 .LP
43 .nf
44 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR
45 .fi
47 .LP
48 .nf
49 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR
50 .fi
52 .LP
53 .nf
54 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR
55 .fi
57 .LP
58 .nf
59 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName@snapshot\fR
60 .fi
62 .SH DESCRIPTION
63 The \fBbeadm\fR command is the user interface for managing zfs Boot
64 Environments (BEs). This utility is intended to be used by System
65 Administrators who want to manage multiple Solaris Instances on a single
66 system.
67 .sp
68 The \fBbeadm\fR command supports the following operations:
69 .RS +4
70 .TP
71 .ie t \(bu
72 .el -
73 Create a new BE, based on the active BE.
74 .RE
75 .RS +4
76 .TP
77 .ie t \(bu
78 .el -
79 Create a new BE, based on an inactive BE.
80 .RE
81 .RS +4
82 .TP
83 .ie t \(bu
84 .el -
85 Create a snapshot of an existing BE.
86 .RE
87 .RS +4
88 .TP
89 .ie t \(bu
90 .el -
91 Create a new BE, based on an existing snapshot.
92 .RE
93 .RS +4
94 .TP
95 .ie t \(bu
96 .el -
97 Create a new BE, and copy it to a different zpool.
98 .RE
99 .RS +4
101 .ie t \(bu
102 .el -
103 Activate an existing, inactive BE.
105 .RS +4
107 .ie t \(bu
108 .el -
109 Mount a BE.
111 .RS +4
113 .ie t \(bu
114 .el -
115 Unmount a BE.
117 .RS +4
119 .ie t \(bu
120 .el -
121 Destroy a BE.
123 .RS +4
125 .ie t \(bu
126 .el -
127 Destroy a snapshot of a BE.
129 .RS +4
131 .ie t \(bu
132 .el -
133 Rename an existing, inactive BE.
135 .RS +4
137 .ie t \(bu
138 .el -
139 Roll back a BE to an existing snapshot of a BE.
141 .RS +4
143 .ie t \(bu
144 .el -
145 Display information about your snapshots and datasets.
148 .SH SUBCOMMANDS
149 The \fBbeadm\fR command has the subcommands and options listed
150 below. Also see
151 EXAMPLES below.
153 .ne 2
155 \fBbeadm\fR
157 .sp .6
158 .RS 4n
159 Displays command usage.
163 .ne 2
165 \fBbeadm\fR \fBcreate\fR [\fB-a\fR] [\fB-d\fR \fIdescription\fR]
166      [\fB-e\fR \fInon-activeBeName\fR | \fIbeName@snapshot\fR]
167      [\fB-o\fR \fIproperty=value\fR] ... [\fB-p\fR \fIzpool\fR]
168      [\fB-v\fR] \fIbeName\fR
171 .sp .6
172 .RS 4n
173 Creates a new boot environment named \fIbeName\fR.  If the \fB-e\fR option is
175 provided, the new boot environment will be created as a clone of the
176 currently
177 running boot environment. If the \fB-d\fR option is provided then the
178 description is
179 also used as the title for the BE's entry in the GRUB menu for
180 x86 systems or
181 in the boot menu for SPARC systems. If the \fB-d\fR option is
182 not provided, \fIbeName\fR
183 will be used as the title.
185 .ne 2
187 \fB-a\fR
189 .sp .6
190 .RS 4n
191 Activate the newly created BE upon creation.  The default is to not activate
192 the newly created BE.
195 .ne 2
197 \fB-d\fR \fIdescription\fR
199 .sp .6
200 .RS 4n
201 Create a new BE with a description associated with it.
204 .ne 2
206 \fB-e\fR \fInon-activeBeName\fR
208 .sp .6
209 .RS 4n
210 Create a new BE from an existing inactive BE.
213 .ne 2
215 \fB-e\fR \fIbeName@snapshot\fR
217 .sp .6
218 .RS 4n
219 Create a new BE from an existing snapshot of the BE named beName.
222 .ne 2
224 \fB-o\fR \fIproperty=value\fR
226 .sp .6
227 .RS 4n
228 Create the datasets for new BE with specific ZFS properties.  Multiple
229 \fB-o\fR
230 options can be specified.  See \fBzfs\fR(1M) for more information on
232 \fB-o\fR option.
235 .ne 2
237 \fB-p\fR \fIzpool\fR
239 .sp .6
240 .RS 4n
241 Create the new BE in the specified zpool.  If this is not provided, the
242 default
243 behavior is to create the new BE in the same pool as as the origin BE.
244 This option is not supported in non-global zone.
247 .ne 2
249 \fB-v\fR
251 .sp .6
252 .RS 4n
253 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
258 .ne 2
260 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR
262 .sp .6
263 .RS 4n
264 Creates a snapshot of the existing BE named beName.
266 .ne 2
268 \fB-v\fR
270 .sp .6
271 .RS 4n
272 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
277 .ne 2
279 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR
281 .sp .6
282 .RS 4n
283 Destroys the boot environment named \fIbeName\fR or destroys an existing
284 snapshot of
285 the boot environment named \fIbeName@snapshot\fR.  Destroying a
286 boot environment
287 will also destroy all snapshots of that boot environment.  Use
288 this command
289 with caution.
291 .ne 2
293 \fB-f\fR
295 .sp .6
296 .RS 4n
297 Forcefully unmount the boot environment if it is currently mounted.
300 .ne 2
302 \fB-F\fR
304 .sp .6
305 .RS 4n
306 Force the action without prompting to verify the destruction of the boot
307 environment.
310 .ne 2
312 \fB-s\fR
314 .sp .6
315 .RS 4n
316 Destroy all snapshots of the boot
317 environment.
320 .ne 2
322 \fB-v\fR
324 .sp .6
325 .RS 4n
326 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
331 .ne 2
333 \fBbeadm\fR \fBlist\fR [\fB-a\fR | \fB-ds\fR] [\fB-H\fR]
334     [\fB-k\fR|\fB-K\fR \fBdate\fR | \fBname\fR | \fBspace\fR] [\fB-v\fR] [\fIbeName\fR]
336 .sp .6
337 .RS 4n
338 Lists information about the existing boot environment named \fIbeName\fR, or
339 lists
340 information for all boot environments if \fIbeName\fR is not provided.
341 The 'Active'
342 field indicates whether the boot environment is active now,
343 represented
344 by 'N'; active on reboot, represented by 'R'; or both, represented
345 by 'NR'. In non-global zone the 'Active' field also indicates whether the
346 boot environment has a non-active parent BE, represented by 'x'; is active
347 on boot in a non-active parent BE, represented by 'b'. Activate, rollback
348 and snapshot operations for boot environments from non-active global parent
349 BE aren't supported, destroy is allowed if these boot environments aren't
350 active on boot.
352 Each line in the machine parasable output has the boot environment name as the
353 first field.  The 'Space' field is displayed in bytes and the 'Created' field
354 is displayed in UTC format.  The \fB-H\fR option used with no other options
355 gives
356 the boot environment's uuid in the second field.  This field will be
357 blank if
358 the boot environment does not have a uuid. See the EXAMPLES section.
359 In non-global zones, this field shows the uuid of the parent BE.
361 .ne 2
363 \fB-a\fR
365 .sp .6
366 .RS 4n
367 Lists all available information about the boot environment.  This includes
368 subordinate file systems and snapshots.
371 .ne 2
373 \fB-d\fR
375 .sp .6
376 .RS 4n
377 Lists information about all subordinate file systems belonging to the boot
378 environment.
381 .ne 2
383 \fB-s\fR
385 .sp .6
386 .RS 4n
387 Lists information about the snapshots of the boot environment.
390 .ne 2
392 \fB-H\fR
394 .sp .6
395 .RS 4n
396 Do not list header information.  Each field in the list information is
397 separated by a semicolon.
400 .ne 2
402 \fB-k\fR \fBdate\fR
404 .sp .6
405 .RS 4n
406 Sort BEs by date of creation in ascending order. This is default.
409 .ne 2
411 \fB-k\fR \fBname\fR
413 .sp .6
414 .RS 4n
415 Lexical sort of BEs by name in ascending order.
418 .ne 2
420 \fB-k\fR \fBspace\fR
422 .sp .6
423 .RS 4n
424 Sort BEs by space in ascending order.
427 .ne 2
429 \fB-K date\fR | \fBname\fR | \fBspace\fR
431 .sp .6
432 .RS 4n
433 Same as the \fB-k\fR option, but sorts in descending order.
436 .ne 2
438 \fB-v\fR
440 .sp .6
441 .RS 4n
442 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
447 .ne 2
449 \fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR
451 .sp .6
452 .RS 4n
453 Mounts a boot environment named beName at mountpoint.  mountpoint must be an
454 already existing empty directory.
456 .ne 2
458 \fB-s\fR \fBro\fR|\fBrw\fR
460 .sp .6
461 .RS 4n
462 Mount the shared filesystems of the BE in read-only or read-write mode.
465 .ne 2
467 \fB-v\fR
469 .sp .6
470 .RS 4n
471 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
476 .ne 2
478 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR
480 .sp .6
481 .RS 4n
482 Unmounts the boot environment named beName. The command can also be given a path to a
483 beName mount point on the system.
485 .ne 2
487 \fB-f\fR
489 .sp .6
490 .RS 4n
491 Forcefully unmount the boot environment even if its currently busy.
494 .ne 2
496 \fB-v\fR
498 .sp .6
499 .RS 4n
500 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
505 .ne 2
507 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR
509 .sp .6
510 .RS 4n
511 Renames the boot environment named \fIbeName\fR to \fInewBeName\fR.
513 .ne 2
515 \fB-v\fR
517 .sp .6
518 .RS 4n
519 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
524 .ne 2
526 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR | \fIbeName@snapshot\fR
528 .sp .6
529 .RS 4n
530 Roll back the boot environment named \fIbeName\fR to existing snapshot
531 of the boot environment named \fIbeName@snapshot\fR.
533 .ne 2
535 \fB-v\fR
537 .sp .6
538 .RS 4n
539 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
544 .ne 2
546 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR
548 .sp .6
549 .RS 4n
550 Makes beName the active BE on next reboot.
552 .ne 2
554 \fB-v\fR
556 .sp .6
557 .RS 4n
558 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
562 .SH ALTERNATE BE LOCATION
564 The alternate BE location outside rpool/ROOT can be configured
565 by modifying the BENAME_STARTS_WITH parameter in /etc/default/be.
566 For example: BENAME_STARTS_WITH=rootfs
568 .SH EXAMPLES
570 \fBExample 1\fR: Create a new BE named BE1, by cloning the current live BE.
572 .in +2
574 \fB# beadm create BE1\fR
576 .in -2
580 \fBExample 2\fR: Create a new BE named BE2, by cloning the existing inactive
582 named BE1.
584 .in +2
586 \fB# beadm create -e BE1 BE2\fR
588 .in -2
592 \fBExample 3\fR: Create a snapshot named now of the existing BE named BE1.
594 .in +2
596 \fB# beadm create BE1@now\fR
598 .in -2
602 \fBExample 4\fR: Create a new BE named BE3, by cloning an existing snapshot of
603 BE1.
605 .in +2
607 \fB# beadm create -e BE1@now BE3\fR
609 .in -2
613 \fBExample 5\fR: Create a new BE named BE4 based on the currently running BE.
614 Create the new BE in rpool2.
616 .in +2
618 \fB# beadm create -p rpool2 BE4\fR
620 .in -2
624 \fBExample 6\fR: Create a new BE named BE5 based on the currently running BE.
625 Create the new BE in rpool2, and create its datasets with compression turned
628 .in +2
630 \fB# beadm create -p rpool2 -o compression=on BE5\fR
632 .in -2
636 \fBExample 7\fR: Create a new BE named BE6 based on the currently running BE
637 and provide a description for it.
639 .in +2
641 \fB# beadm create -d "BE6 used as test environment" BE6\fR
643 .in -2
647 \fBExample 8\fR: Activate an existing, inactive BE named BE3.
649 .in +2
651 \fB# beadm activate BE3\fR
653 .in -2
657 \fBExample 9\fR: Mount the BE named BE3 at /mnt.
659 .in +2
661 \fB# beadm mount BE3 /mnt\fR
663 .in -2
667 \fBExample 10\fR: Unmount the mounted BE named BE3.
669 .in +2
671 \fB# beadm unmount BE3\fR
673 .in -2
677 \fBExample 11\fR: Destroy the BE named BE3 without verification.
679 .in +2
681 \fB# beadm destroy -f BE3\fR
683 .in -2
687 \fBExample 12\fR: Destroy the snapshot named now of BE1.
689 .in +2
691 \fB# beadm destroy BE1@now\fR
693 .in -2
697 \fBExample 13\fR: Rename the existing, inactive BE named BE1 to BE3.
699 .in +2
701 \fB# beadm rename BE1 BE3\fR
703 .in -2
707 \fBExample 14\fR: Roll back the BE named BE1 to snapshot BE1@now.
709 .in +2
711 \fB# beadm rollback BE1 BE1@now\fR
713 .in -2
717 \fBExample 15\fR: List all existing boot environments.
720 .in +2
722 \fB# beadm list\fR
723 BE  Active Mountpoint Space  Policy Created
724 --  ------ ---------- -----  ------ -------
725 BE2 -      -          72.0K  static 2008-05-21 12:26
726 BE3 -      -          332.0K static 2008-08-26 10:28
727 BE4 -      -          15.78M static 2008-09-05 18:20
728 BE5 NR     /          7.25G  static 2008-09-09 16:53
730 .in -2
734 \fBExample 16\fR: List all existing boot environmets and list all dataset and
735 snapshot information about those bootenvironments.
738 .in +2
740 \fB# beadm list -d -s\fR
742 BE/Dataset/Snapshot     Active Mountpoint Space   Policy Created
743 -------------------     ------ ---------- -----   ------ -------
745    p/ROOT/BE2           -      -          36.0K   static 2008-05-21 12:26
746    p/ROOT/BE2/opt       -      -          18.0K   static 2008-05-21 16:26
747    p/ROOT/BE2/opt@now   -      -          0       static 2008-09-08 22:43
748    p/ROOT/BE2@now       -      -          0       static 2008-09-08 22:43
750    p/ROOT/BE3           -      -          192.0K  static 2008-08-26 10:28
751    p/ROOT/BE3/opt       -      -          86.0K   static 2008-08-26 10:28
752    p/ROOT/BE3/opt/local -      -          36.0K   static 2008-08-28 10:58
754    p/ROOT/BE4           -      -          15.78M  static 2008-09-05 18:20
756    p/ROOT/BE5           NR     /          6.10G   static 2008-09-09 16:53
757    p/ROOT/BE5/opt       -      /opt       24.55M  static 2008-09-09 16:53
758    p/ROOT/BE5/opt@bar   -      -          18.38M  static 2008-09-10 00:59
759    p/ROOT/BE5/opt@foo   -      -          18.38M  static 2008-06-10 16:37
760    p/ROOT/BE5@bar       -      -          139.44M static 2008-09-10 00:59
761    p/ROOT/BE5@foo       -      -          912.85M static 2008-06-10 16:37
763 .in -2
766 \fBExample 17\fR: List all dataset and snapshot information about BE5
769 .in +2
771 \fB# beadm list -a BE5\fR
773 BE/Dataset/Snapshot   Active Mountpoint Space   Policy Created
774 -------------------   ------ ---------- -----   ------ -------
776    p/ROOT/BE5         NR     /          6.10G   static 2008-09-09 16:53
777    p/ROOT/BE5/opt     -      /opt       24.55M  static 2008-09-09 16:53
778    p/ROOT/BE5/opt@bar -      -          18.38M  static 2008-09-10 00:59
779    p/ROOT/BE5/opt@foo -      -          18.38M  static 2008-06-10 16:37
780    p/ROOT/BE5@bar     -      -          139.44M static 2008-09-10 00:59
781    p/ROOT/BE5@foo     -      -          912.85M static 2008-06-10 16:37
783 .in -2
787 \fBExample 18\fR: List machine parsable information about all boot
788 environments.
791 .in +2
793 \fB# beadm list -H\fR
795 BE2;;;;55296;static;1211397974
796 BE3;;;;339968;static;1219771706
797 BE4;;;;16541696;static;1220664051
798 BE5;215b8387-4968-627c-d2d0-f4a011414bab;NR;/;7786206208;static;1221004384
800 .in -2
803 .SH EXIT STATUS
805 The following exit values are returned:
807 .ne 2
809 \fB0\fR
811 .sp .6
812 .RS 4n
813 Successful completion
817 .ne 2
819 \fB>0\fR
821 .sp .6
822 .RS 4n
823 Failure
827 .SH FILES
830 .ne 2
832 \fB/var/log/beadm/<beName>/create.log.<yyyymmdd_hhmmss>\fR
834 .sp .6
835 .RS 4n
836 Log used for capturing beadm create output
839 \fIyyyymmdd_hhmmss\fR - 20071130_140558
840 \fIyy\fR - year; 2007
841 \fImm\fR - month; 11
842 \fIdd\fR - day; 30
843 \fIhh\fR - hour; 14
844 \fImm\fR - minute; 05
845 \fIss\fR - second; 58
847 .in -2
853 .ne 2
855 \fB/etc/default/be\fR
857 .sp .6
858 .RS 4n
859 Contains default value for BENAME_STARTS_WITH parameter
863 .SH ATTRIBUTES
865 See \fBattributes\fR(5) for descriptions of the  following  attributes:
870 box;
871 c | c
872 l | l .
873 ATTRIBUTE TYPE  ATTRIBUTE VALUE
875 Interface Stability     Uncommitted
879 .SH SEE ALSO
881 .BR zfs (1M)