From nobody Sat Aug 27 04:01:09 2022 X-Original-To: freebsd-fs@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 4MF30X6Zdnz4ZP4q for ; Sat, 27 Aug 2022 04:01:16 +0000 (UTC) (envelope-from peterj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MF30X66mhz3MDj for ; Sat, 27 Aug 2022 04:01:16 +0000 (UTC) (envelope-from peterj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661572876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=h/SSTUEMRr3E1T61KnIUS3btBIheOo9gWCYcmfWPrlA=; b=YF/t82tT0xajBi/2XRYEra1RYV5P197I8X5Dd/2uInWCkhlkYED+ayuELgvyNyp9DK0c/6 iMrDkzVcwhNpEDmEt9wI7PYbp5yn8WR2xvLMuoGDf7ucBKQG1NxdxOgKE8ira7CLg+JtZY 1rJRfFtBP743KIQHevlgtdvfxkpTR2DpbYMXIRpUMiNPcD6HKR8rXWNjrrScBSWIU9+0m6 ONL+yxRT0sFeuCP/wqu6FIP5cZaTPqgpJSKTlbVQw+z+kCb4cBS5MnRG8q+37qVx5D9FOf 4nBocVaGu8tNanhdktXdqM/2OkG0PZJZQmdBYqcCQAP+zYlYxYaFz2loMneBYg== Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) (Authenticated sender: peterj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4MF30X0Gd2z15qj for ; Sat, 27 Aug 2022 04:01:15 +0000 (UTC) (envelope-from peterj@freebsd.org) Date: Sat, 27 Aug 2022 14:01:09 +1000 From: Peter Jeremy To: freebsd-fs@freebsd.org Subject: ZFS bootfs vs vfs.root.mountfrom Message-ID: List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SMVHMpE6bcvqhvH5" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661572876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=h/SSTUEMRr3E1T61KnIUS3btBIheOo9gWCYcmfWPrlA=; b=udR99UDafYLqArg5zOzWAM+Tl3zLLEdDLRj3s8tbG8aCVGhaHBiGYyP0m7AOosgsjvx5iN SslXw465lKq243FeGz4YWVtxMEFCJkXJue02bJ/fPjgZvqNQOjZAFT3g3F3TSXlZadKK/j V5ZfSiBXZRwMq94Cptkj1xb6A0WICUfN+ekhvPV5XeF+3WiL+F4Hh7iXU3DgnQEvn8e79h XD8kMA9SGnKVIDH2E0XFVrTvIggNrk9hiEZHEgLdtL7MyV1AQ0/09PSEf074QQeFTEKkjY tkayHXovXcegkR4eQUxuxvN98pTswS1KoQzcRA7mZpObSF3VwGdakEFolGYjQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661572876; a=rsa-sha256; cv=none; b=G1HlILyEQv4PJlzUsGFAl/O2ww6ALtyorouc2IH1k57cTs0C+FknANrZDXuMeEF+Rptgmc Gajd7ZgCPGWC7fzNbaH8GjNEilIwKPz0N8H64sThcIpTRSS4SPfWJ/6KCG7J25xgBWDzlQ fDbtsI/euLeQQgLtHMaW+GVhD3HhKKaAwd3izh9qwrqXbqF3VAMubt8fegIduJsVKqXI74 9sTzvlHaNqZHIR955ONyJiPj+6ysxQT3cM16GvpqczgHxTuaT7CbfSyzyymhqdrR+DfxwI uix0ZfGJpXMRXmD1kXzFXFNNPHpzA1I6fE1973Rn4uF3A94cyCdzLP//PdIsJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --SMVHMpE6bcvqhvH5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable When booting from ZFS was first introduced, the recommended approach was to configure the root filesystem via vfs.root.mountfrom. See (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 to use the zpool bootfs property - 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 SVN r235330 in May 2012: https://lists.freebsd.org/pipermail/svn-src-head/2012-May/036902.html The recommendation to use vfs.root.mountfrom remains in parts of the wiki (e.g. https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror step 2.6) and on mailing list posts (e.g. the thread starting at https://lists.freebsd.org/pipermail/freebsd-fs/2020-July/028351.html). The loader(8) and loader.conf(5) man pages state that the root filesystem is set by vfs.root.mountfrom, with a default derived from /etc/fstab or, for ZFS only, currdev (the boot filesystem). OTOH, https://wiki.freebsd.org/BootEnvironments states "/etc/fstab must be purged of any / mount, and /boot/loader.conf must not be setting vfs.root.mountfrom directly." I can't find any other reference to this requirement. As for the BootEnvironment management tools themselves: * Neither beadm(8) nor bectl(8) mention vfs.root.mountfrom. * beadm(8) refers to https://forums.freebsd.org/showthread.php?t=3D31662, which recommends setting vfs.root.mountfrom * beadm(8) will update vfs.root.mountfrom in /boot/loader.conf if it exists but will not add it if it doesn't exist. * bectl(8) ignores /boot/loader.conf The last point means that switching an existing system from beadm to bectl is very likely to result in the system mounting the wrong root filesystem: An existing system is likely to have vfs.root.mountfrom set, since that used to be the only approach and is still widely recommended, whilst bectl ignores it and will therefore leave the old vfs.root.mountfrom value present. IMO, if setting vfs.root.mountfrom in /boot/loader.conf is no longer supported for ZFS, we need to do a better job of documenting that and removing documentation to the contrary. I also believe that bectl should at least warn if /boot/loader.conf sets vfs.root.mountfrom. --=20 Peter Jeremy --SMVHMpE6bcvqhvH5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmMJlwBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRarw//TJYrKPMr8oRzjBQs0f7ywE55qjT27lwVAQeFRUA573dxF1UvULezfS7I 7xR7OvLfK6R3PQWjFSzvlpTX/sShCuq/cY/ic3Clh6u3dneamLOVs2WoUQQtxWqS Ic5qN0GFpT+esAujv83FsohG7OutfCKOqUf82jgQJIf2sRIW7j4hJCirgie2DeO3 AqNKKcY3for7NCp5Vl0rP4Kd8Y/5yDl0SZCDC/U4wg+x6A8LcycJrhGG9T2Bhh4x H8KXPqJ8d7n/Cjj9dJ2kJeCFsMGqGGKglohS92nA7H7GUUgR0ai+lsXSujtMOJnU K/GB+/LyQSh6uPJ52hwLvoRyHKTl3s2BBY42NX2XOSjhb3Ih/bL8RbrDXfjT8DRu Id8QQ0wZT8r8r/Ykln1zhsxzP/hRoyWZDZHme4IjQMn6HqIFN9/iQZZDA3pKKCAB r5YXwP5gE1hI14U5kluxyZHueEFFWQc2zY3GPzb0+4Fb+GpxCwqWEYVb6mjf0aNu UFT0nQ4UFw3jnux3rHHPK3nqZNV+MzvD1RN/2ZRHc/EvfW8KwqhDlp4YrgpiASLl Kjuw6mH7bteuZgkahXNTBOjOcVy9vPfahYgT4f/fTBjuwcV5H+AGm0I1y1W+a/Ui W8gXe0vivmU9s6SPiTDrBh6AcePHzPx1uEll2ewoT9VkQEHsHEA= =0pI/ -----END PGP SIGNATURE----- --SMVHMpE6bcvqhvH5--