Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jul 2024 20:19:12 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Zhenlei Huang <zlei@freebsd.org>
Cc:        Gareth de Vaux <stable@lordcow.org>,  FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: nextboot warns it won't reset
Message-ID:  <CANCZdfoy4pXW1USst7=G6fx1-pGiAxFV1ORNCA7zDuEUQqARyg@mail.gmail.com>
In-Reply-To: <01D917DB-7E47-46D7-AD22-AD09C4F89A96@FreeBSD.org>
References:  <Zpl_ApIOpRkUNpnq@lordcow.org> <01D917DB-7E47-46D7-AD22-AD09C4F89A96@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000f06acc061d905292
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 18, 2024, 7:10=E2=80=AFPM Zhenlei Huang <zlei@freebsd.org> wrot=
e:

>
>
> On Jul 19, 2024, at 4:45 AM, Gareth de Vaux <stable@lordcow.org> wrote:
>
> Hi all, nextboot warns as follows:
>
> # 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
>
>
> This's on a ZFS zroot 12.4-STABLE system.
>
>
> You're encouraged to upgrade to supported releases ;)
>
>
> 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 incas=
e
> 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_e=
nable=3DNO`
> to  /boot/nexboot.conf.
>
> That is the magic. Apparently if loader(8) does not support write to
> filesystem, in this case the ZFS,
> 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`.
>

However, ZFS has special support via properties in the BE that lets you do
boot once and nextboot stuff.

But even better are boot environments. That's a more comple solution that
supports bootnext features and more. See bectl...

Warner

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.
>
>
>
> 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 i=
n
> the
> ZFS pool label?
>
>
> I think normally you do not need that.
>
> Best regards,
> Zhenlei
>
>
>

--000000000000f06acc061d905292
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Thu, Jul 18, 2024, 7:10=E2=80=AFPM Zhenlei Huang &l=
t;<a href=3D"mailto:zlei@freebsd.org">zlei@freebsd.org</a>&gt; wrote:<br></=
div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word;line-=
break:after-white-space"><br><div><br><blockquote type=3D"cite"><div>On Jul=
 19, 2024, at 4:45 AM, Gareth de Vaux &lt;<a href=3D"mailto:stable@lordcow.=
org" target=3D"_blank" rel=3D"noreferrer">stable@lordcow.org</a>&gt; wrote:=
</div><br><div><div>Hi all, nextboot warns as follows:<br><br># nextboot -k=
 testkernel<br>WARNING: loader(8) has only R/O support for ZFS<br>nextboot.=
conf will NOT be reset in case of kernel boot failure<br><br><br>This&#39;s=
 on a ZFS zroot 12.4-STABLE system.<br></div></div></blockquote><div><br></=
div><div>You&#39;re encouraged to upgrade to supported releases ;)</div><br=
><blockquote type=3D"cite"><div><div><br>Does this mean that nextboot will =
not do its job?<br></div></div></blockquote><div><br></div><div>I think the=
 WARNING is a good hint and explain why it does not work incase boot failur=
e.</div><div><br></div><div>The implementation of load desired kernel is wr=
ite loader parameters to /boot/nexboot.conf , to indicate</div><div>the loa=
der(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=C2=A0<=
span style=3D"color:rgb(0,0,0)">parameters by writing `</span><font color=
=3D"#000000"><span>nextboot_enable=3DNO` to =C2=A0</span></font><span style=
=3D"color:rgb(0,0,0)">/boot/nexboot.conf.</span></div><div><span style=3D"c=
olor:rgb(0,0,0)"><br></span></div><div><span style=3D"color:rgb(0,0,0)">Tha=
t is the magic. Apparently if loader(8) does not support write to filesyste=
m, in this case the ZFS,=C2=A0</span></div><div><span style=3D"color:rgb(0,=
0,0)">it will fail to write=C2=A0</span><span style=3D"color:rgb(0,0,0)">/b=
oot/nexboot.conf in case kernel boot failure. Thus subsequent boot the load=
er(8) would</span></div><div><span style=3D"color:rgb(0,0,0)">still try to =
boot from the oneshot `testkernel`.</span></div></div></div></blockquote></=
div></div><div dir=3D"auto"><br></div><div dir=3D"auto">However, ZFS has sp=
ecial support via properties in the BE that lets you do boot once and nextb=
oot stuff.</div><div dir=3D"auto"><br></div><div dir=3D"auto">But even bett=
er are boot environments. That&#39;s a more comple solution that supports b=
ootnext features and more. See bectl...</div><div dir=3D"auto"><br></div><d=
iv dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"a=
uto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=
=3D"word-wrap:break-word;line-break:after-white-space"><div><blockquote typ=
e=3D"cite"><div><div>I see a blog mentioning that nextboot will write metad=
ata to the ZFS pool label,<br>in which case maybe the warning is no longer =
applicable?<br></div></div></blockquote><div><br></div><div>That is impleme=
ntation specific. Normally you can ignore the warning, unless you have trou=
ble booting</div><div>the kernel.</div><br><blockquote type=3D"cite"><div><=
div><br><br>Also I suspect I should rather run &quot;nextboot -D&quot; to r=
evert the situation.<br>Is this equivalent to removing /boot/nextboot.conf =
and/or this metadata in the<br>ZFS pool label?<br></div></div></blockquote>=
<div><br></div><div>I think normally you do not need that.</div><div><br></=
div><div><div style=3D"color:rgb(0,0,0)">Best regards,</div><div style=3D"c=
olor:rgb(0,0,0)">Zhenlei</div></div></div><div><div><br></div>

</div>
<br></div></blockquote></div></div></div>

--000000000000f06acc061d905292--



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