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-13 03:42:14 +00:00
|
|
|
.Dd August 12, 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
|
|
|
|
activate
|
|
|
|
.Op Fl t
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Nm
|
|
|
|
create
|
|
|
|
.Op Fl r
|
|
|
|
.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Nm
|
|
|
|
create
|
|
|
|
.Op Fl r
|
|
|
|
.Ao Ar beName@snapshot Ac
|
|
|
|
.Nm
|
|
|
|
destroy
|
|
|
|
.Op Fl F
|
|
|
|
.Ao Ar beName | beName@snapshot Ac
|
|
|
|
.Nm
|
2018-08-11 04:01:24 +00:00
|
|
|
export
|
|
|
|
.Ao Ar sourceBe Ac
|
|
|
|
.Nm
|
|
|
|
import
|
|
|
|
.Ao Ar targetBe Ac
|
|
|
|
.Nm
|
2018-07-24 13:17:40 +00:00
|
|
|
jail
|
2018-08-06 15:21:46 +00:00
|
|
|
.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ...
|
2018-07-24 13:17:40 +00:00
|
|
|
.Ao Ar jailID | jailName Ac
|
|
|
|
.Ao Ar bootenv Ac
|
|
|
|
.Nm
|
|
|
|
list
|
|
|
|
.Op Fl a
|
|
|
|
.Op Fl D
|
|
|
|
.Op Fl H
|
|
|
|
.Op Fl s
|
|
|
|
.Nm
|
|
|
|
mount
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Op mountpoint
|
|
|
|
.Nm
|
|
|
|
rename
|
|
|
|
.Ao Ar origBeName Ac
|
|
|
|
.Ao Ar newBeName Ac
|
|
|
|
.Nm
|
|
|
|
{ ujail | unjail }
|
|
|
|
.Ao Ar jailID | jailName Ac
|
|
|
|
.Ao Ar bootenv Ac
|
|
|
|
.Nm
|
|
|
|
{ umount | unmount }
|
|
|
|
.Op Fl f
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command is used to setup and interact with ZFS boot environments, which are bootable clones of datasets.
|
|
|
|
.Pp
|
|
|
|
.Em Boot Environments
|
|
|
|
allows the system to be upgraded, while preserving the old system environment in a separate ZFS dataset.
|
|
|
|
.Sh COMMANDS
|
|
|
|
The following commands are supported by
|
|
|
|
.Nm :
|
|
|
|
.Bl -tag -width activate
|
|
|
|
.It Ic activate
|
|
|
|
.Op Fl t
|
|
|
|
.Ar <beName>
|
|
|
|
.Pp
|
|
|
|
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.
|
|
|
|
.It Ic create
|
|
|
|
.Op Fl r
|
|
|
|
.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Pp
|
|
|
|
Creates a new boot environment named
|
|
|
|
.Ar beName .
|
|
|
|
If the -e param is specified, the new environment will be cloned from the given
|
|
|
|
.Ar nonActiveBe | Ar beName@snapshot .
|
|
|
|
If the
|
|
|
|
.Op Fl r
|
|
|
|
flag is given, a recursive boot environment will be made.
|
|
|
|
.It Ic create
|
|
|
|
.Op Fl r
|
|
|
|
.Ao Ar beName@snapshot Ac
|
|
|
|
.Pp
|
|
|
|
Creates a snapshot of the existing boot environment named
|
|
|
|
.Ar beName .
|
|
|
|
If the
|
|
|
|
.Op Fl r
|
|
|
|
flag is given, a recursive boot environment will be made.
|
|
|
|
.It Ic destroy
|
|
|
|
.Op Fl F
|
|
|
|
.Ao Ar beName | beName@snapshot Ac
|
|
|
|
.Pp
|
|
|
|
Destroys the given
|
|
|
|
.Ar beName
|
|
|
|
boot environment or
|
|
|
|
.Ar beName@snapshot
|
|
|
|
snapshot.
|
|
|
|
Specifying
|
|
|
|
.Fl F
|
|
|
|
will automatically unmount without confirmation.
|
2018-08-11 04:01:24 +00:00
|
|
|
.It Ic export
|
|
|
|
.Ao Ar sourceBe Ac
|
|
|
|
.Pp
|
|
|
|
Export
|
|
|
|
.Ar sourceBe
|
|
|
|
to
|
|
|
|
.Dv stdout .
|
|
|
|
.Dv stdout
|
|
|
|
must be piped or redirected to a file.
|
|
|
|
.It Ic import
|
|
|
|
.Ao Ar targetBe Ac
|
|
|
|
.Pp
|
|
|
|
Import
|
|
|
|
.Ar targetBe
|
|
|
|
from
|
|
|
|
.Dv stdin .
|
2018-07-24 13:17:40 +00:00
|
|
|
.It Ic jail
|
2018-08-06 15:21:46 +00:00
|
|
|
.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ...
|
2018-07-24 13:17:40 +00:00
|
|
|
.Ao Ar jailID | jailName Ac
|
|
|
|
.Ao Ar bootenv Ac
|
|
|
|
.Pp
|
|
|
|
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.
|
|
|
|
.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-06 03:32:25 +00:00
|
|
|
.Ar key ,
|
|
|
|
.Ar value
|
|
|
|
pairs are interpreted as jail parameters as described in
|
|
|
|
.Xr jail 8 .
|
|
|
|
The following default parameters are provided:
|
|
|
|
.Bl -tag -width -indent
|
|
|
|
.It Va allow.mount Ns = Ns Ar true
|
|
|
|
.It Va allow.mount.devfs Ns = Ns Ar true
|
|
|
|
.It Va enforce_statfs Ns = Ns Ar 1
|
|
|
|
.It Va name Ns = Ns Ar bootenv
|
|
|
|
.It Va host.hostname Ns = Ns Ar bootenv
|
|
|
|
.It Va path
|
|
|
|
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-07-24 13:17:40 +00:00
|
|
|
.It Ic list
|
|
|
|
.Op Fl a
|
|
|
|
.Op Fl D
|
|
|
|
.Op Fl H
|
|
|
|
.Op Fl s
|
|
|
|
.Pp
|
|
|
|
Displays all boot environments.
|
|
|
|
The Active field indicates whether the boot environment is active now (N); active on reboot (R); or both (NR).
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Fl a
|
|
|
|
is used, display all datasets.
|
|
|
|
If
|
|
|
|
.Fl D
|
|
|
|
is used, display the full space usage for each boot environment, assuming all other boot environments were destroyed.
|
|
|
|
The
|
|
|
|
.Fl H
|
2018-08-11 01:40:24 +00:00
|
|
|
option is used for scripting.
|
|
|
|
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.
|
|
|
|
.It Ic mount
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Op mountpoint
|
|
|
|
.Pp
|
|
|
|
Temporarily mount the boot environment.
|
|
|
|
Mount at the specified
|
|
|
|
.Ar mountpoint
|
|
|
|
if provided.
|
|
|
|
.It Ic rename Ao Ar origBeName Ac Ao Ar newBeName Ac
|
|
|
|
.Pp
|
|
|
|
Renames the given nonactive
|
|
|
|
.Ar origBeName
|
|
|
|
to the given
|
|
|
|
.Ar newBeName
|
2018-08-11 04:03:05 +00:00
|
|
|
.It Ic unjail Ao Ar jailID | jailName | beName Ac
|
|
|
|
.Pp
|
|
|
|
Destroys the jail created from the given boot environment.
|
2018-07-24 13:17:40 +00:00
|
|
|
.It Ic unmount
|
|
|
|
.Op Fl f
|
|
|
|
.Ao Ar beName Ac
|
|
|
|
.Pp
|
|
|
|
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
|
|
|
|
.Xr beadm 1
|
|
|
|
and was implemented as a project for the 2017 Summer of Code, along with
|
|
|
|
.Xr libbe 3 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
.Bl -bullet
|
|
|
|
.It
|
2018-08-11 04:01:24 +00:00
|
|
|
.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
|
|
|
Creator of
|
|
|
|
.Nm .
|
|
|
|
.It
|
2018-08-11 04:01:24 +00:00
|
|
|
.An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
|
|
|
Creator and maintainer of
|
|
|
|
.Xr beadm 1 .
|
|
|
|
.It
|
2018-08-11 04:01:24 +00:00
|
|
|
.An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net
|
2018-07-24 13:17:40 +00:00
|
|
|
.Pp
|
|
|
|
Wrote the original
|
|
|
|
.Xr beadm 1
|
|
|
|
manual page that this one is derived from.
|
|
|
|
.El
|