diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index af37d255a822..533823463880 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -26,101 +26,106 @@ .Nd Utility to manage Boot Environments on ZFS .Sh SYNOPSIS .Nm -activate +.Cm activate .Op Fl t -.Ao Ar beName Ac +.Ar beName .Nm -create +.Cm create .Op Fl r -.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot -.Ao Ar beName Ac +.Op Fl e Brq Ar nonActiveBe | beName@snapshot +.Ar beName .Nm -create +.Cm create .Op Fl r -.Ao Ar beName@snapshot Ac +.Ar beName@snapshot .Nm -destroy +.Cm destroy .Op Fl F -.Ao Ar beName | beName@snapshot Ac +.Brq Ar beName | beName@snapshot .Nm -export -.Ao Ar sourceBe Ac +.Cm export +.Ar sourceBe .Nm -import -.Ao Ar targetBe Ac +.Cm import +.Ar targetBe .Nm -jail -.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... -.Ao Ar jailID | jailName Ac -.Ao Ar bootenv Ac +.Cm jail +.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... +.Brq Ar jailID | jailName +.Ar bootenv .Nm -list -.Op Fl a -.Op Fl D -.Op Fl H -.Op Fl s +.Cm list +.Op Fl DHas .Nm -mount -.Ao Ar beName Ac +.Cm mount +.Ar beName .Op mountpoint .Nm -rename -.Ao Ar origBeName Ac -.Ao Ar newBeName Ac +.Cm rename +.Ar origBeName +.Ar newBeName .Nm -{ ujail | unjail } -.Ao Ar jailID | jailName Ac -.Ao Ar bootenv Ac +.Brq Cm ujail | unjail +.Brq Ar jailID | jailName +.Ar bootenv .Nm -{ umount | unmount } +.Brq Cm umount | unmount .Op Fl f -.Ao Ar beName Ac +.Ar beName .Sh DESCRIPTION The .Nm -command is used to setup and interact with ZFS boot environments, which are bootable clones of datasets. +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. +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 +.It Xo +.Cm activate .Op Fl t -.Ar -.Pp +.Ar beName +.Xc Activate the given .Ar beName as the default boot filesystem. If the -.Op Fl t +.Fl t flag is given, this takes effect only for the next boot. -.It Ic create +.It Xo +.Cm create .Op Fl r -.Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot -.Ao Ar beName Ac -.Pp +.Op Fl e Brq Ar nonActiveBe | beName@snapshot +.Ar beName +.Xc 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 +.Fl e +argument is specified, the new environment will be cloned from the given +.Brq Ar nonActiveBe | Ar beName@snapshot . +If the +.Fl r flag is given, a recursive boot environment will be made. -.It Ic create +.It Xo +.Cm create .Op Fl r -.Ao Ar beName@snapshot Ac -.Pp +.Ar beName@snapshot +.Xc Creates a snapshot of the existing boot environment named .Ar beName . If the -.Op Fl r +.Fl r flag is given, a recursive boot environment will be made. -.It Ic destroy +.It Xo +.Cm destroy .Op Fl F -.Ao Ar beName | beName@snapshot Ac -.Pp +.Brq Ar beName | beName@snapshot +.Xc Destroys the given .Ar beName boot environment or @@ -129,27 +134,24 @@ snapshot. Specifying .Fl F will automatically unmount without confirmation. -.It Ic export -.Ao Ar sourceBe Ac -.Pp +.It Cm export Ar sourceBe Export .Ar sourceBe to .Dv stdout . .Dv stdout must be piped or redirected to a file. -.It Ic import -.Ao Ar targetBe Ac -.Pp +.It Cm import Ar targetBe Import .Ar targetBe from .Dv stdin . -.It Ic jail -.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... -.Ao Ar jailID | jailName Ac -.Ao Ar bootenv Ac -.Pp +.It Xo +.Cm jail +.Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... +.Brq Ar jailID | jailName +.Ar bootenv +.Xc Creates a jail of the given boot environment. Multiple .Fl o @@ -172,66 +174,58 @@ below, if they have been overwritten by .Fl o . .Pp All -.Ar key , -.Ar value +.Ar key Ns = Ns 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 +.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 .Xr libbe 3 . .El .Pp All default parameters may be overwritten. -.It Ic list -.Op Fl a -.Op Fl D -.Op Fl H -.Op Fl s -.Pp +.It Cm list Op Fl DHas Displays all boot environments. -The Active field indicates whether the boot environment is active now (N); active on reboot (R); or both (NR). +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. +is used, display the full space usage for each boot environment, assuming all +other boot environments were destroyed. The .Fl H option is used for scripting. -It does not print headers and separate fields by a single tab instead of arbitrary white space. +It does not print headers and separate fields by a single tab instead of +arbitrary white space. If .Fl s is used, display all snapshots as well. -.It Ic mount -.Ao Ar beName Ac -.Op mountpoint -.Pp +.It Cm mount Ar beName Op Ar mountpoint 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 +.It Cm rename Ar origBeName newBeName Renames the given nonactive .Ar origBeName to the given -.Ar newBeName -.It Ic unjail Ao Ar jailID | jailName | beName Ac -.Pp +.Ar newBeName . +.It Cm unjail Brq Ar jailID | jailName | beName Destroys the jail created from the given boot environment. -.It Ic unmount +.It Xo +.Cm unmount .Op Fl f -.Ao Ar beName Ac -.Pp +.Ar beName +.Xc Unmount the given boot environment, if it is mounted. Specifying .Fl f @@ -249,31 +243,25 @@ To fill in with jail upgrade example when behavior is firm. .Sh HISTORY .Nm is based on -.Xr beadm 1 +.Nm beadm and was implemented as a project for the 2017 Summer of Code, along with .Xr libbe 3 . .Sh AUTHORS -.Bl -bullet -.It -.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in +.Nm +was written by +.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in . .Pp -Creator of -.Nm . -.It -.An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl +.Nm beadm +was written and is maintained by +.An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl . .Pp -Creator and maintainer of -.Xr beadm 1 . -.It .An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net -.Pp -Wrote the original -.Xr beadm 1 +wrote the original +.Nm beadm manual page that this one is derived from. .El .Sh BUGS -.Nm -import +.Nm Cm import does not destroy the temporary boot environment it creates for import, because the snapshot created to do the import may not be deleted since it is the origin of the new boot environment. diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index f4094b57ee58..99e118460ee3 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -67,22 +67,22 @@ usage(bool explicit) fp = explicit ? stdout : stderr; fprintf(fp, - "usage:\tbectl ( -h | -? | subcommand [args...] )\n" + "usage:\tbectl {-h | -? | subcommand [args...]}\n" "\tbectl activate [-t] beName\n" - "\tbectl create [-e nonActiveBe | -e beName@snapshot] beName\n" + "\tbectl create [-e {nonActiveBe | beName@snapshot}] beName\n" "\tbectl create beName@snapshot\n" - "\tbectl destroy [-F] beName | beName@snapshot⟩\n" + "\tbectl destroy [-F] {beName | beName@snapshot}\n" "\tbectl export sourceBe\n" "\tbectl import targetBe\n" #if SOON "\tbectl add (path)*\n" #endif - "\tbectl jail [ -o key=value | -u key ]... bootenv\n" - "\tbectl list [-a] [-D] [-H] [-s]\n" + "\tbectl jail [{-o key=value | -u key}]... bootenv\n" + "\tbectl list [-DHas]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" - "\tbectl { ujail | unjail } ⟨jailID | jailName | bootenv)\n" - "\tbectl { umount | unmount } [-f] beName\n"); + "\tbectl {ujail | unjail} {jailID | jailName | bootenv}\n" + "\tbectl {umount | unmount} [-f] beName\n"); return (explicit ? 0 : EX_USAGE); }