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