aboutsummaryrefslogtreecommitdiff
path: root/sbin/bectl/bectl.8
Commit message (Collapse)AuthorAgeFilesLines
* loader: zfs should support bootonce an nextbootToomas Soome2020-09-211-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootonce feature is temporary, one time boot, activated by "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag. By default, the bootonce setting is reset on attempt to boot and the next boot will use previously active BE. By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will be set permanently active. bootonce dataset name is recorded in boot pool labels, bootenv area. in case of nextboot, the nextboot_enable boolean variable is recorded in freebsd:nvstore nvlist, also stored in boot pool label bootenv area. On boot, the loader will process /boot/nextboot.conf if nextboot_enable is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf processing on next boot. bootonce and nextboot features are usable in both UEFI and BIOS boot. To use bootonce/nextboot features, the boot loader needs to be updated on disk; if loader.efi is stored on ESP, then ESP needs to be updated and for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated (gpart or other tools). At this time, only lua loader is updated. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25512 Notes: svn path=/head/; revision=365938
* Comment out TODO notes from bectl(8) manual pageMateusz Piotrowski2020-08-171-5/+5
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=364295
* Remove an unnecessary macroMateusz Piotrowski2020-08-171-2/+2
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=364294
* bectl.8: correctly sort SEE ALSO section after 360078Alan Somers2020-04-191-1/+1
| | | | | | | | | Reported by: yuripv MFC after: 2 weeks MFC with: 360078 Notes: svn path=/head/; revision=360086
* bectl.8, beinstall.sh.8: fix man page section of beinstall.shAlan Somers2020-04-181-2/+2
| | | | | | | | Reported by: phk MFC after: 2 weeks Notes: svn path=/head/; revision=360078
* Drop "All Rights Reserved" from all libbe/bectl filesKyle Evans2020-01-241-1/+0
| | | | | | | | | I sent out an e-mail on 2020/01/21 with a plan to do this to Kyle, Rob, and Wes; all parties have responded in the affirmative that it's OK to drop it from these files. Notes: svn path=/head/; revision=357067
* bectl(8): Add a "check" commandKyle Evans2019-09-111-1/+12
| | | | | | | | | | | | | | | | | | | | | This command simply returns 0 at the moment and explicitly takes no arguments. This should be used by utilities wanting to see if bectl can operate on the system they're running, or with a specific root (`bectl -r`). It may grow more checks than "will libbe successfully init" in the future, but for now this is enough as that checks for the dataset mounted at "/" and that it looks capable of being a BE root (e.g. it's not a top-level dataset) bectl commands can now specify if they want to be silent, and this will turn off libbe_print_on_error so they can control the output as needed. This is already used in `bectl check`, and may be turned on in the future for some other commands where libbe errors are better suppressed as the failure mode may be obvious. Requested by: David Fullard MFC after: 3 days Notes: svn path=/head/; revision=352211
* bectl(8): implement sorting for 'bectl list' outputKyle Evans2019-09-041-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow 'bectl list' to sort output by a given property name. The property name is passed in using a command-line flag, '-c' for ascending order and '-C' for descending order. The properties allowed to sort by are: - name (the default output, even if '-c' or '-C' are not used) - creation - origin - used - usedds - usedsnap - usedrefreserv The default output for 'bectl list' is now ascending alphabetical order of BE name. To sort by creation time from earliest to latest, the command would be 'bectl list -c creation' Submitted by: Rob Fairbanks <rob.fx907 gmail com> Reviewed by: ler MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20818 Notes: svn path=/head/; revision=351813
* bectl(8): add description for create subcommandKyle Evans2019-05-221-1/+19
| | | | | | | | | | | | | | | | | | | In commit r345845, a portion of documentation for the create subcommand was removed. Specifically, for creating a snapshot of an existing boot environment. bectl even has a test-case for this functionality. Removing the sub-command description was discussed in PR 235850. This patch brings back the second "create" description that was originally in place. Albeit, with a few wording/clarifying changes. Submitted by: Rob Fairbanks <rob.fx907 gmail com> Reviewed by: kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20249 Notes: svn path=/head/; revision=348127
* bectl.8: Bump date after r345845Mateusz Piotrowski2019-04-031-1/+1
| | | | | | | Approved by: kevans Notes: svn path=/head/; revision=345846
* bectl.8: Clean up & clarify the create subcommandMateusz Piotrowski2019-04-031-60/+79
| | | | | | | | | | | | | | | | - Improve formatting - Use consistent variable names - Improve the description of the create subcommand (1) PR: 235850 (1) Submitted by: kevans (1) Reported by: ler (1) Reviewed by: kevans Approved by: src (kevans) Differential Revision: https://reviews.freebsd.org/D19666 Notes: svn path=/head/; revision=345845
* bectl(8): Add -o flag to destroy to clean up the origin snapshot of BEKyle Evans2019-02-111-3/+11
| | | | | | | | | | | | | | | | | | | | | We can't predict when destruction of origin is needed, and currently we have a precedent for not prompting for things. Leave the decision up to the user of bectl(8) if they want the origin snapshot to be destroyed or not. Emits a warning when -o isn't used and an origin snapshot is left to be cleaned up, for the time being. This is handy when one drops the -o flag but really did want to clean up the origin. A couple of -e ignore's have been sprinkled around the test suite for places that we don't care that the origin's not been cleaned up. -o functionality tests will be added in the future, but are omitted for now to reduce conflicts with work in flight to fix bits of the tests. Reported by: Shawn Webb MFC after: 1 week Notes: svn path=/head/; revision=343993
* bectl: use jail id as the default jail name for a boot environmentKyle Evans2018-12-251-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, bectl is setting the jail 'name' parameter to the boot environment name, which causes an error when the boot environment name is not a valid jail name. With the attached fix, when no name is supplied, the default jail name will be the jail id - this is is the same behavior as the jail command. Additionally, this commit addresses two other bugs that prevented unjailing in scenarios where the jail name does not match the boot environment name: 1. In 'bectl_locate_jail', 'mountpoint' is used to resolve the boot environment path, but really 'mounted' should be used. 'mountpoint' is the path where the zfs dataset will be mounted. 'mounted' is the path where the dataset is actually mounted. 2. in 'bectl_search_jail_paths', 'jail_getv' would fail after the first call. Which is fine, if the boot environment you're unjailing is the next one up. According to 'man jail_getv', it's expecting name and value strings. 'jail_getv' is being passed an integer for the lastjid, so amend that to use a string instead. Test cases have been amended to reflect the bugs found. PR: 233637 Submitted by: Rob <rob.fx907_gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18607 Notes: svn path=/head/; revision=342466
* Cross-reference libbe(3) and bectl(8).Mateusz Piotrowski2018-11-211-1/+2
| | | | | | | | | | | | | Those two manual pages are already referencing each other in the HISTORY sections, which people might skip. Mention those manual pages explicitly in the SEE ALSO sections. Also, remove a reference to be(1) from libbe(3). Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18136 Notes: svn path=/head/; revision=340723
* libbe(3)/bectl(8): Make consistent with beadmKyle Evans2018-08-241-3/+5
| | | | | | | | | | | | | | | | | | | | vermaden (maintainer of beadm) points out the following inconsistencies: - "missing command" is not printed prior to usage if the error is simply a missing command; this should be obvious from the context - "bectl rename" isn't using the "don't unmount" flag (zfs rename -u), so the active BE can't be renamed. It doesn't make sense in our context to *not* use -u, so use it. Documentation updates reflect the above and note an inconsistency with the 'destroy' command that is consistent with other parts of the base system. A fix for libbe(3) not properly being installed to /lib is included. SHLIBDIR should have been added when it was moved in r337995. Approved by: re (kib) Notes: svn path=/head/; revision=338303
* bectl(8): Man page and usage cleanupKyle Evans2018-08-231-109/+97
| | | | | | | | | | | | | - Some overly-long lines - Consistently using .Brq ({}) - Consistently using .Cm - Not using .Ao/.Ac around .Ar PR: 230576 Submitted by: Yuri Pankov (with a fair amount of rebasing pre-commit) Notes: svn path=/head/; revision=338222
* bectl(8): jail: Tear down jail by default after command exitsKyle Evans2018-08-231-2/+10
| | | | | | | | | | | | | | | | Add a -U flag to get back the old behavior. The new behavior is a little more friendly to the common use cases, jail the BE and execute a script. Having the jail torn down automatically when the script is finished, or when you exit the shell, is a little more friendly than having to remember to `bectl ujail`. Batch mode (-b) will continue to leave the jail up, as it's assumed the caller has other intentions. Submitted by: Shawn Webb (partially) Notes: svn path=/head/; revision=338221
* bectl(8): Allow running a custom command in the 'jail' subcommandKyle Evans2018-08-181-2/+12
| | | | | | | | | | | | | | | | | | | Instead of always running /bin/sh, allow the user to specify the command to run. The jail is not removed when the command finishes. Meaning, `bectl unjail` will still need to be run. For example: ``` bectl jail newBE pkg upgrade bectl ujail newBE ``` Submitted by: Shawn Webb Obtained from: HardenedBSD (8b451014ab) Notes: svn path=/head/; revision=337993
* bectl(8): Add batch mode to jail subcommandKyle Evans2018-08-171-1/+7
| | | | | | | | | | | Adding batch mode to the jail `bectl(8)` subcommand enables jailing of ZFS Boot Environments in a scriptable fashion. Submitted by: Shawn Webb Obtained from: HardenedBSD (9e72d1c59a and ef7b6d9e1c with minor edit) Notes: svn path=/head/; revision=337947
* libbe(3): Fix be_import to delete temp snapshotKyle Evans2018-08-131-7/+1
| | | | | | | | | | | | Deleting the temp snapshot isn't immediately possible because it's the origin of the newly imported boot environment. However, this is trivially solved by opening the new boot environment and promoting it. The roles are now reversed and the temp snapshot/dataset may be completely destroyed. Remove the BUGS from libbe(3) and bectl(8). Notes: svn path=/head/; revision=337697
* bectl(8): Also document the import bug.Kyle Evans2018-08-111-0/+6
| | | | Notes: svn path=/projects/bectl/; revision=337606
* bectl(8): Swap the order of ujail/umount documentation...Kyle Evans2018-08-111-3/+3
| | | | | | | "Despite my inconsistency, consistency is king." -Anonymous Notes: svn path=/projects/bectl/; revision=337603
* bectl(8): Document export/importKyle Evans2018-08-111-6/+25
| | | | Notes: svn path=/projects/bectl/; revision=337602
* libbe(3)/bectl(8): Make igor and mandoc -Tlint a little happierKyle Evans2018-08-111-19/+11
| | | | Notes: svn path=/projects/bectl/; revision=337598
* libbe(3)/bectl(8): Standardize $FreeBSD$ IDsKyle Evans2018-08-071-0/+1
| | | | Notes: svn path=/projects/bectl/; revision=337416
* libbe(3)/bectl(8): Standardize copyright headersKyle Evans2018-08-071-1/+4
| | | | | | | | | | | | - File names don't necessarily need to be repeated - Add SPDX tags - Add a missing copyright for Kyle Kneitinger in bectl.8, originally written by him in GSoC 2017; his standard copyright notice has been copied from other files within the same directory to remain consistent with how he clearly wished to portray it Notes: svn path=/projects/bectl/; revision=337414
* bectl(8): Provide -u option to unset jail parametersKyle Evans2018-08-061-5/+21
| | | | | | | All but name, host.hostname, and path may be completely unset. Notes: svn path=/projects/bectl/; revision=337380
* bectl(8): bectl jail improvementsKyle Evans2018-08-061-1/+24
| | | | | | | | | | | | | - Support passing arbitrary jail arguments via -o - Split the related (and rewritten since the GSoC) jail bits out into a new bectl_jail.c file, to reduce clutter in bectl.c - Don't use RFC 1918 IP space [0]; we'll instead set no default IPv4 and let the user pass in any address options they wish via -o Reported by: rgrimes [0], Shawn Webb [0] Notes: svn path=/projects/bectl/; revision=337368
* bectl(8): Support unjailing a boot environmentKyle Evans2018-07-261-2/+1
| | | | | | | | | | The given parameter may either be a jid, jail name, or a BE name. In all cases, the parameter will be resolved to a jid and bectl(8) will sanity-check that there's actually a BE mounted at the requested jail root before invoking jail_remove(2). Notes: svn path=/projects/bectl/; revision=336730
* bectl(8): Chase rename in manpageKyle Evans2018-07-241-3/+3
| | | | Notes: svn path=/projects/bectl/; revision=336670
* Rename be(1) to bectl(8); continues to live in /sbinKyle Evans2018-07-241-0/+220
Discussed with: rpokala, allanjude Notes: svn path=/projects/bectl/; revision=336669