2018-07-24 13:17:40 +00:00
|
|
|
.\"
|
2018-08-07 13:46:06 +00:00
|
|
|
.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
|
|
|
|
.\" All rights reserved.
|
2018-07-24 13:17:40 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\" @(#)be.1
|
2018-08-07 14:02:41 +00:00
|
|
|
.\"
|
2018-07-24 13:17:40 +00:00
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2018-08-24 20:44:58 +00:00
|
|
|
.Dd August 24, 2018
|
2018-07-24 13:24:30 +00:00
|
|
|
.Dt BECTL 8
|
2018-08-11 01:40:24 +00:00
|
|
|
.Os
|
2018-07-24 13:17:40 +00:00
|
|
|
.Sh NAME
|
2018-07-24 13:24:30 +00:00
|
|
|
.Nm bectl
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nd Utility to manage Boot Environments on ZFS
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm activate
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl t
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm create
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl r
|
2018-08-23 02:09:52 +00:00
|
|
|
.Op Fl e Brq Ar nonActiveBe | beName@snapshot
|
|
|
|
.Ar beName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm create
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl r
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName@snapshot
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm destroy
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl F
|
2018-08-23 02:09:52 +00:00
|
|
|
.Brq Ar beName | beName@snapshot
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm export
|
|
|
|
.Ar sourceBe
|
2018-08-11 04:01:24 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm import
|
|
|
|
.Ar targetBe
|
2018-08-11 04:01:24 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm jail
|
|
|
|
.Brq Fl b | Fl U
|
|
|
|
.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ...
|
|
|
|
.Brq Ar jailID | jailName
|
|
|
|
.Ar bootenv
|
2018-08-18 01:12:44 +00:00
|
|
|
.Op Ar utility Op Ar argument ...
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm list
|
|
|
|
.Op Fl DHas
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm mount
|
|
|
|
.Ar beName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op mountpoint
|
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Cm rename
|
|
|
|
.Ar origBeName
|
|
|
|
.Ar newBeName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Brq Cm ujail | unjail
|
|
|
|
.Brq Ar jailID | jailName
|
|
|
|
.Ar bootenv
|
2018-07-24 13:17:40 +00:00
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
.Brq Cm umount | unmount
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl f
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2018-08-23 02:09:52 +00:00
|
|
|
command is used to setup and interact with ZFS boot environments, which are
|
|
|
|
bootable clones of datasets.
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
|
|
|
.Em Boot Environments
|
2018-08-23 02:09:52 +00:00
|
|
|
allows the system to be upgraded, while preserving the old system environment in
|
|
|
|
a separate ZFS dataset.
|
2018-07-24 13:17:40 +00:00
|
|
|
.Sh COMMANDS
|
|
|
|
The following commands are supported by
|
|
|
|
.Nm :
|
|
|
|
.Bl -tag -width activate
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm activate
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl t
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName
|
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Activate the given
|
|
|
|
.Ar beName
|
2018-08-11 01:40:24 +00:00
|
|
|
as the default boot filesystem.
|
|
|
|
If the
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl t
|
|
|
|
flag is given, this takes effect only for the next boot.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm create
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl r
|
2018-08-23 02:09:52 +00:00
|
|
|
.Op Fl e Brq Ar nonActiveBe | beName@snapshot
|
|
|
|
.Ar beName
|
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Creates a new boot environment named
|
|
|
|
.Ar beName .
|
|
|
|
If the
|
2018-08-23 02:09:52 +00:00
|
|
|
.Fl e
|
|
|
|
argument is specified, the new environment will be cloned from the given
|
|
|
|
.Brq Ar nonActiveBe | Ar beName@snapshot .
|
|
|
|
If the
|
|
|
|
.Fl r
|
2018-07-24 13:17:40 +00:00
|
|
|
flag is given, a recursive boot environment will be made.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm create
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl r
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName@snapshot
|
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Creates a snapshot of the existing boot environment named
|
|
|
|
.Ar beName .
|
|
|
|
If the
|
2018-08-23 02:09:52 +00:00
|
|
|
.Fl r
|
2018-07-24 13:17:40 +00:00
|
|
|
flag is given, a recursive boot environment will be made.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm destroy
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl F
|
2018-08-23 02:09:52 +00:00
|
|
|
.Brq Ar beName | beName@snapshot
|
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Destroys the given
|
|
|
|
.Ar beName
|
|
|
|
boot environment or
|
|
|
|
.Ar beName@snapshot
|
2018-08-24 20:44:58 +00:00
|
|
|
snapshot without confirmation, unlike in
|
|
|
|
.Nm beadm .
|
2018-07-24 13:17:40 +00:00
|
|
|
Specifying
|
|
|
|
.Fl F
|
|
|
|
will automatically unmount without confirmation.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm export Ar sourceBe
|
2018-08-11 04:01:24 +00:00
|
|
|
Export
|
|
|
|
.Ar sourceBe
|
|
|
|
to
|
|
|
|
.Dv stdout .
|
|
|
|
.Dv stdout
|
|
|
|
must be piped or redirected to a file.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm import Ar targetBe
|
2018-08-11 04:01:24 +00:00
|
|
|
Import
|
|
|
|
.Ar targetBe
|
|
|
|
from
|
|
|
|
.Dv stdin .
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm jail
|
|
|
|
.Brq Fl b | Fl U
|
|
|
|
.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ...
|
|
|
|
.Brq Ar jailID | jailName
|
2018-07-24 13:17:40 +00:00
|
|
|
.Ao Ar bootenv Ac
|
2018-08-18 01:12:44 +00:00
|
|
|
.Op Ar utility Op Ar argument ...
|
2018-08-23 02:09:52 +00:00
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Creates a jail of the given boot environment.
|
2018-08-06 03:32:25 +00:00
|
|
|
Multiple
|
|
|
|
.Fl o
|
2018-08-06 15:21:46 +00:00
|
|
|
and
|
|
|
|
.Fl u
|
2018-08-06 03:32:25 +00:00
|
|
|
arguments may be specified.
|
2018-08-06 15:21:46 +00:00
|
|
|
.Fl o
|
|
|
|
will set a jail parameter, and
|
|
|
|
.Fl u
|
|
|
|
will unset a jail parameter.
|
2018-08-18 01:12:44 +00:00
|
|
|
.Pp
|
|
|
|
By default, jails are created in interactive mode and
|
|
|
|
.Pa /bin/sh
|
|
|
|
is
|
2018-08-17 01:59:19 +00:00
|
|
|
executed within the jail.
|
2018-08-18 01:12:44 +00:00
|
|
|
If
|
|
|
|
.Ar utility
|
|
|
|
is specified, it will be executed instead of
|
|
|
|
.Pa /bin/sh .
|
2018-08-23 01:45:18 +00:00
|
|
|
The jail will be destroyed and the boot environment unmounted when the command
|
|
|
|
finishes executing, unless the
|
|
|
|
.Fl U
|
|
|
|
argument is specified.
|
2018-08-18 01:12:44 +00:00
|
|
|
.Pp
|
2018-08-17 01:59:19 +00:00
|
|
|
The
|
|
|
|
.Fl b
|
|
|
|
argument enables batch mode, thereby disabling interactive mode.
|
2018-08-23 01:45:18 +00:00
|
|
|
The
|
|
|
|
.Fl U
|
|
|
|
argument will be ignored in batch mode.
|
2018-08-06 15:21:46 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va name ,
|
|
|
|
.Va host.hostname ,
|
|
|
|
and
|
|
|
|
.Va path
|
|
|
|
may not actually be unset.
|
|
|
|
Attempts to unset any of these will revert them to the default values specified
|
|
|
|
below, if they have been overwritten by
|
|
|
|
.Fl o .
|
|
|
|
.Pp
|
|
|
|
All
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar key Ns = Ns Ar value
|
2018-08-06 03:32:25 +00:00
|
|
|
pairs are interpreted as jail parameters as described in
|
|
|
|
.Xr jail 8 .
|
|
|
|
The following default parameters are provided:
|
2018-08-23 02:09:52 +00:00
|
|
|
.Bl -column "allow.mount.devfs" ""
|
|
|
|
.It Va allow.mount Ta Cm true
|
|
|
|
.It Va allow.mount.devfs Ta Cm true
|
|
|
|
.It Va enforce_statfs Ta Cm 1
|
|
|
|
.It Va name Ta Va bootenv
|
|
|
|
.It Va host.hostname Ta Va bootenv
|
|
|
|
.It Va path Ta Set to a path in /tmp generated by
|
2018-08-11 01:40:24 +00:00
|
|
|
.Xr libbe 3 .
|
2018-08-06 03:32:25 +00:00
|
|
|
.El
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
2018-08-06 15:21:46 +00:00
|
|
|
All default parameters may be overwritten.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm list Op Fl DHas
|
2018-07-24 13:17:40 +00:00
|
|
|
Displays all boot environments.
|
2018-08-23 02:09:52 +00:00
|
|
|
The Active field indicates whether the boot environment is active now (N);
|
|
|
|
active on reboot (R); or both (NR).
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Fl a
|
|
|
|
is used, display all datasets.
|
|
|
|
If
|
|
|
|
.Fl D
|
2018-08-23 02:09:52 +00:00
|
|
|
is used, display the full space usage for each boot environment, assuming all
|
|
|
|
other boot environments were destroyed.
|
2018-07-24 13:17:40 +00:00
|
|
|
The
|
|
|
|
.Fl H
|
2018-08-11 01:40:24 +00:00
|
|
|
option is used for scripting.
|
2018-08-23 02:09:52 +00:00
|
|
|
It does not print headers and separate fields by a single tab instead of
|
|
|
|
arbitrary white space.
|
2018-07-24 13:17:40 +00:00
|
|
|
If
|
|
|
|
.Fl s
|
|
|
|
is used, display all snapshots as well.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm mount Ar beName Op Ar mountpoint
|
2018-07-24 13:17:40 +00:00
|
|
|
Temporarily mount the boot environment.
|
|
|
|
Mount at the specified
|
|
|
|
.Ar mountpoint
|
|
|
|
if provided.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm rename Ar origBeName newBeName
|
2018-08-24 20:44:58 +00:00
|
|
|
Renames the given
|
2018-07-24 13:17:40 +00:00
|
|
|
.Ar origBeName
|
|
|
|
to the given
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar newBeName .
|
2018-08-24 20:44:58 +00:00
|
|
|
The boot environment will not be unmounted in order for this rename to occur.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Cm unjail Brq Ar jailID | jailName | beName
|
2018-08-11 04:03:05 +00:00
|
|
|
Destroys the jail created from the given boot environment.
|
2018-08-23 02:09:52 +00:00
|
|
|
.It Xo
|
|
|
|
.Cm unmount
|
2018-07-24 13:17:40 +00:00
|
|
|
.Op Fl f
|
2018-08-23 02:09:52 +00:00
|
|
|
.Ar beName
|
|
|
|
.Xc
|
2018-07-24 13:17:40 +00:00
|
|
|
Unmount the given boot environment, if it is mounted.
|
|
|
|
Specifying
|
|
|
|
.Fl f
|
|
|
|
will force the unmount if busy.
|
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
|
|
|
.Bl -bullet
|
|
|
|
.It
|
|
|
|
To fill in with jail upgrade example when behavior is firm.
|
2018-08-11 01:40:24 +00:00
|
|
|
.El
|
2018-07-24 13:17:40 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr jail 8 ,
|
|
|
|
.Xr zfs 8 ,
|
|
|
|
.Xr zpool 8
|
|
|
|
.Sh HISTORY
|
|
|
|
.Nm
|
|
|
|
is based on
|
2018-08-23 02:09:52 +00:00
|
|
|
.Nm beadm
|
2018-07-24 13:17:40 +00:00
|
|
|
and was implemented as a project for the 2017 Summer of Code, along with
|
|
|
|
.Xr libbe 3 .
|
|
|
|
.Sh AUTHORS
|
2018-08-23 02:09:52 +00:00
|
|
|
.Nm
|
|
|
|
was written by
|
|
|
|
.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in .
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
2018-08-23 02:09:52 +00:00
|
|
|
.Nm beadm
|
|
|
|
was written and is maintained by
|
|
|
|
.An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl .
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
2018-08-11 04:01:24 +00:00
|
|
|
.An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net
|
2018-08-23 02:09:52 +00:00
|
|
|
wrote the original
|
|
|
|
.Nm beadm
|
2018-07-24 13:17:40 +00:00
|
|
|
manual page that this one is derived from.
|