Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2022 07:43:51 +1000
From:      Peter Jeremy <peterj@freebsd.org>
To:        Ronald Klop <ronald-lists@klop.ws>
Cc:        Kyle Evans <kevans@freebsd.org>, freebsd-current@freebsd.org, Ryan Moeller <freqlabs@freebsd.org>, "Patrick M. Hausen" <pmh@hausen.com>
Subject:   Re: Beadm can't create snapshot
Message-ID:  <YwVKFz4rn3h1QUoM@server.rulingia.com>
In-Reply-To: <2078216761.314.1661260774009@localhost>
References:  <01000182ac3b8593-fb381303-5719-4863-8fda-2530efcab31b-000000@email.amazonses.com> <2818f3da-3ae2-e6e3-9282-8b62263fb5f3@FreeBSD.org> <C4A81AF9-2C11-4931-B5D9-1B257AB583DF@hausen.com> <YwNCQSL5PmvO2nOs@server.rulingia.com> <623263165.219.1661170200563@localhost> <CACNAnaEcr=9Ua8z%2BGC10pOeBAiDhkaOENEA_GQHpu-X1dxRXeQ@mail.gmail.com> <2078216761.314.1661260774009@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--2pfGHGZUe9Hv8Yqe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2022-Aug-23 15:19:34 +0200, Ronald Klop <ronald-lists@klop.ws> wrote:
>Van: Kyle Evans <kevans@freebsd.org>
>> I was not aware that beadm touches loader.conf, but I find that
>> slightly horrifying. I won't personally make bectl do that, but I
>> guess I could at least document that it doesn't...
>
>Today I looked up something for boot environments myself and read this: ht=
tps://wiki.freebsd.org/BootEnvironments#Setting_Boot_Dataset
>
>"In order for boot environments to be effective, you must let the bootfs z=
pool property control which dataset gets mounted as the root. Particularly,=
 /etc/fstab must be purged of any / mount, and /boot/loader.conf must not b=
e setting vfs.root.mountfrom directly. "
>
>So it is documented somewhere at least.

Looking at the wiki history, Kyle wrote that in January 2020.  I
wonder if he recalls where that requirement came from.

I've gone rummaging through the mailing list history and other wiki
pages.  It seems that vfs.root.mountfrom used to be required - e.g.
 https://lists.freebsd.org/pipermail/freebsd-fs/2011-September/012482.html
 https://lists.freebsd.org/pipermail/svn-src-head/2011-October/030641.html
and people wanted to change that - e.g.
 https://lists.freebsd.org/pipermail/freebsd-current/2009-October/012933.ht=
ml
 https://lists.freebsd.org/pipermail/freebsd-fs/2010-March/008010.html
resulting in it becoming optional in May 2012:
 https://lists.freebsd.org/pipermail/svn-src-head/2012-May/036902.html

Based on the quoted wiki entry, it seems that sometime between May
2012 and January 2020, vfs.root.mountfrom went from "must be set" to
"must not be set" and I can't find anywhere where that is publicised.
This is a serious problem because we now have the situation where
some documentation still says to set vfs.root.mountfrom - e.g.
 https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror step 2.6
and people are still using it without being warned that it shouldn't
be used - e.g. the thread starting
 https://lists.freebsd.org/pipermail/freebsd-fs/2020-July/028351.html

I've had a look at the beadm source and it preserves/updates
vfs.root.mountfrom if it's present in loader.conf but doesn't add it
if it's not present.

IMO, if bectl isn't going to update loader.conf, it needs to warn and
fail if loader.conf contains a vfs.root.mountfrom that points to a
BE that's different to bootfs.  (And ideally, a similar check of
/etc/fstab, though beadm doesn't touch that).

--=20
Peter Jeremy

--2pfGHGZUe9Hv8Yqe
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmMFShJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF
QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi
CzTSTQ//RmmVRpfUgm5oPvt21GLAACEXwdNcH/c2iL0RPJxPRaAl2PMghd06wT6t
xk3G2b2hHguPWfAsNGnUkF7/zaQrqpTJMUEIAu/gvGtgNpwwNRyzBV2mM3Cy+IF7
VNmo6mpUqk5HfU70ne3wcmbU0KIuBjrghN7yQjVdie5pCeAanp8mDW66auMPgyyE
0Yc59P4S/Xts65+ywKOmt5UUi9Q4XJtBGU9sCG5var+pvRjrup1xweKP9Qb9SsC5
aBNsreV0or3/xZSQc7oijckmu5STWju+w8sbuceRRXRSeNsWGPyA1nF14yCtmiLs
qYOTnlN4wPvYQ1BVCty0Bpxxbw3hX5VihWVowT2ilCyOOqaqTjXBw2V1v3N3ncin
aM4HE8Y5EF6zxHz7XBD51x/GTDppk0yXNrsdzq+rUZrSEiGFjaSw42ka/gz9bJC1
sE5Aubcb/IAkXc4KUaaVJD7vcAR4SZGsykImW5Voj3uvGWs7hQOJgJEyzri6daSP
iPHSMHk0+loeoOzxG146jh8DMosmcHB9koLvmSmCXlBDQWixQSvdh+NtMgF3kDkY
dfdpL8v2QUNmN5yfK24VVbv0pf9eZWk+7WbFxNoBPKpq0TBXMPy9JN0uD4P/6InT
Yue4RXB4P1vGFXzp3zzEupj9Hmx7ZvjRv3kKMcscxTqThdKuNKA=
=6lli
-----END PGP SIGNATURE-----

--2pfGHGZUe9Hv8Yqe--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YwVKFz4rn3h1QUoM>