Date: Fri, 19 Jul 2024 09:10:05 +0800 From: Zhenlei Huang <zlei@FreeBSD.org> To: Gareth de Vaux <stable@lordcow.org> Cc: freebsd-stable@freebsd.org Subject: Re: nextboot warns it won't reset Message-ID: <01D917DB-7E47-46D7-AD22-AD09C4F89A96@FreeBSD.org> In-Reply-To: <Zpl_ApIOpRkUNpnq@lordcow.org> References: <Zpl_ApIOpRkUNpnq@lordcow.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_071E00C1-5AEE-4D1D-80DC-867748BDB8A2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 19, 2024, at 4:45 AM, Gareth de Vaux <stable@lordcow.org> = wrote: >=20 > Hi all, nextboot warns as follows: >=20 > # nextboot -k testkernel > WARNING: loader(8) has only R/O support for ZFS > nextboot.conf will NOT be reset in case of kernel boot failure >=20 >=20 > This's on a ZFS zroot 12.4-STABLE system. You're encouraged to upgrade to supported releases ;) >=20 > Does this mean that nextboot will not do its job? I think the WARNING is a good hint and explain why it does not work = incase boot failure. The implementation of load desired kernel is write loader parameters to = /boot/nexboot.conf , to indicate the loader(8) do its job, that is loading the desired kernel on next = boot. Well it is a oneshot boot so the loader will try to disable these parameters by writing = `nextboot_enable=3DNO` to /boot/nexboot.conf. That is the magic. Apparently if loader(8) does not support write to = filesystem, in this case the ZFS,=20 it will fail to write /boot/nexboot.conf in case kernel boot failure. = Thus subsequent boot the loader(8) would still try to boot from the oneshot `testkernel`. >=20 > I see a blog mentioning that nextboot will write metadata to the ZFS = pool label, > in which case maybe the warning is no longer applicable? That is implementation specific. Normally you can ignore the warning, = unless you have trouble booting the kernel. >=20 >=20 > Also I suspect I should rather run "nextboot -D" to revert the = situation. > Is this equivalent to removing /boot/nextboot.conf and/or this = metadata in the > ZFS pool label? I think normally you do not need that. Best regards, Zhenlei --Apple-Mail=_071E00C1-5AEE-4D1D-80DC-867748BDB8A2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On Jul 19, 2024, at 4:45 AM, Gareth de Vaux <<a = href=3D"mailto:stable@lordcow.org" class=3D"">stable@lordcow.org</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"">Hi all, nextboot warns as follows:<br class=3D""><br = class=3D""># nextboot -k testkernel<br class=3D"">WARNING: loader(8) has = only R/O support for ZFS<br class=3D"">nextboot.conf will NOT be reset = in case of kernel boot failure<br class=3D""><br class=3D""><br = class=3D"">This's on a ZFS zroot 12.4-STABLE system.<br = class=3D""></div></div></blockquote><div><br class=3D""></div><div>You're = encouraged to upgrade to supported releases ;)</div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = class=3D""><br class=3D"">Does this mean that nextboot will not do its = job?<br class=3D""></div></div></blockquote><div><br = class=3D""></div><div>I think the WARNING is a good hint and explain why = it does not work incase boot failure.</div><div><br = class=3D""></div><div>The implementation of load desired kernel is write = loader parameters to /boot/nexboot.conf , to indicate</div><div>the = loader(8) do its job, that is loading the desired kernel on next boot. = Well it is a oneshot boot</div><div>so the loader will try to disable = these <span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, = 0);" class=3D"">parameters by writing `</span><font color=3D"#000000" = class=3D""><span style=3D"caret-color: rgb(0, 0, 0);" = class=3D"">nextboot_enable=3DNO` to </span></font><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" = class=3D"">/boot/nexboot.conf.</span></div><div><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D""><br = class=3D""></span></div><div><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0);" class=3D"">That is the magic. Apparently if = loader(8) does not support write to filesystem, in this case the = ZFS, </span></div><div><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0);" class=3D"">it will fail to write </span><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" = class=3D"">/boot/nexboot.conf in case kernel boot failure. Thus = subsequent boot the loader(8) would</span></div><div><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">still= try to boot from the oneshot `testkernel`.</span></div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = class=3D""><br class=3D"">I see a blog mentioning that nextboot will = write metadata to the ZFS pool label,<br class=3D"">in which case maybe = the warning is no longer applicable?<br = class=3D""></div></div></blockquote><div><br class=3D""></div><div>That = is implementation specific. Normally you can ignore the warning, unless = you have trouble booting</div><div>the kernel.</div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = class=3D""><br class=3D""><br class=3D"">Also I suspect I should rather = run "nextboot -D" to revert the situation.<br class=3D"">Is this = equivalent to removing /boot/nextboot.conf and/or this metadata in = the<br class=3D"">ZFS pool label?<br = class=3D""></div></div></blockquote><div><br class=3D""></div><div>I = think normally you do not need that.</div><div><br = class=3D""></div><div><div style=3D"caret-color: rgb(0, 0, 0); color: = rgb(0, 0, 0);">Best regards,</div><div style=3D"caret-color: rgb(0, 0, = 0); color: rgb(0, 0, 0);">Zhenlei</div></div></div><div = class=3D""><div><br class=3D""></div> </div> <br class=3D""></body></html>= --Apple-Mail=_071E00C1-5AEE-4D1D-80DC-867748BDB8A2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01D917DB-7E47-46D7-AD22-AD09C4F89A96>