The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Confirm that boot environments apply
      • Boot an earlier environment once
      • Verify before making recovery permanent
      • Preserve the failed environment for diagnosis
      • Know when this procedure is insufficient
      • Primary references

      Recover with a ZFS boot environment

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      A ZFS boot environment is a bootable clone of the root filesystem datasets managed by bectl. It can preserve the earlier root state across an update or configuration change. It does not protect data on unrelated datasets, another pool, or another host, and it is not a backup.

      This procedure assumes that bectl check succeeds and that a known boot environment existed before the failure. It does not attempt pool repair or manual recovery-media imports.

      Confirm that boot environments apply #

      On a running host, check support and list the environments:

      # bectl check
      $ bectl list
      

      The Active column uses N for the environment active now, R for the environment selected on reboot, and NR for both. Record the exact names. Do not select an environment only because it appears older; it must be a known recovery point for the failed change.

      Before future high-risk maintenance, create and confirm a recursive environment:

      # bectl create -r pre-change
      $ bectl list
      

      The 15.1 upgrade checklist uses this boundary before changing the base system.

      Boot an earlier environment once #

      When the host still boots far enough to run bectl, activate the recovery environment for only the next boot:

      # bectl activate -t pre-change
      $ bectl list
      # shutdown -r now
      

      Temporary activation limits the change to one boot. If that boot fails or the host is restarted again without permanent activation, the normal bootfs selection remains available.

      When the current environment does not boot, use the FreeBSD loader’s Boot Environments menu to select the known earlier environment. Console access is required. Loader presentation varies by platform, so confirm the selected environment name before continuing the boot.

      Verify before making recovery permanent #

      After booting the earlier environment, confirm which root is active and inspect the system:

      $ bectl list
      $ freebsd-version -kru
      $ zpool status
      # service service-name status
      

      Replace service-name with every essential service. Also verify network access, firewall behavior, storage mounts, scheduled jobs, and the data needed by the workload.

      Data on separate datasets may still reflect changes made after the boot environment was created. Do not assume that application state, jail data, databases, or home directories were rolled back with the root environment. The ZFS snapshot and replication guide explains the separate dataset boundary.

      If the recovered environment is the desired root, activate it persistently:

      # bectl activate pre-change
      $ bectl list
      

      Perform another controlled reboot and verify it again.

      Preserve the failed environment for diagnosis #

      Do not immediately destroy the failed environment. It may contain configuration changes, logs, package state, or files needed to explain the failure. It can be mounted temporarily at an explicit empty directory:

      # mkdir /mnt/failed-be
      # bectl mount failed-environment /mnt/failed-be
      

      Replace failed-environment with the recorded name. Treat the mounted tree as evidence. Avoid running its services or writing into it during comparison. Unmount it when finished:

      # bectl unmount failed-environment
      

      Destroying a boot environment is intentionally outside this recovery procedure because it is irreversible and space accounting can be surprising when snapshots and clones share blocks.

      Know when this procedure is insufficient #

      A boot environment does not solve:

      • pool corruption or failed storage devices;
      • a boot loader that cannot read the root pool;
      • loss of the disk or host;
      • application inconsistency across separate datasets;
      • a missing pre-change environment;
      • an unsupported release that still requires a planned upgrade.

      Those cases require pool, boot-loader, application, or backup recovery appropriate to the failure. Do not use zfs rollback on the root dataset as a substitute for identifying those boundaries.

      Use Diagnose the FreeBSD boot path when the failing stage has not yet been established or the loader cannot reach the boot-environment selection.

      Primary references #

      • bectl(8)
      • libbe(3)
      • FreeBSD Handbook: pkgbase upgrades with boot environments
      • FreeBSD 15.1-RELEASE upgrading instructions

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Confirm that boot environments apply
      • Boot an earlier environment once
      • Verify before making recovery permanent
      • Preserve the failed environment for diagnosis
      • Know when this procedure is insufficient
      • Primary references