2 .\" Copyright 2013 Nexenta Systems, Inc. All rights reserved.
3 .\" Copyright 2015 Toomas Soome <tsoome@me.com>
4 .TH BEADM 1M "Mar 2, 2015"
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 GRUB menu for
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.
191 Activate the newly created BE upon creation. The default is to not activate
192 the newly created BE.
197 \fB-d\fR \fIdescription\fR
201 Create a new BE with a description associated with it.
206 \fB-e\fR \fInon-activeBeName\fR
210 Create a new BE from an existing inactive BE.
215 \fB-e\fR \fIbeName@snapshot\fR
219 Create a new BE from an existing snapshot of the BE named beName.
224 \fB-o\fR \fIproperty=value\fR
228 Create the datasets for new BE with specific ZFS properties. Multiple
230 options can be specified. See \fBzfs\fR(1M) for more information on
241 Create the new BE in the specified zpool. If this is not provided, the
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.
253 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
260 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR
264 Creates a snapshot of the existing BE named beName.
272 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
279 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR
283 Destroys the boot environment named \fIbeName\fR or destroys an existing
285 the boot environment named \fIbeName@snapshot\fR. Destroying a
287 will also destroy all snapshots of that boot environment. Use
297 Forcefully unmount the boot environment if it is currently mounted.
306 Force the action without prompting to verify the destruction of the boot
316 Destroy all snapshots of the boot
326 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
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]
338 Lists information about the existing boot environment named \fIbeName\fR, or
340 information for all boot environments if \fIbeName\fR is not provided.
342 field indicates whether the boot environment is active now,
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
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
356 the boot environment's uuid in the second field. This field will be
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.
367 Lists all available information about the boot environment. This includes
368 subordinate file systems and snapshots.
377 Lists information about all subordinate file systems belonging to the boot
387 Lists information about the snapshots of the boot environment.
396 Do not list header information. Each field in the list information is
397 separated by a semicolon.
406 Sort BEs by date of creation in ascending order. This is default.
415 Lexical sort of BEs by name in ascending order.
424 Sort BEs by space in ascending order.
429 \fB-K date\fR | \fBname\fR | \fBspace\fR
433 Same as the \fB-k\fR option, but sorts in descending order.
442 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
449 \fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR
453 Mounts a boot environment named beName at mountpoint. mountpoint must be an
454 already existing empty directory.
458 \fB-s\fR \fBro\fR|\fBrw\fR
462 Mount the shared filesystems of the BE in read-only or read-write mode.
471 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
478 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR
482 Unmounts the boot environment named beName. The command can also be given a path to a
483 beName mount point on the system.
491 Forcefully unmount the boot environment even if its currently busy.
500 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
507 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR
511 Renames the boot environment named \fIbeName\fR to \fInewBeName\fR.
519 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
526 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR | \fIbeName@snapshot\fR
530 Roll back the boot environment named \fIbeName\fR to existing snapshot
531 of the boot environment named \fIbeName@snapshot\fR.
539 Verbose mode. Displays verbose error messages from \fBbeadm\fR.
546 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR
550 Makes beName the active BE on next reboot.
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
570 \fBExample 1\fR: Create a new BE named BE1, by cloning the current live BE.
574 \fB# beadm create BE1\fR
580 \fBExample 2\fR: Create a new BE named BE2, by cloning the existing inactive
586 \fB# beadm create -e BE1 BE2\fR
592 \fBExample 3\fR: Create a snapshot named now of the existing BE named BE1.
596 \fB# beadm create BE1@now\fR
602 \fBExample 4\fR: Create a new BE named BE3, by cloning an existing snapshot of
607 \fB# beadm create -e BE1@now BE3\fR
613 \fBExample 5\fR: Create a new BE named BE4 based on the currently running BE.
614 Create the new BE in rpool2.
618 \fB# beadm create -p rpool2 BE4\fR
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
630 \fB# beadm create -p rpool2 -o compression=on BE5\fR
636 \fBExample 7\fR: Create a new BE named BE6 based on the currently running BE
637 and provide a description for it.
641 \fB# beadm create -d "BE6 used as test environment" BE6\fR
647 \fBExample 8\fR: Activate an existing, inactive BE named BE3.
651 \fB# beadm activate BE3\fR
657 \fBExample 9\fR: Mount the BE named BE3 at /mnt.
661 \fB# beadm mount BE3 /mnt\fR
667 \fBExample 10\fR: Unmount the mounted BE named BE3.
671 \fB# beadm unmount BE3\fR
677 \fBExample 11\fR: Destroy the BE named BE3 without verification.
681 \fB# beadm destroy -f BE3\fR
687 \fBExample 12\fR: Destroy the snapshot named now of BE1.
691 \fB# beadm destroy BE1@now\fR
697 \fBExample 13\fR: Rename the existing, inactive BE named BE1 to BE3.
701 \fB# beadm rename BE1 BE3\fR
707 \fBExample 14\fR: Roll back the BE named BE1 to snapshot BE1@now.
711 \fB# beadm rollback BE1 BE1@now\fR
717 \fBExample 15\fR: List all existing boot environments.
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
734 \fBExample 16\fR: List all existing boot environmets and list all dataset and
735 snapshot information about those bootenvironments.
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
766 \fBExample 17\fR: List all dataset and snapshot information about BE5
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
787 \fBExample 18\fR: List machine parsable information about all boot
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
805 The following exit values are returned:
813 Successful completion
832 \fB/var/log/beadm/<beName>/create.log.<yyyymmdd_hhmmss>\fR
836 Log used for capturing beadm create output
839 \fIyyyymmdd_hhmmss\fR - 20071130_140558
840 \fIyy\fR - year; 2007
844 \fImm\fR - minute; 05
845 \fIss\fR - second; 58
855 \fB/etc/default/be\fR
859 Contains default value for BENAME_STARTS_WITH parameter
865 See \fBattributes\fR(5) for descriptions of the following attributes:
873 ATTRIBUTE TYPE ATTRIBUTE VALUE
875 Interface Stability Uncommitted