xref: /freebsd/sbin/bectl/bectl.8 (revision b179da0111bf5734c60d07c110e8abae9cea300f)
15952343eSKyle Evans.\"
2*b179da01SKyle Evans.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*b179da01SKyle Evans.\"
4*b179da01SKyle Evans.\" Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
5*b179da01SKyle Evans.\" All rights reserved.
65952343eSKyle Evans.\"
75952343eSKyle Evans.\" Redistribution and use in source and binary forms, with or without
85952343eSKyle Evans.\" modification, are permitted provided that the following conditions
95952343eSKyle Evans.\" are met:
105952343eSKyle Evans.\" 1. Redistributions of source code must retain the above copyright
115952343eSKyle Evans.\"    notice, this list of conditions and the following disclaimer.
125952343eSKyle Evans.\" 2. Redistributions in binary form must reproduce the above copyright
135952343eSKyle Evans.\"    notice, this list of conditions and the following disclaimer in the
145952343eSKyle Evans.\"    documentation and/or other materials provided with the distribution.
155952343eSKyle Evans.\"
165952343eSKyle Evans.\"
175952343eSKyle Evans.\"     @(#)be.1
185952343eSKyle Evans.\" $FreeBSD$
195952343eSKyle Evans.\"
20d694059fSKyle Evans.Dd August 5, 2018
21edbfe3bcSKyle Evans.Dt BECTL 8
225952343eSKyle Evans.Os FreeBSD
235952343eSKyle Evans.Sh NAME
24edbfe3bcSKyle Evans.Nm bectl
255952343eSKyle Evans.Nd Utility to manage Boot Environments on ZFS
265952343eSKyle Evans.Sh SYNOPSIS
275952343eSKyle Evans.Nm
285952343eSKyle Evansactivate
295952343eSKyle Evans.Op Fl t
305952343eSKyle Evans.Ao Ar beName Ac
315952343eSKyle Evans.Nm
325952343eSKyle Evanscreate
335952343eSKyle Evans.Op Fl r
345952343eSKyle Evans.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
355952343eSKyle Evans.Ao Ar beName Ac
365952343eSKyle Evans.Nm
375952343eSKyle Evanscreate
385952343eSKyle Evans.Op Fl r
395952343eSKyle Evans.Ao Ar beName@snapshot Ac
405952343eSKyle Evans.Nm
415952343eSKyle Evansdestroy
425952343eSKyle Evans.Op Fl F
435952343eSKyle Evans.Ao Ar beName | beName@snapshot Ac
445952343eSKyle Evans.Nm
455952343eSKyle Evansjail
462a0b8dc2SKyle Evans.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ...
475952343eSKyle Evans.Ao Ar jailID | jailName Ac
485952343eSKyle Evans.Ao Ar bootenv Ac
495952343eSKyle Evans.Nm
505952343eSKyle Evanslist
515952343eSKyle Evans.Op Fl a
525952343eSKyle Evans.Op Fl D
535952343eSKyle Evans.Op Fl H
545952343eSKyle Evans.Op Fl s
555952343eSKyle Evans.Nm
565952343eSKyle Evansmount
575952343eSKyle Evans.Ao Ar beName Ac
585952343eSKyle Evans.Op mountpoint
595952343eSKyle Evans.Nm
605952343eSKyle Evansrename
615952343eSKyle Evans.Ao Ar origBeName Ac
625952343eSKyle Evans.Ao Ar newBeName Ac
635952343eSKyle Evans.Nm
645952343eSKyle Evans{ ujail | unjail }
655952343eSKyle Evans.Ao Ar jailID | jailName Ac
665952343eSKyle Evans.Ao Ar bootenv Ac
675952343eSKyle Evans.Nm
685952343eSKyle Evans{ umount | unmount }
695952343eSKyle Evans.Op Fl f
705952343eSKyle Evans.Ao Ar beName Ac
715952343eSKyle Evans.Sh DESCRIPTION
725952343eSKyle EvansThe
735952343eSKyle Evans.Nm
745952343eSKyle Evanscommand is used to setup and interact with ZFS boot environments, which are bootable clones of datasets.
755952343eSKyle Evans.Pp
765952343eSKyle Evans.Em Boot Environments
775952343eSKyle Evansallows the system to be upgraded, while preserving the old system environment in a separate ZFS dataset.
785952343eSKyle Evans.Pp
795952343eSKyle Evans.Sh COMMANDS
805952343eSKyle EvansThe following commands are supported by
815952343eSKyle Evans.Nm :
825952343eSKyle Evans.Bl -tag -width activate
835952343eSKyle Evans.It Ic activate
845952343eSKyle Evans.Op Fl t
855952343eSKyle Evans.Ar <beName>
865952343eSKyle Evans.Pp
875952343eSKyle EvansActivate the given
885952343eSKyle Evans.Ar beName
895952343eSKyle Evansas the default boot filesystem. If the
905952343eSKyle Evans.Op Fl t
915952343eSKyle Evansflag is given, this takes effect only for the next boot.
925952343eSKyle Evans.Pp
935952343eSKyle Evans.It Ic create
945952343eSKyle Evans.Op Fl r
955952343eSKyle Evans.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot
965952343eSKyle Evans.Ao Ar beName Ac
975952343eSKyle Evans.Pp
985952343eSKyle EvansCreates a new boot environment named
995952343eSKyle Evans.Ar beName .
1005952343eSKyle EvansIf the -e param is specified, the new environment will be cloned from the given
1015952343eSKyle Evans.Ar nonActiveBe | Ar beName@snapshot .
1025952343eSKyle EvansIf the
1035952343eSKyle Evans.Op Fl r
1045952343eSKyle Evansflag is given, a recursive boot environment will be made.
1055952343eSKyle Evans.Pp
1065952343eSKyle Evans.It Ic create
1075952343eSKyle Evans.Op Fl r
1085952343eSKyle Evans.Ao Ar beName@snapshot Ac
1095952343eSKyle Evans.Pp
1105952343eSKyle EvansCreates a snapshot of the existing boot environment named
1115952343eSKyle Evans.Ar beName .
1125952343eSKyle EvansIf the
1135952343eSKyle Evans.Op Fl r
1145952343eSKyle Evansflag is given, a recursive boot environment will be made.
1155952343eSKyle Evans.Pp
1165952343eSKyle Evans.It Ic destroy
1175952343eSKyle Evans.Op Fl F
1185952343eSKyle Evans.Ao Ar beName | beName@snapshot Ac
1195952343eSKyle Evans.Pp
1205952343eSKyle EvansDestroys the given
1215952343eSKyle Evans.Ar beName
1225952343eSKyle Evansboot environment or
1235952343eSKyle Evans.Ar beName@snapshot
1245952343eSKyle Evanssnapshot.
1255952343eSKyle EvansSpecifying
1265952343eSKyle Evans.Fl F
1275952343eSKyle Evanswill automatically unmount without confirmation.
1285952343eSKyle Evans.Pp
1295952343eSKyle Evans.It Ic jail
1302a0b8dc2SKyle Evans.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ...
1315952343eSKyle Evans.Ao Ar jailID | jailName Ac
1325952343eSKyle Evans.Ao Ar bootenv Ac
1335952343eSKyle Evans.Pp
1345952343eSKyle EvansCreates a jail of the given boot environment.
135d694059fSKyle EvansMultiple
136d694059fSKyle Evans.Fl o
1372a0b8dc2SKyle Evansand
1382a0b8dc2SKyle Evans.Fl u
139d694059fSKyle Evansarguments may be specified.
1402a0b8dc2SKyle Evans.Fl o
1412a0b8dc2SKyle Evanswill set a jail parameter, and
1422a0b8dc2SKyle Evans.Fl u
1432a0b8dc2SKyle Evanswill unset a jail parameter.
1442a0b8dc2SKyle Evans.Pp
1452a0b8dc2SKyle EvansThe
1462a0b8dc2SKyle Evans.Va name ,
1472a0b8dc2SKyle Evans.Va host.hostname ,
1482a0b8dc2SKyle Evansand
1492a0b8dc2SKyle Evans.Va path
1502a0b8dc2SKyle Evansmay not actually be unset.
1512a0b8dc2SKyle EvansAttempts to unset any of these will revert them to the default values specified
1522a0b8dc2SKyle Evansbelow, if they have been overwritten by
1532a0b8dc2SKyle Evans.Fl o .
1542a0b8dc2SKyle Evans.Pp
1552a0b8dc2SKyle EvansAll
156d694059fSKyle Evans.Ar key ,
157d694059fSKyle Evans.Ar value
158d694059fSKyle Evanspairs are interpreted as jail parameters as described in
159d694059fSKyle Evans.Xr jail 8 .
160d694059fSKyle EvansThe following default parameters are provided:
161d694059fSKyle Evans.Bl -tag -width -indent
162d694059fSKyle Evans.It Va allow.mount Ns = Ns Ar true
163d694059fSKyle Evans.It Va allow.mount.devfs Ns = Ns Ar true
164d694059fSKyle Evans.It Va enforce_statfs Ns = Ns Ar 1
165d694059fSKyle Evans.It Va name Ns = Ns Ar bootenv
166d694059fSKyle Evans.It Va host.hostname Ns = Ns Ar bootenv
167d694059fSKyle Evans.It Va path
168d694059fSKyle EvansSet to a path in /tmp generated by
169d694059fSKyle Evans.Xr libbe 8 .
170d694059fSKyle Evans.El
1715952343eSKyle Evans.Pp
1722a0b8dc2SKyle EvansAll default parameters may be overwritten.
1735952343eSKyle Evans.It Ic list
1745952343eSKyle Evans.Op Fl a
1755952343eSKyle Evans.Op Fl D
1765952343eSKyle Evans.Op Fl H
1775952343eSKyle Evans.Op Fl s
1785952343eSKyle Evans.Pp
1795952343eSKyle EvansDisplays all boot environments.
1805952343eSKyle EvansThe Active field indicates whether the boot environment is active now (N); active on reboot (R); or both (NR).
1815952343eSKyle Evans.Pp
1825952343eSKyle EvansIf
1835952343eSKyle Evans.Fl a
1845952343eSKyle Evansis used, display all datasets.
1855952343eSKyle EvansIf
1865952343eSKyle Evans.Fl D
1875952343eSKyle Evansis used, display the full space usage for each boot environment, assuming all other boot environments were destroyed.
1885952343eSKyle EvansThe
1895952343eSKyle Evans.Fl H
1905952343eSKyle Evansoption is used for scripting. It does not print headers and separate fields by a single tab instead of arbitrary white space.
1915952343eSKyle EvansIf
1925952343eSKyle Evans.Fl s
1935952343eSKyle Evansis used, display all snapshots as well.
1945952343eSKyle Evans.Pp
1955952343eSKyle Evans.It Ic mount
1965952343eSKyle Evans.Ao Ar beName Ac
1975952343eSKyle Evans.Op mountpoint
1985952343eSKyle Evans.Pp
1995952343eSKyle EvansTemporarily mount the boot environment.
2005952343eSKyle EvansMount at the specified
2015952343eSKyle Evans.Ar mountpoint
2025952343eSKyle Evansif provided.
2035952343eSKyle Evans.Pp
2045952343eSKyle Evans.It Ic rename Ao Ar origBeName Ac Ao Ar newBeName Ac
2055952343eSKyle Evans.Pp
2065952343eSKyle EvansRenames the given nonactive
2075952343eSKyle Evans.Ar origBeName
2085952343eSKyle Evansto the given
2095952343eSKyle Evans.Ar newBeName
2105952343eSKyle Evans.Pp
2115952343eSKyle Evans.It Ic unmount
2125952343eSKyle Evans.Op Fl f
2135952343eSKyle Evans.Ao Ar beName Ac
2145952343eSKyle Evans.Pp
2155952343eSKyle EvansUnmount the given boot environment, if it is mounted.
2165952343eSKyle EvansSpecifying
2175952343eSKyle Evans.Fl f
2185952343eSKyle Evanswill force the unmount if busy.
2195952343eSKyle Evans.Pp
220ad765da4SKyle Evans.It Ic unjail Ao Ar jailID | jailName | beName Ac
2215952343eSKyle Evans.Pp
2225952343eSKyle EvansDestroys the jail created from the given boot environment.
2235952343eSKyle Evans.Pp
2245952343eSKyle Evans.El
2255952343eSKyle Evans.Sh EXAMPLES
2265952343eSKyle Evans.Bl -bullet
2275952343eSKyle Evans.It
2285952343eSKyle EvansTo fill in with jail upgrade example when behavior is firm.
2295952343eSKyle Evans.Pp
2305952343eSKyle Evans.Sh SEE ALSO
2315952343eSKyle Evans.Xr jail 8 ,
2325952343eSKyle Evans.Xr zfs 8 ,
2335952343eSKyle Evans.Xr zpool 8
2345952343eSKyle Evans.Sh HISTORY
2355952343eSKyle Evans.Nm
2365952343eSKyle Evansis based on
2375952343eSKyle Evans.Xr beadm 1
2385952343eSKyle Evansand was implemented as a project for the 2017 Summer of Code, along with
2395952343eSKyle Evans.Xr libbe 3 .
2405952343eSKyle Evans.Sh AUTHORS
2415952343eSKyle Evans.Bl -bullet
2425952343eSKyle Evans.It
2435952343eSKyle EvansKyle Kneitinger (kneitinger)
2445952343eSKyle Evans.Ar kyle@kneit.in
2455952343eSKyle Evans.Pp
2465952343eSKyle EvansCreator of
2475952343eSKyle Evans.Nm .
2485952343eSKyle Evans.It
2495952343eSKyle EvansSlawomir Wojciech Wojtczak (vermaden)
2505952343eSKyle Evans.Ar vermaden@interia.pl
2515952343eSKyle Evans.Pp
2525952343eSKyle EvansCreator and maintainer of
2535952343eSKyle Evans.Xr beadm 1 .
2545952343eSKyle Evans.It
2555952343eSKyle EvansBryan Drewery (bdrewery)
2565952343eSKyle Evans.Ar bryan@shatow.net
2575952343eSKyle Evans.Pp
2585952343eSKyle EvansWrote the original
2595952343eSKyle Evans.Xr beadm 1
2605952343eSKyle Evansmanual page that this one is derived from.
2615952343eSKyle Evans.El
262