2 .\" Copyright 2013 Nexenta Systems, Inc. All rights reserved.
3 .\" Copyright 2016 Toomas Soome <tsoome@me.com>
4 .TH BEADM 1M "Feb 21, 2016"
6 beadm \- utility for managing zfs boot environments
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
18 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR
23 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR
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]
34 \fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR
39 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR
44 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR
49 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR
54 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR
59 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName@snapshot\fR
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
68 The \fBbeadm\fR command supports the following operations:
73 Create a new BE, based on the active BE.
79 Create a new BE, based on an inactive BE.
85 Create a snapshot of an existing BE.
91 Create a new BE, based on an existing snapshot.
97 Create a new BE, and copy it to a different zpool.
103 Activate an existing, inactive BE.
127 Destroy a snapshot of a BE.
133 Rename an existing, inactive BE.
139 Roll back a BE to an existing snapshot of a BE.
145 Display information about your snapshots and datasets.
149 The \fBbeadm\fR command has the subcommands and options listed
159 Displays command usage.
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
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
177 running boot environment. If the \fB-d\fR option is provided then the
179 also used as the title for the BE's entry in the boot menu. If the \fB-d\fR
180 option is not provided, \fIbeName\fR will be used as the title.
188 Activate the newly created BE upon creation. The default is to not activate
189 the newly created BE.
194 \fB-d\fR \fIdescription\fR
198 Create a new BE with a description associated with it.
203 \fB-e\fR \fInon-activeBeName\fR
207 Create a new BE from an existing inactive BE.
212 \fB-e\fR \fIbeName@snapshot\fR
216 Create a new BE from an existing snapshot of the BE named beName.
221 \fB-o\fR \fIproperty=value\fR
225 Create the datasets for new BE with specific ZFS properties. Multiple
227 options can be specified. See \fBzfs\fR(1M) for more information on
238 Create the new BE in the specified zpool. If this is not provided, the
240 behavior is to create the new BE in the same pool as as the origin BE.
241 This option is not supported in non-global zone.
250 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
257 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR
261 Creates a snapshot of the existing BE named beName.
269 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
276 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR
280 Destroys the boot environment named \fIbeName\fR or destroys an existing
282 the boot environment named \fIbeName@snapshot\fR. Destroying a
284 will also destroy all snapshots of that boot environment. Use
294 Forcefully unmount the boot environment if it is currently mounted.
303 Force the action without prompting to verify the destruction of the boot
313 Destroy all snapshots of the boot
323 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
330 \fBbeadm\fR \fBlist\fR [\fB-a\fR | \fB-ds\fR] [\fB-H\fR]
331 [\fB-k\fR|\fB-K\fR \fBdate\fR | \fBname\fR | \fBspace\fR] [\fB-v\fR] [\fIbeName\fR]
335 Lists information about the existing boot environment named \fIbeName\fR, or
337 information for all boot environments if \fIbeName\fR is not provided.
339 field indicates whether the boot environment is active now,
341 by 'N'; active on reboot, represented by 'R'; or both, represented
342 by 'NR'. In non-global zone the 'Active' field also indicates whether the
343 boot environment has a non-active parent BE, represented by 'x'; is active
344 on boot in a non-active parent BE, represented by 'b'. Activate, rollback
345 and snapshot operations for boot environments from non-active global parent
346 BE aren't supported, destroy is allowed if these boot environments aren't
349 Each line in the machine parsable output has the boot environment name as the
350 first field. The 'Space' field is displayed in bytes and the 'Created' field
351 is displayed in UTC format. The \fB-H\fR option used with no other options
353 the boot environment's uuid in the second field. This field will be
355 the boot environment does not have a uuid. See the EXAMPLES section.
356 In non-global zones, this field shows the uuid of the parent BE.
364 Lists all available information about the boot environment. This includes
365 subordinate file systems and snapshots.
374 Lists information about all subordinate file systems belonging to the boot
384 Lists information about the snapshots of the boot environment.
393 Do not list header information. Each field in the list information is
394 separated by a semicolon.
403 Sort BEs by date of creation in ascending order. This is default.
412 Lexical sort of BEs by name in ascending order.
421 Sort BEs by space in ascending order.
426 \fB-K date\fR | \fBname\fR | \fBspace\fR
430 Same as the \fB-k\fR option, but sorts in descending order.
439 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
446 \fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR
450 Mounts a boot environment named beName at mountpoint. mountpoint must be an
451 already existing empty directory.
455 \fB-s\fR \fBro\fR|\fBrw\fR
459 Mount the shared filesystems of the BE in read-only or read-write mode.
468 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
475 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR
479 Unmounts the boot environment named beName. The command can also be given a path to a
480 beName mount point on the system.
488 Forcefully unmount the boot environment even if its currently busy.
497 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
504 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR
508 Renames the boot environment named \fIbeName\fR to \fInewBeName\fR.
516 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
523 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR | \fIbeName@snapshot\fR
527 Roll back the boot environment named \fIbeName\fR to existing snapshot
528 of the boot environment named \fIbeName@snapshot\fR.
536 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
543 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR
547 Makes beName the active BE on next reboot.
555 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
559 .SH ALTERNATE BE LOCATION
561 The alternate BE location outside rpool/ROOT can be configured
562 by modifying the BENAME_STARTS_WITH parameter in /etc/default/be.
563 For example: BENAME_STARTS_WITH=rootfs
567 \fBExample 1\fR: Create a new BE named BE1, by cloning the current live BE.
571 \fB# beadm create BE1\fR
577 \fBExample 2\fR: Create a new BE named BE2, by cloning the existing inactive
583 \fB# beadm create -e BE1 BE2\fR
589 \fBExample 3\fR: Create a snapshot named now of the existing BE named BE1.
593 \fB# beadm create BE1@now\fR
599 \fBExample 4\fR: Create a new BE named BE3, by cloning an existing snapshot of
604 \fB# beadm create -e BE1@now BE3\fR
610 \fBExample 5\fR: Create a new BE named BE4 based on the currently running BE.
611 Create the new BE in rpool2.
615 \fB# beadm create -p rpool2 BE4\fR
621 \fBExample 6\fR: Create a new BE named BE5 based on the currently running BE.
622 Create the new BE in rpool2, and create its datasets with compression turned
627 \fB# beadm create -p rpool2 -o compression=on BE5\fR
633 \fBExample 7\fR: Create a new BE named BE6 based on the currently running BE
634 and provide a description for it.
638 \fB# beadm create -d "BE6 used as test environment" BE6\fR
644 \fBExample 8\fR: Activate an existing, inactive BE named BE3.
648 \fB# beadm activate BE3\fR
654 \fBExample 9\fR: Mount the BE named BE3 at /mnt.
658 \fB# beadm mount BE3 /mnt\fR
664 \fBExample 10\fR: Unmount the mounted BE named BE3.
668 \fB# beadm unmount BE3\fR
674 \fBExample 11\fR: Destroy the BE named BE3 without verification.
678 \fB# beadm destroy -f BE3\fR
684 \fBExample 12\fR: Destroy the snapshot named now of BE1.
688 \fB# beadm destroy BE1@now\fR
694 \fBExample 13\fR: Rename the existing, inactive BE named BE1 to BE3.
698 \fB# beadm rename BE1 BE3\fR
704 \fBExample 14\fR: Roll back the BE named BE1 to snapshot BE1@now.
708 \fB# beadm rollback BE1 BE1@now\fR
714 \fBExample 15\fR: List all existing boot environments.
720 BE Active Mountpoint Space Policy Created
721 -- ------ ---------- ----- ------ -------
722 BE2 - - 72.0K static 2008-05-21 12:26
723 BE3 - - 332.0K static 2008-08-26 10:28
724 BE4 - - 15.78M static 2008-09-05 18:20
725 BE5 NR / 7.25G static 2008-09-09 16:53
731 \fBExample 16\fR: List all existing boot environmets and list all dataset and
732 snapshot information about those bootenvironments.
737 \fB# beadm list -d -s\fR
739 BE/Dataset/Snapshot Active Mountpoint Space Policy Created
740 ------------------- ------ ---------- ----- ------ -------
742 p/ROOT/BE2 - - 36.0K static 2008-05-21 12:26
743 p/ROOT/BE2/opt - - 18.0K static 2008-05-21 16:26
744 p/ROOT/BE2/opt@now - - 0 static 2008-09-08 22:43
745 p/ROOT/BE2@now - - 0 static 2008-09-08 22:43
747 p/ROOT/BE3 - - 192.0K static 2008-08-26 10:28
748 p/ROOT/BE3/opt - - 86.0K static 2008-08-26 10:28
749 p/ROOT/BE3/opt/local - - 36.0K static 2008-08-28 10:58
751 p/ROOT/BE4 - - 15.78M static 2008-09-05 18:20
753 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53
754 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53
755 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59
756 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37
757 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59
758 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37
763 \fBExample 17\fR: List all dataset and snapshot information about BE5
768 \fB# beadm list -a BE5\fR
770 BE/Dataset/Snapshot Active Mountpoint Space Policy Created
771 ------------------- ------ ---------- ----- ------ -------
773 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53
774 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53
775 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59
776 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37
777 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59
778 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37
784 \fBExample 18\fR: List machine parsable information about all boot
790 \fB# beadm list -H\fR
792 BE2;;;;55296;static;1211397974
793 BE3;;;;339968;static;1219771706
794 BE4;;;;16541696;static;1220664051
795 BE5;215b8387-4968-627c-d2d0-f4a011414bab;NR;/;7786206208;static;1221004384
802 The following exit values are returned:
810 Successful completion
829 \fB/var/log/beadm/<beName>/create.log.<yyyymmdd_hhmmss>\fR
833 Log used for capturing beadm create output
836 \fIyyyymmdd_hhmmss\fR - 20071130_140558
837 \fIyy\fR - year; 2007
841 \fImm\fR - minute; 05
842 \fIss\fR - second; 58
852 \fB/etc/default/be\fR
856 Contains default value for BENAME_STARTS_WITH parameter
862 See \fBattributes\fR(5) for descriptions of the following attributes:
870 ATTRIBUTE TYPE ATTRIBUTE VALUE
872 Interface Stability Uncommitted