From nobody Wed Apr 06 14:33:20 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BE4EF1A95A74; Wed, 6 Apr 2022 14:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KYRnr35cKz3Qkp; Wed, 6 Apr 2022 14:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649255600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDQ5zl1cfmwp+8Yo026Lk9ieorgjbVvRrd3f51M+fF8=; b=N39RZqWYB7+45P9tbSrAuf3bvmfzsbfQKxvb4HELogxbjXwoMe1JcLOB9lSsNHdPp7qffV G+8njE1ZPHGHKhdz98rYRnTn3hbtYyC0AEBGxRsgUE6U/Wi0VRb9Z6DfM5VDq0ZArDZUW+ GNqe10TGrwGMhWIdVZdYUOH5bod8lwTtFqNu9nQ7q+ZOswymHoBVpVgprgzxOQrswG1hRv 0x4kT9BnaoS3VxYfuwmYhl6kQba+S6cFjyCVQe7zGNabnshrEO3u3rkIY0368rSSQeRHUh NINVsI7qyJYw4+Uh0Gv7v+XxpU3XZrpPwmeufcNBC4YKcKxGDNZO7+Y8Qpxdxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35E601CE9D; Wed, 6 Apr 2022 14:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 236EXKAg066279; Wed, 6 Apr 2022 14:33:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 236EXKfq066278; Wed, 6 Apr 2022 14:33:20 GMT (envelope-from git) Date: Wed, 6 Apr 2022 14:33:20 GMT Message-Id: <202204061433.236EXKfq066278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 41e0b07a5e2a - releng/13.1 - bectl: add some discussion about boot environment layouts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 41e0b07a5e2a42cc2d6532ee529b6190bd14a69d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649255600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDQ5zl1cfmwp+8Yo026Lk9ieorgjbVvRrd3f51M+fF8=; b=VstMGFkMMn6lcAIAg8DG3OL72AjJwy2trdONIYbhrAku2xj5im3BUV4lHRkVHSjOj8DyW5 rOCc6zSQXv+ATi1OAFKO2z+oiqmnoDJpxbLdAMhMeyFBcfEDcCvNM2+/XkG0ao55r1YHw/ xbAckQ26LgoQSs1VsglOhjXiYbdjPnc4VQQbMEQnzWHQoqGWgv0aCHm9/8IIUXtiCHuA4j PO/evFWKmp4TvqOgMoiYR+mqCAf0pQvVhMA2rmoquQZoXpO+NXXeGor1lCPEsO1pLkjY9O 6Bu3Ic4+0PMT7Tu1wvOmgFMv4NfkNA3PEj/jE251lRkU17qs6k5tRjnHLbf1AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649255600; a=rsa-sha256; cv=none; b=A0pF1ZfTchMLSR9JugUX6ZuJcsI6bdWsBhHOGB4wPlW/VO+dAxjgAwrCbGjx48Aiyki9gR UaKDAwGbmM1zThlUUXSEmsAEng7JkJc6H9/9m9lxUwn8syYY5/U8L9GjylMJD0ywzZZE3e nzeYm9Jl3VvQlc9qw2qIhWulcNXvBq9IRz+GR6GURProQJWEwR0uJSvLXRYdqL8XgIuZgr 4EYzU/RVlSLyUlhSTARjr4BYLjtC7Jw89yAkIeJPSBBzWW3kt/nyNX/3++gKOlOeHfgbwY 9xCNaqnLRHHcHhJyfG6+KFPEgBdlMdkMmCsl3KFKL+OjSZFz8XafJDiUl8QFng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=41e0b07a5e2a42cc2d6532ee529b6190bd14a69d commit 41e0b07a5e2a42cc2d6532ee529b6190bd14a69d Author: Kyle Evans AuthorDate: 2022-03-31 22:41:53 +0000 Commit: Kyle Evans CommitDate: 2022-04-06 14:32:48 +0000 bectl: add some discussion about boot environment layouts 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. Approved by: re (gjb) (cherry picked from commit c0f846ff235296249271b1235ff6a52b7d23cefb) (cherry picked from commit 0e90da6549d177874437dc2e7bab085873538da2) --- sbin/bectl/bectl.8 | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index 4b7868e093eb..79bdec751a86 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2021 +.Dd March 31, 2022 .Dt BECTL 8 .Os .Sh NAME @@ -131,6 +131,9 @@ Create a new boot environment named If the .Fl r flag is given, a recursive boot environment will be made. +See +.Sx Boot Environment Structures +for a discussion on different layouts. .Pp If the .Fl e @@ -155,6 +158,9 @@ If the .Fl r flag is given, a recursive snapshot of the boot environment will be created. A snapshot is created for each descendant dataset of the boot environment. +See +.Sx Boot Environment Structures +for a discussion on different layouts. .Pp No new boot environment is created with this command. .It Xo @@ -345,6 +351,90 @@ prints usage information if or .Fl \&? is specified. +.Ss Boot Environment Structures +The traditional +.Fx +boot environment layout, as created by the Auto ZFS option to +.Xr bsdinstall 8 , +is a +.Dq shallow +boot environment structure, where boot environment datasets do not have any +directly subordinate datasets. +Instead, they're organized off in +.Pa zroot/ROOT , +and they rely on datasets elsewhere in the pool having +.Dv canmount +set to +.Dv off . +For instance, a simplified pool may be laid out as such: +.Bd -literal -offset indent +% zfs list -o name,canmount,mountpoint +NAME CANMOUNT MOUNTPOINT +zroot +zroot/ROOT noauto none +zroot/ROOT/default noauto none +zroot/usr off /usr +zroot/usr/home on /usr/home +zroot/var on /var +.Ed +.Pp +In that example, +.Pa zroot/usr +has +.Dv canmount +set to +.Dv off , +thus files in +.Pa /usr +typically fall into the boot environment because this dataset is not mounted. +.Pa zroot/usr/home +is mounted, thus files in +.Pa /usr/home +are not in the boot environment. +.Pp +The other style of boot environments in use, frequently called +.Dq deep boot environments , +organizes some or all of the boot environment as subordinate to the boot +environment dataset. +For example: +.Bd -literal -offset indent +% zfs list -o name,canmount,mountpoint +NAME CANMOUNT MOUNTPOINT +zroot +zroot/ROOT noauto none +zroot/ROOT/default noauto none +zroot/ROOT/default/usr noauto /usr +zroot/ROOT/default/usr/local noauto /usr/local +zroot/var on /var +.Ed +.Pp +Note that the subordinate datasets now have +.Dv canmount +set to +.Dv noauto . +These are more obviously a part of the boot environment, as indicated by their +positioning in the layout. +These subordinate datasets will be mounted by the +.Dv zfsbe +.Xr rc 8 +script at boot time. +In this example, +.Pa /var +is excluded from the boot environment. +.Pp +.Nm +commands that have their own +.Fl r +operate on this second, +.Dq deep +style of boot environment, when the +.Fl r +flag is set. +A future version of +.Nm +may default to handling both styles and deprecate the various +.Fl r +flags. \" .Sh EXAMPLES \" .Bl -bullet \" .It