NAME
bectl —
Utility to manage boot environments on
ZFS
SYNOPSIS
bectl |
activate [-t |
-T] beName |
bectl |
check |
bectl |
create [-r]
[-e {nonActiveBe |
beName@snapshot}]
newBeName |
bectl |
create [-r]
beName@snapshot |
bectl |
destroy [-Fo]
beName[@snapshot] |
bectl |
export sourceBe |
bectl |
import targetBe |
bectl |
jail [-bU]
[{-o
key=value
| -u key}]...
beName [utility
[argument ...]] |
bectl |
list [-aDHs]
[-c property]
[-C property]
[{-c property |
-C property}] |
bectl |
mount beName
[mountpoint] |
bectl |
rename origBeName
newBeName |
bectl |
{ujail | unjail}
{jailId | jailName |
beName} |
bectl |
{umount | unmount}
[-f] beName |
bectl |
[-h?] |
DESCRIPTION
Thebectl command is used to setup and interact with ZFS
boot environments, which are bootable clones of datasets.
Boot environments allow the system to be upgraded, while preserving the old system environment in a separate ZFS dataset.
The following commands are supported by
bectl:
activate[-t|-T] beName- Activate the given beName as the default boot
filesystem. If the
-tflag is given, this takes effect only for the next boot. Flag-Tremoves temporary boot once configuration. Without temporary configuration, the next boot will use zfs dataset specified in boot pool bootfs property. check- Performs a silent sanity check on the current system. If boot environments
are supported and used,
bectlwill exit with a status code of 0. Any other status code is not currently defined and may, in the future, grow special meaning for different degrees of sanity check failures. create[-r] [-e{nonActiveBe | beName@snapshot}] newBeName- Create a new boot environment named newBeName.
If the
-rflag is given, a recursive boot environment will be made.If the
-eflag is specified, the new environment will be cloned from the given nonActiveBe or beName@snapshot. Otherwise, the new environment will be created from the currently booted environment.If
bectlis creating from another boot environment, a snapshot of that boot environment will be created to clone from. create[-r] beName@snapshot- Create a snapshot of the boot environment named
beName.
If the
-rflag is given, a recursive snapshot of the boot environment will be created. A snapshot is created for each descendant dataset of the boot environment.No new boot environment is created with this command.
destroy[-Fo] beName[@snapshot]- Destroy the given beName boot environment or
beName
@snapshot snapshot without confirmation, unlike in beadm(1). Specifying-Fwill automatically unmount without confirmation.By default,
bectlwill warn that it is not destroying the origin of beName. The-oflag may be specified to destroy the origin as well. exportsourceBe- Export sourceBe to stdout(4). stdout(4) must be piped or redirected to a file.
importtargetBe- Import targetBe from stdin(4).
jail[-bU] [{-okey=value |-ukey}]... beName [utility [argument ...]]- Create a jail of the given boot environment. Multiple
-oand-uarguments may be specified.-owill set a jail parameter, and-uwill unset a jail parameter.By default, jails are created in interactive mode and /bin/sh is executed within the jail. If utility is specified, it will be executed instead of /bin/sh. The jail will be destroyed and the boot environment unmounted when the command finishes executing, unless the
-Uargument is specified.The
-bargument enables batch mode, thereby disabling interactive mode. The-Uargument will be ignored in batch mode.The name, host.hostname, and path must be set, the default values are specified below.
All key
=value pairs are interpreted as jail parameters as described in jail(8). The following default parameters are provided:allow.mount trueallow.mount.devfs trueenforce_statfs 1name Set to jail ID. host.hostname bootenv path Set to a path in /tmp generated by libbe(3). All default parameters may be overwritten.
list[-aDHs] [{-cproperty |-Cproperty}]-
Display all boot environments. The Active field indicates whether the boot environment is active now (N); active on reboot (R); is used on next boot once (T); or combination of (NRT).
-a- Display all datasets.
-D- Display the full space usage for each boot environment, assuming all other boot environments were destroyed.
-H- Used for scripting. Do not print headers and separate fields by a single tab instead of arbitrary white space.
-s- Display all snapshots as well.
-cproperty- Sort boot environments by given property name. The following
properties are supported:
- name (default output)
- creation
- origin
- used
- usedds
- usedsnap
- usedrefreserv
-Cproperty- Same as the
-coption, but displays in descending order.
The
-Doption is ignored when either the-sor-aoption is used. mountbeName [mountpoint]- Temporarily mount the boot environment. Mount at the specified mountpoint if provided.
renameorigBeName newBeName- Rename the given origBeName to the given newBeName. The boot environment will not be unmounted in order for this rename to occur.
ujail{jailId | jailName | beName}unjail{jailId | jailName | beName}- Destroy the jail created from the given boot environment.
umount[-f] beNameunmount[-f] beName- Unmount the given boot environment, if it is mounted. Specifying
-fwill force the unmount if busy.
bectl prints usage information if
-h or -? is specified.
SEE ALSO
HISTORY
bectl is based on
beadm(1) and was implemented as a project for the 2017 Summer of
Code, along with
libbe(3).
AUTHORS
bectl was written by Kyle
Kneitinger (kneitinger)
<kyle@kneit.in>.
beadm(1) was written and is maintained by
Slawomir Wojciech Wojtczak (vermaden)
<vermaden@interia.pl>.
Bryan Drewery (bdrewery)
<bryan@shatow.net>
wrote the original
beadm(1) manual page that this one is derived from.