aboutsummaryrefslogtreecommitdiff
path: root/sbin/bectl
Commit message (Collapse)AuthorAgeFilesLines
* bectl(8): authors: Kyle Evans: fine-tuneGraham Perrin2024-04-101-3/+3
| | | | | | | Discussed with Kyle in Discord. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/857
* bectl(8): authors: be more explicitGraham Perrin2024-04-101-2/+4
| | | | | | | | Cross-reference (name) the manual page that was written by Bryan Drewery. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/857
* bectl(8): HISTORY, AUTHORS: further attentionGraham Perrin2024-04-101-5/+2
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/857
* bectl(8): corrections, changesGraham Perrin2024-04-101-16/+24
| | | | | | | | | | | | beadm(1) no longer exists. Cross-reference beadm(8). Aim to improve the HISTORY and AUTHORS sections, including consistency with the manual pages for beadm(8) and libbe(3). Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/857
* bectl: Simplify command aliases.Dag-Erling Smørgrav2024-03-181-7/+2
| | | | | | MFC after: 3 days Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44406
* bectl: Use geopt() and drop mention of -?.Dag-Erling Smørgrav2024-03-182-27/+27
| | | | | | | MFC after: 3 days PR: 272260 Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44405
* libbe: handle destroying/renaming temporary/bootonce boot environmentsR. Christian McDonald2024-01-291-12/+90
| | | | | | | | | | | | | When a temporary/bootonce boot environment is renamed, we need to also update the bootenv nvlist on-disk to reflect the new name. Additionally, when a temporary/bootonce boot environment is destroyed, we also need to clear out the on-disk state. Reviewed by: kevans Approved by: kp MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43591
* sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sbin: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* bectl: fix some `mandoc -Tlint` complaintsKyle Evans2023-10-051-8/+7
| | | | | | | | | | The EXAMPLES mis-comments caused an obnoxious amount of blank space above SEE ALSO when rendered by mandoc to a terminal. The missing termination of .Xo meant the description of -h ran together with the subcommand synopsis. The other changes were generally ignored tags due to context that simply don't need to be there. Provoked by: grahamperrin
* bectl: make mount subcommand less verboseRobert Wing2023-08-231-1/+1
| | | | | | | | | | | | | | | | | | The mount subcommand currently produces output such as: # bectl mount <bootenv> Successfully mounted <bootenv> at <mountpoint> This commit changes it to only print the mountpoint: # bectl mount <bootenv> <mountpoint> This makes it easier to script the mount subcommand. If an error occurs while mounting, an error message is printed to stderr and bectl will exit with a non-zero value. PR: 273180 Reviewed by: kevans, asomers Differential Revision: https://reviews.freebsd.org/D41562
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* libbe: recursively promote deep BE datasetsR. Christian McDonald2023-07-171-7/+5
| | | | | | | | | | | | | beadm will recursively promote deep BE datasets. In order to match the beadm behavior, we need to recursively iterate over child filesystems and promote them along the way. This patch further refines the work from D40903, completing the fix for promotion. Reviewed by: kevans, rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40972
* libbe: promote activated BEs all the wayKyle Evans2023-07-111-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | This matches the beadm behavior; generally, we need to keep promoting until the BE is no longer a clone from a snapshot. This fixes scenarios where the dataset associated with a BE's origin is itself a clone, activating the BE previously would promote it to a clone of the origin's origin. We could keep using be_get_dataset_props here, except for two annoyances: 1.) I couldn't find a clean way to just clear an nvlist rather than having to re-alloc it, and I didn't want to just remove the one prop we're inspecting out of it. 2.) That's a lot of overhead when all we want to do is fetch the origin anyways. Note that this is not a complete fix, but it does fix the majority of cases; deep BE subordinates are still notably broken, pending a patch from Christian. Reported by: R. Christian McDonald <rcm@rcm.sh> Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D40903
* bectl(8): clarifications, expansionGraham Perrin2023-06-281-25/+43
| | | | | Reviewed-by: imp Pull-request: https://github.com/freebsd/freebsd-src/pull/728
* bectl.8: update /homeMike Karels2023-05-251-5/+6
| | | | | | | | | | | The default location for home directories is moving from /usr/home to /home, including the default zfs datasets. Update accordingly. Add zroot/usr/src as replacement example of nested datasets. While here, mark zroot/var as "canmount off" as per current setup. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40206
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-126-6/+6
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* bectl: document the -r flag to bectlKyle Evans2023-04-262-19/+50
| | | | | | | | | | | | | | | | Independent of all of the commands, bectl itself takes an `-r` flag that specifies the BE root to use. This was originally added to facilitate testing, but it was later discovered to be incredibly useful in other scenarios; e.g., trying to recover some boot environments in rescue media. The "BE root" described here is the parent dataset that holds boot environments, but I've no idea if that's an accepted definition for that dataset. Reviewed by: gallatin, imp, Pau Amma MFC after: 1 week Differential Review: https://reviews.freebsd.org/D39710
* zfs: merge openzfs/zfs@431083f75Martin Matuska2023-04-033-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12194 Fix short-lived txg caused by autotrim #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced() #13392 Implementation of block cloning for ZFS #13741 SHA2 reworking and API for iterating over multiple implementations #14282 Sync thread should avoid holding the spa config write lock when possible #14283 txg_sync should handle write errors in ZIL #14359 More adaptive ARC eviction #14469 Fix NULL pointer dereference in zio_ready() #14479 zfs redact fails when dnodesize=auto #14496 improve error message of zfs redact #14500 Skip memory allocation when compressing holes #14501 FreeBSD: don't verify recycled vnode for zfs control directory #14502 partially revert PR 14304 (eee9362a7) #14509 Fix per-jail zfs.mount_snapshot setting #14514 Fix data race between zil_commit() and zil_suspend() #14516 System-wide speculative prefetch limit #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode() #14519 Do not hold spa_config in ZIL while blocked on IO #14523 Move dmu_buf_rele() after dsl_dataset_sync_done() #14524 Ignore too large stack in case of dsl_deadlist_merge #14526 Use .section .rodata instead of .rodata on FreeBSD #14528 ICP: AES-GCM: Refactor gcm_clear_ctx() #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx() #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT() #14544 icp: Prevent compilers from optimizing away memset() in gcm_clear_ctx() #14546 Revert zfeature_active() to static #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list patch #14563 Optimize the is_l2cacheable functions #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL #14567 spl: Add cmn_err_once() to log a message only on the first call #14568 Fix incremental receive silently failing for recursive sends #14569 Restore ASMABI and other Unify work #14576 Fix detection of IBM Power8 machines (ISA 2.07) #14577 Better handling for future crypto parameters #14600 zcommon: Refactor FPU state handling in fletcher4 #14603 Fix prefetching of indirect blocks while destroying #14633 Fixes in persistent error log #14639 FreeBSD: Remove extra arc_reduce_target_size() call #14641 Additional limits on hole reporting #14649 Drop lying to the compiler in the fletcher4 code #14652 panic loop when removing slog device #14653 Update vdev state for spare vdev #14655 Fix cloning into already dirty dbufs #14678 Revert "Do not hold spa_config in ZIL while blocked on IO" Obtained from: OpenZFS OpenZFS commit: 431083f75bdd3efaee992bdd672625ec7240d252
* bectl: Improve error message when ZFS root is not found.Andrew Gallatin2023-03-311-1/+5
| | | | | | | | | | | | | | | | When recovering a system that is unbootable due to some problem with the active BE, it is likely you'll be booted from a rescue image running UFS. In this case, bectl needs help finding the zpool root that you want to operate on. In this case, improve the error message to suggest specifying a root, rather than just emitting a generic error message that might imply, to the naive user, that there is a ZFS compatibility issue between the rescue image and the on-disk ZFS pool. Reviewed by: imp, kevans Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D39346
* pkgbase: Put zfs utilities and lib in their own packageEmmanuel Vadot2022-10-261-1/+1
| | | | | | | | | It is useful to have zfs utilities and lib in a separate package as it allow users to create image that can support ZFS (i.e. not with WITHOUT_ZFS in src.conf set) without bloating the default image with all zfs tools (for example for jails). Differential Revision: https://reviews.freebsd.org/D36225
* bectl: push space-in-name check down into libbeKyle Evans2022-04-031-7/+2
| | | | | | | | | | | | | This check was previously in `create` only, not applying to renames. It should really be applied at the libbe level, so that we can avoid writing about this restriction over and over again. While we're here: `bectl rename` always succeeds, even when it doesn't. Start returning the error. Reported By: Christian McDonald <cmcdonald netgate com> Reviewed by: rew, jwmaag_gmail.com (earlier version) Differential Revision: https://reviews.freebsd.org/D34605
* bectl: add some discussion about boot environment layoutsKyle Evans2022-03-311-1/+91
| | | | | | | | | | | | Discuss the standard type of layout, as well as the "deep" BE layout, and some of the properties of both. Point the various -r flags at this new section, to help users understand which they're working with and what the -r flag is actually doing. Note that we may just deprecate the -r flag in future versions, but the flag will be recognized as a NOP at that point. Reviewed by: pauamma_gundo.com, rew Differential Revision: https://reviews.freebsd.org/D34538
* bectl(8): don't allow creation of boot environments with spacesRobert Wing2021-06-032-1/+12
| | | | | | | | | | | Boot environment datasets that contain spaces are not bootable. When a user attempts to create a boot environment with a space, abort the creation and print an error message. PR: 254441 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D30194
* sbin/bectl: Skip tests if sparse files are not supportedAlex Richardson2021-02-031-0/+7
| | | | | | | | | | | | | The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463
* bectl: remove spurious aok variableKyle Evans2021-01-161-2/+0
| | | | | | | | This rode in with the OpenZFS import. It may have been necessary at some point, but it is no longer and it breaks the WITHOUT_DYNAMICROOT build as it collides with the definition in libspl. Reported-by: Michael Dexter
* bectl: tests: use -R <mount> instead of specifying altrootKyle Evans2021-01-161-1/+1
| | | | | | | | -R is currently shorthand for cachefile=none, altroot=<mount>. This is functionally the same, but perhaps more resilient to future changes that could be necessary that may be added when -R is specified. MFC after: 1 week
* bectl(8): sync man page and help textRobert Wing2021-01-062-11/+9
| | | | | | | | | | | | | | Sync man page with behavior of bectl(8). Sync help text with man page. PR: 246697 Reported by: olgeni Submitted by: olgeni (with changes) Reviewed by: kevans, olgeni Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27482
* pkgbase: Move bectl to the runtime packageEmmanuel Vadot2021-01-041-0/+1
| | | | | | | runtime contain what is needed to boot in single user and repair a system, bectl could be handy to have in this situation. Differential Revision: https://reviews.freebsd.org/D27708
* bectl: simplify the tail end of the jail cmdKyle Evans2020-12-061-4/+2
| | | | | | | | | | | | | | This has already confused me once (and I'm pretty sure I wrote it), so let's clarify: unjailing after the command has completed will only happen if we're interactive and -U has not been specified. This just folds two conditionals together to make it obvious how -b/-U interact with each other. MFC after: 3 days Notes: svn path=/head/; revision=368388
* Fix r368197: suppress error printing for the "check" command.Gleb Smirnoff2020-12-021-2/+3
| | | | | | | Reviewed by: kevans Notes: svn path=/head/; revision=368287
* Print at least something when failing.Gleb Smirnoff2020-11-301-1/+4
| | | | Notes: svn path=/head/; revision=368197
* bectl(8): missing flag in the help messageLuca Pizzamiglio2020-10-301-1/+1
| | | | | | | | | | | | Flag -o for destroy subcommand is missing in the help message, but present in the man page. Fix it. PR: 249325 Approved by: kevans Differential Revision: https://reviews.freebsd.org/D26429 Notes: svn path=/head/; revision=367183
* loader: zfs should support bootonce an nextbootToomas Soome2020-09-214-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").Edward Tomasz Napierala2020-09-141-0/+40
| | | | | | | | PR: 249229 Sponsored by: DARPA Notes: svn path=/head/; revision=365713
* Call atf_skip function in cleanup procedure as it also triggers zfs.ko loadingLi-Wen Hsu2020-09-071-0/+5
| | | | | | | | PR: 249055 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365424
* Temporarily skip sbin.bectl.bectl_test.* i386 kernel in CILi-Wen Hsu2020-09-031-0/+30
| | | | | | | | | kldload zfs.ko on i386 hangs in CI Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365291
* Temporarily skip tests panic i386 kernel in CILi-Wen Hsu2020-09-021-0/+5
| | | | | | | | | | | lib.libbe.be_create.libbe_create sbin.bectl.bectl_test.bectl_create PR: 249055 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365271
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-253-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* bectl(8): Fix output of `bectl list` for the 'Mountpoint' column.Robert Wing2020-08-191-5/+9
| | | | | | | | | | | | | | | | | | | Currently, the output of `bectl list` doesn't align the 'Mountpoint' column correctly when the 'mounted' property of a boot environment dataset is longer than the default column width. Set the 'Mountpoint' column width to the boot environment dataset with the longest 'mounted' property or to the default width, whichever is greater. PR: 241064 Reported by: vermaden@interia.pl Reviewed by: kevans (mentor) Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26048 Notes: svn path=/head/; revision=364369
* 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
* Skip bectl jail test if jail not installed (WITHOUT_JAIL).Olivier Cochard2020-04-291-0/+1
| | | | | | | | | Approved by: kevans Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24613 Notes: svn path=/head/; revision=360465
* 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-242-2/+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
* libbe(3): promote dependent clones when destroying an environmentKyle Evans2020-01-021-0/+45
| | | | | | | | | | | | | | | | | When removing a boot environment iterate over the dependents and process the snapshots by grabbing any clones. Promote the clones we found and then remove the target environment. This fixes the ability to destroy a boot environment when it has been used to spawn one or more other boot environments. PR: 242592 Submitted by: Wes Maag <jwmaag gmail com> (with changes by myself) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22953 Notes: svn path=/head/; revision=356279