BECTL(8)
๐ฆ BECTL(8) ๐ฆ
okay bestie, grab a snack ๐ โ this is bectl, straight out of the System Manager's Manual, and she's literally the icon of ZFS boot environments ๐
๐ธ NAME ๐ธ
bectl โ manage ZFS boot environments ๐
โจ SYNOPSIS โจ
bectl [-h]
bectl [-r beroot] activate [-t | -T] beName
bectl [-r beroot] check
bectl [-r beroot] create [-r] [-e {nonActiveBe | beName@snapshot}]
newBeName
bectl [-r beroot] create [-r] beName@snapshot
bectl [-r beroot] create -E newBeName
bectl [-r beroot] destroy [-Fo] beName[@snapshot]
bectl [-r beroot] export sourceBe
bectl [-r beroot] import targetBe
bectl [-r beroot] jail [-bU] [{-o key=value | -u key}]... beName
[utility [argument ...]]
bectl [-r beroot] list [-aDHs] [-c property] [-C property] [{-c property
| -C property}]
bectl [-r beroot] mount beName [mountpoint]
bectl [-r beroot] rename origBeName newBeName
bectl [-r beroot] {ujail | unjail} {jailId | jailName | beName}
bectl [-r beroot] {umount | unmount} [-f] beName
๐ซถ DESCRIPTION ๐ซถ
So the bectl utility manages bootable ZFS clones called boot environments โ and honestly? main character energy โจ Boot environments let you test system changes safely, because they're selectable directly from the boot loader(8). No cap, that's the whole point ๐
This utility can create, list, mount, or jail boot environments. And once you've tested your changes? The boot environment can be unmounted, activated, renamed, and destroyed. Full arc, beginning to end ๐
๐ Supported Subcommands and Flags ๐
-hโ prints usage information and exits. that's it, that's the whole job ๐-r berootsubcommand โ specifies a parent dataset for the boot environment to use for subcommand, for operation on manually imported pools or unusual layouts ๐งactivate [-t | -T] beNameโ activates 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 the zfs dataset specified in the boot poolbootfsproperty โญcheckโ performs a check to see if the current system can use boot environments ๐ฉบ If boot environments are supported and used,bectlwill exit with a status code of0. 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โ creates a new boot environment named newBeName ๐ฑ- If the
-rflag is given, a recursive boot environment will be made. See โBoot Environment Structuresโ for a discussion on different layouts ๐๏ธ - 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 ๐ธ
- If the
create [-r] beName@snapshotโ creates 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 ๐ณ See โBoot Environment Structuresโ for a discussion on different layouts. - Heads up: no new boot environment is created with this subcommand ๐ซ
- If the
create -E newBeNameโ creates a new empty boot environment named newBeName ๐ซงdestroy [-Fo] beName[@snapshot]โ destroys the given beName boot environment or beName@snapshot snapshot without confirmation, unlike inbeadm(8)๐ 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 ๐ฅ
- By default,
export sourceBeโ exports sourceBe tostdout(4).stdout(4)must be piped or redirected to a file ๐คimport targetBeโ imports targetBe fromstdin(4)๐ฅjail [-bU] [{-o key=value | -u key}]... beName [utility [argument ...]]โ creates 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/shis 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, andpathmust be set โ the default values are specified below ๐ - All
key=valuepairs are interpreted as jail parameters as described injail(8)๐ง The following default parameters are provided:allow.mountโtrueallow.mount.devfsโtrueenforce_statfsโ1nameโ set to jail IDhost.hostnameโbootenvpathโ set to a path in/tmpgenerated bylibbe(3)
- All default parameters may be overwritten ๐
- By default, jails are created in interactive mode and
list [-aDHs] [{-c property | -C property}]โ displays all boot environments ๐ TheActivefield 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 the given ZFS dataset property. The following properties are supported:name(the default)creationoriginusedusedbydatasetusedbyrefreservationusedbysnapshots- Short forms
usedds,usedrefreservandusedsnapare also supported ๐ซ
-Cproperty โ same as the-coption, but displays in descending order ๐- The
-Doption is ignored when either the-sor-aoption is used โ ๏ธ
mount beName [mountpoint]โ mounts the given boot environment ๐ป- If a nonexistent mountpoint is given:
bectlwill make the directory, including intermediate directories as required ๐ช - If no mountpoint is given:
bectlwill make a directory such asbe_mount.c6Sfin/tmp. Randomness in the last four characters of the directory name will prevent mount point conflicts ๐ฒ Unmount of an environment, followed by mount of the same environment without giving a mountpoint, will result in a different randomly-named mountpoint ๐
- If a nonexistent mountpoint is given:
rename origBeName newBeNameโ renames the given origBeName to the given newBeName โ๏ธ The boot environment will not be unmounted for this rename to occur ๐ซถujail {jailId | jailName | beName}unjail {jailId | jailName | beName}โ destroys the jail created from the given boot environment ๐ฅumount [-f] beNameunmount [-f] beNameโ unmounts the given boot environment, if it is mounted ๐ค Specifying-fwill force the unmount if busy โ ๏ธ- Unmount will not remove the mount point ๐ซ
๐ Boot Environment Structures ๐
The traditional FreeBSD boot environment layout โ as created by the Auto ZFS option to bsdinstall(8) โ is a โshallowโ boot environment structure, where boot environment datasets do not have any directly subordinate datasets ๐
โโ๏ธ Instead, they're organized off in zroot/ROOT, and they rely on datasets elsewhere in the pool having canmount set to off ๐ง For instance, a simplified pool may be laid out as such:
% zfs list -o name,canmount,mountpoint
NAME CANMOUNT MOUNTPOINT
zroot
zroot/ROOT noauto none
zroot/ROOT/default noauto none
zroot/home on /home
zroot/usr off /usr
zroot/usr/src on /usr/src
zroot/var off /var
In that example, zroot/usr has canmount set to off, thus files in /usr typically fall into the boot environment because this dataset is not mounted ๐ซง zroot/usr/src is mounted, thus files in /usr/src are not in the boot environment ๐ซ
The other style of boot environments in use โ frequently called โdeep boot environmentsโ โ organizes some or all of the boot environment as subordinate to the boot environment dataset ๐ For example:
% zfs list -o name,canmount,mountpoint
NAME CANMOUNT MOUNTPOINT
zroot
zroot/ROOT noauto none
zroot/ROOT/default noauto none
zroot/ROOT/default/usr noauto /usr
zroot/ROOT/default/usr/local noauto /usr/local
zroot/var on /var
Note that the subordinate datasets now have canmount set to noauto โญ These are more obviously a part of the boot environment, as indicated by their positioning in the layout ๐ These subordinate datasets will be mounted by the zfsbe rc(8) script at boot time ๐
In this example, /var is excluded from the boot environment ๐
โโ๏ธ
bectl subcommands that have their own -r operate on this second, โdeepโ style of boot environment, when the -r flag is set ๐ฅ A future version of bectl may default to handling both styles and deprecate the various -r flags ๐ฎ
๐ EXAMPLES ๐
Create a boot environment, named with today's date, containing snapshots of the root dataset and of all child datasets ๐ธ:
bectl create -r `date +%Y%m%d`
Mount a previous boot environment, yesterdaysbe, to /mnt ๐:
bectl mount yesterdaysbe /mnt
๐ SEE ALSO ๐
libbe(3), zfsprops(7), beinstall.sh(8), jail(8), loader(8), zfs(8), zpool(8) ๐ซถ
๐ HISTORY ๐
bectl and libbe(3) were written by Kyle Kneitinger (kneitinger) <kyle@kneit.in> as a 2017 Google Summer of Code project, with Allan Jude (allanjude) <allanjude@freebsd.org> as mentor ๐
bectl and this manual page were derived from beadm(8) ๐ซ
๐ซถ AUTHORS ๐ซถ
okay so before we log off, let's give the people their flowers fr fr, because this whole thing did NOT build itself ๐
Slawomir Wojciech Wojtczak (vermaden)<vermaden@interia.pl>โ the actual creator AND maintainer ofbeadm(8). the OG. the blueprint. main character energy from day one ๐Bryan Drewery (bdrewery)<bryan@shatow.net>โ contributed the child dataset fixes (iykyk, those are the messy ones ๐ญ) and literally wrote thebeadm(8)manual page. the way that he documented things so we could all understand themโฆ iconic โจKyle Evans (kevans)<kevans@freebsd.org>โ wrote most of the later changes tobectl, and to this very page you're reading rn. not me being grateful to the person who made this page exist while I'm rewriting it ๐๐
so yeah, three absolute legends, no cap. respect the maintainers, they're carrying the whole boot environment situation on their backs ๐
and that's the vibe check complete bestie!! ๐ this page came from the Debian project, version info dated February 4, 2026, and the manual page is filed under BECTL(8) โ section 8, admin commands, where all the powerful stuff lives ๐
go forth and snapshot responsibly, mwah ๐ฆ๐
๐ฆ where this page comes from
- freebsd 15.1: base 15.1
- ๐ the page's license: BSD-2-Clause
- Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms