Summary: | bectl - cannot destroy a boot environment | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Slawomir Wojciech Wojtczak <vermaden> | ||||||
Component: | bin | Assignee: | Kyle Evans <kevans> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | bugs, jwmaag, kevans, kmachine, rew | ||||||
Priority: | --- | Flags: | kevans:
mfc-stable12+
kevans: mfc-stable11+ |
||||||
Version: | 12.0-RELEASE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Slawomir Wojciech Wojtczak
2019-12-12 08:20:49 UTC
Created attachment 209916 [details]
Creation of two BEs
This is an up-to-date FreeBSD 12.1. With bectl I create two BEs, activate the first one and reboot.
Created attachment 209917 [details]
This is what I get after reboot
I would like to destroy default BE, then rename be1 as default. It's not possible with bectl but no problem with beadm (if I used beadm to create the Bes).
(In reply to Emrion from comment #2) Yeah, I see what's going on here- we indeed don't currently promote clones of BE snapshots, but we should. It's slightly complicated by the fact that we support deep BEs and need to make sure we handle those, but we'll work out a solution. Hey Kyle, Have you or anyone else started working on this? If not, I can work on a patch for you to review. -Rob (In reply to Rob from comment #4) Hey, Wes (CC'd now) had started on a patch; I'm not sure what the current status of it is, though. libzfs was being funky funky. A commit references this bug: Author: kevans Date: Thu Jan 2 18:46:35 UTC 2020 New revision: 356279 URL: https://svnweb.freebsd.org/changeset/base/356279 Log: libbe(3): promote dependent clones when destroying an environment 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 Changes: head/lib/libbe/be.c head/lib/libbe/be.h head/lib/libbe/be_error.c head/sbin/bectl/tests/bectl_test.sh Fix committed as r356279; will MFC in ~1 week. Thanks! A commit references this bug: Author: kevans Date: Fri Jan 10 03:37:54 UTC 2020 New revision: 356593 URL: https://svnweb.freebsd.org/changeset/base/356593 Log: MFC r356279: libbe(3): promote dependent clones when destroying a BE 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 Changes: _U stable/11/ stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_error.c stable/11/sbin/bectl/tests/bectl_test.sh _U stable/12/ stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_error.c stable/12/sbin/bectl/tests/bectl_test.sh |