Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jul 2024 22:58:58 -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:  <CANCZdfrnZTuZ7UdkA4mtGZtmJNY6BeH5yyqqa1u_OOkmyr8hzQ@mail.gmail.com>
In-Reply-To: <9CCA0BFB-70D3-4E21-8BA7-3E9F35110E8D@FreeBSD.org>
References:  <Zpl_ApIOpRkUNpnq@lordcow.org> <01D917DB-7E47-46D7-AD22-AD09C4F89A96@FreeBSD.org> <CANCZdfoy4pXW1USst7=G6fx1-pGiAxFV1ORNCA7zDuEUQqARyg@mail.gmail.com> <9CCA0BFB-70D3-4E21-8BA7-3E9F35110E8D@FreeBSD.org>

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

On Thu, Jul 18, 2024 at 10:49=E2=80=AFPM Zhenlei Huang <zlei@freebsd.org> w=
rote:

>
>
> On Jul 19, 2024, at 10:19 AM, Warner Losh <imp@bsdimp.com> wrote:
>
>
>
> On Thu, Jul 18, 2024, 7:10=E2=80=AFPM Zhenlei Huang <zlei@freebsd.org> wr=
ote:
>
>>
>>
>> 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
>> 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,
>> 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 d=
o
> boot once and nextboot stuff.
>
>
> Yes and NO.
>
> Yes for 13.x, 14.x and CURRENT. nextboot(8) will consults zfsbootcfg(8) t=
o
> do the nextboot stuff if file system
> is ZFS.
>
> No for 12.x.  neither nextboot(8) nor nextboot.sh will do that. And it
> seems that loader(8) also do not get / set
> ZFS properties to enable / disable nextboot stuff.
>

I missed that detail and understand your comments about running a supported
release. It does indeed not work on 12.

Warner

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

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

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 18, 2024 at 10:49=E2=80=
=AFPM Zhenlei Huang &lt;<a href=3D"mailto:zlei@freebsd.org">zlei@freebsd.or=
g</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
><div style=3D"overflow-wrap: break-word;"><br><div><br><blockquote type=3D=
"cite"><div>On Jul 19, 2024, at 10:19 AM, Warner Losh &lt;<a href=3D"mailto=
:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>&gt; wrote:</div><br><=
div><div dir=3D"auto" style=3D"font-family:Helvetica;font-size:13px;font-st=
yle:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;t=
ext-align:start;text-indent:0px;text-transform:none;white-space:normal;word=
-spacing:0px;text-decoration:none"><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 &lt;<a href=3D"mailto:zlei@freebsd.org" target=3D"_blank">zl=
ei@freebsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><div style=3D"overflow-wrap: break-word;"><br><div><br><block=
quote type=3D"cite"><div>On Jul 19, 2024, at 4:45 AM, Gareth de Vaux &lt;<a=
 href=3D"mailto:stable@lordcow.org" rel=3D"noreferrer" target=3D"_blank">st=
able@lordcow.org</a>&gt; wrote:</div><br><div><div>Hi all, nextboot warns a=
s 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 boo=
t 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>Doe=
s 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 d=
oes not work incase boot failure.</div><div><br></div><div>The implementati=
on 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 desir=
ed kernel on next boot. Well it is a oneshot boot</div><div>so the loader w=
ill try to disable these=C2=A0<span>parameters by writing `</span><font><sp=
an>nextboot_enable=3DNO` to =C2=A0</span></font><span>/boot/nexboot.conf.</=
span></div><div><span><br></span></div><div><span>That is the magic. Appare=
ntly if loader(8) does not support write to filesystem, in this case the ZF=
S,=C2=A0</span></div><div><span>it will fail to write=C2=A0</span><span>/bo=
ot/nexboot.conf in case kernel boot failure. Thus subsequent boot the loade=
r(8) would</span></div><div><span>still try to boot from the oneshot `testk=
ernel`.</span></div></div></div></blockquote></div></div><div dir=3D"auto">=
<br></div><div dir=3D"auto">However, ZFS has special support via properties=
 in the BE that lets you do boot once and nextboot stuff.</div></div></div>=
</blockquote><div><br></div><div>Yes and NO.</div><div><br></div><div>Yes f=
or 13.x, 14.x and CURRENT.=C2=A0<span style=3D"color:rgb(0,0,0)">nextboot(8=
) will=C2=A0</span><span style=3D"color:rgb(0,0,0)">consults zfsbootcfg(8)<=
/span><span style=3D"color:rgb(0,0,0)">=C2=A0to do the nextboot stuff if fi=
le system</span></div><div><span style=3D"color:rgb(0,0,0)">is ZFS.</span><=
/div><div><br></div><div>No for 12.x. =C2=A0neither nextboot(8) nor nextboo=
t.sh will do that. And it seems that loader(8) also do not get / set</div><=
div>ZFS properties to enable / disable nextboot stuff.</div></div></div></b=
lockquote><div><br></div><div>I missed that detail and understand your comm=
ents about running a supported release. It does indeed not work on 12.<br><=
/div><div><br></div><div>Warner <br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex"><div style=3D"overflow-wrap: break-word;"><div><blockquote=
 type=3D"cite"><div><div dir=3D"auto" style=3D"font-family:Helvetica;font-s=
ize:13px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-=
spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-s=
pace:normal;word-spacing:0px;text-decoration:none"><div dir=3D"auto">But ev=
en better are boot environments. That&#39;s a more comple solution that sup=
ports bootnext features and more. See bectl...</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></div><div d=
ir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><div style=3D"overflow-wrap: break-word;"><div><blockquote ty=
pe=3D"cite"><div><div>I see a blog mentioning that nextboot will write meta=
data 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 implem=
entation specific. Normally you can ignore the warning, unless you have tro=
uble 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 =
revert 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>Best regards,</div><div>Zhenlei</div></div></div></div></blo=
ckquote></div></div></div></div></blockquote></div><br><div>
<div><br></div>

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

--000000000000537e8f061d928e19--



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