Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Nov 2022 14:23:11 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        Li-Wen Hsu <lwhsu@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 72a1cb05cd23 - main - rc(8): Add a zpoolupgrade rc.d script
Message-ID:  <CANCZdfrdc%2BDbv6sDyDLcWNpXnWScEmpUsGu3q8%2BMbZRjDS8eig@mail.gmail.com>
In-Reply-To: <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net>
References:  <202211070339.2A73dJlO027991@gitrepo.freebsd.org> <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000818e1905ece808da
Content-Type: text/plain; charset="UTF-8"

On Mon, Nov 7, 2022 at 4:15 AM Alexander Leidinger <Alexander@leidinger.net>
wrote:

>
> Quoting Li-Wen Hsu <lwhsu@freebsd.org> (from Mon, 7 Nov 2022 03:39:19
> GMT):
>
> > The branch main has been updated by lwhsu:
> >
> > URL:
> >
> https://cgit.FreeBSD.org/src/commit/?id=72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
> >
> > commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
> > Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
> > AuthorDate: 2022-11-07 03:30:09 +0000
> > Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
> > CommitDate: 2022-11-07 03:30:09 +0000
> >
> >     rc(8): Add a zpoolupgrade rc.d script
> >
> >     If a zpool is created by makefs(8), its version is 5000, i.e., all
> >     feature flags are off.  Introduce an rc script to run `zpool upgrade`
> >     over the assigned zpools on the first boot.  This is useful to the
> >     ZFS based VM images built from release(7).
>
> > diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
> > index f9ceabc83120..43fa44a5f1cb 100644
> > --- a/share/man/man5/rc.conf.5
> > +++ b/share/man/man5/rc.conf.5
> > @@ -24,7 +24,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd August 28, 2022
> > +.Dd November 7, 2022
> >  .Dt RC.CONF 5
> >  .Os
> >  .Sh NAME
> > @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for
> > which new pool GUIDs should be
> >  assigned upon first boot.
> >  This is useful when using a ZFS pool copied from a template, such
> > as a virtual
> >  machine image.
> > +.It Va zpool_upgrade
> > +.Pq Vt str
> > +A space-separated list of ZFS pool names for which version should
> > be upgraded
> > +upon first boot.
> > +This is useful when using a ZFS pool generated by
> > +.Xr makefs 8
> > +utility.
>
> For someone who knows ZFS well, it is clear that only a zpool upgrade
> is done. Not so experienced people may assume there is a combination
> of zpool upgrade and zfs upgrade (more so for people which do not know
> what the difference is). Maybe you want to add some explicit
> documentation, that zfs upgrade + feature flags needs to be done by
> hand.
>
> And this brings me to a second topic, we don't have an explicit list
> of features which are supported by the bootloader (I had a look at the
> zfs and the boot related man pages, if I overlooked a place, then the
> other places should reference this important part with some text).
>

There is a fixed list of features we support in the boot loader:

/*
 * List of ZFS features supported for read
 */
static const char *features_for_read[] = {
        "org.illumos:lz4_compress",
        "com.delphix:hole_birth",
        "com.delphix:extensible_dataset",
        "com.delphix:embedded_data",
        "org.open-zfs:large_blocks",
        "org.illumos:sha512",
        "org.illumos:skein",
        "org.zfsonlinux:large_dnode",
        "com.joyent:multi_vdev_crash_dump",
        "com.delphix:spacemap_histogram",
        "com.delphix:zpool_checkpoint",
        "com.delphix:spacemap_v2",
        "com.datto:encryption",
        "com.datto:bookmark_v2",
        "org.zfsonlinux:allocation_classes",
        "com.datto:resilver_defer",
        "com.delphix:device_removal",
        "com.delphix:obsolete_counts",
        "com.intel:allocation_classes",
        "org.freebsd:zstd_compress",
        "com.delphix:bookmark_written",
        "com.delphix:head_errlog",
        "org.openzfs:blake3",
        NULL
};

Any feature not on this list will cause the boot loader to reject the pool.

Whether or not it should do that by default, always, or never is an open
question. I've thought there should be a 'shoot footing' override that isn't
there today.

Warner

--000000000000818e1905ece808da
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 Mon, Nov 7, 2022 at 4:15 AM Alexan=
der Leidinger &lt;<a href=3D"mailto:Alexander@leidinger.net">Alexander@leid=
inger.net</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"><br>
Quoting Li-Wen Hsu &lt;<a href=3D"mailto:lwhsu@freebsd.org" target=3D"_blan=
k">lwhsu@freebsd.org</a>&gt; (from Mon, 7 Nov 2022 03:39:19 GMT):<br>
<br>
&gt; The branch main has been updated by lwhsu:<br>
&gt;<br>
&gt; URL:=C2=A0 <br>
&gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d=
12a7180ae65ddbba2e0cb6d" rel=3D"noreferrer" target=3D"_blank">https://cgit.=
FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d</a><b=
r>
&gt;<br>
&gt; commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu &lt;lwhsu@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2022-11-07 03:30:09 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu &lt;lwhsu@FreeBSD.org&gt;<br>
&gt; CommitDate: 2022-11-07 03:30:09 +0000<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0rc(8): Add a zpoolupgrade rc.d script<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0If a zpool is created by makefs(8), its version is =
5000, i.e., all<br>
&gt;=C2=A0 =C2=A0 =C2=A0feature flags are off.=C2=A0 Introduce an rc script=
 to run `zpool upgrade`<br>
&gt;=C2=A0 =C2=A0 =C2=A0over the assigned zpools on the first boot.=C2=A0 T=
his is useful to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0ZFS based VM images built from release(7).<br>
<br>
&gt; diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5<br>
&gt; index f9ceabc83120..43fa44a5f1cb 100644<br>
&gt; --- a/share/man/man5/rc.conf.5<br>
&gt; +++ b/share/man/man5/rc.conf.5<br>
&gt; @@ -24,7 +24,7 @@<br>
&gt;=C2=A0 .\&quot;<br>
&gt;=C2=A0 .\&quot; $FreeBSD$<br>
&gt;=C2=A0 .\&quot;<br>
&gt; -.Dd August 28, 2022<br>
&gt; +.Dd November 7, 2022<br>
&gt;=C2=A0 .Dt RC.CONF 5<br>
&gt;=C2=A0 .Os<br>
&gt;=C2=A0 .Sh NAME<br>
&gt; @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for=C2=
=A0 <br>
&gt; which new pool GUIDs should be<br>
&gt;=C2=A0 assigned upon first boot.<br>
&gt;=C2=A0 This is useful when using a ZFS pool copied from a template, suc=
h=C2=A0 <br>
&gt; as a virtual<br>
&gt;=C2=A0 machine image.<br>
&gt; +.It Va zpool_upgrade<br>
&gt; +.Pq Vt str<br>
&gt; +A space-separated list of ZFS pool names for which version should=C2=
=A0 <br>
&gt; be upgraded<br>
&gt; +upon first boot.<br>
&gt; +This is useful when using a ZFS pool generated by<br>
&gt; +.Xr makefs 8<br>
&gt; +utility.<br>
<br>
For someone who knows ZFS well, it is clear that only a zpool upgrade=C2=A0=
 <br>
is done. Not so experienced people may assume there is a combination=C2=A0 =
<br>
of zpool upgrade and zfs upgrade (more so for people which do not know=C2=
=A0 <br>
what the difference is). Maybe you want to add some explicit=C2=A0 <br>
documentation, that zfs upgrade + feature flags needs to be done by=C2=A0 <=
br>
hand.<br>
<br>
And this brings me to a second topic, we don&#39;t have an explicit list=C2=
=A0 <br>
of features which are supported by the bootloader (I had a look at the=C2=
=A0 <br>
zfs and the boot related man pages, if I overlooked a place, then the=C2=A0=
 <br>
other places should reference this important part with some text).<br></blo=
ckquote><div><br></div><div>There is a fixed list of features we support in=
 the boot loader:</div><div><br></div><div>/*<br>=C2=A0* List of ZFS featur=
es supported for read<br>=C2=A0*/<br>static const char *features_for_read[]=
 =3D {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:lz4_compress&quot;,=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:hole_birth&quot;,<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:extensible_dataset&quot;,<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:embedded_data&quot;,<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 &quot;org.open-zfs:large_blocks&quot;,<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 &quot;org.illumos:sha512&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;org.illumos:skein&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=
org.zfsonlinux:large_dnode&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.=
joyent:multi_vdev_crash_dump&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;co=
m.delphix:spacemap_histogram&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;co=
m.delphix:zpool_checkpoint&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.=
delphix:spacemap_v2&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:e=
ncryption&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:bookmark_v2=
&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:allocation_clas=
ses&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:resilver_defer&qu=
ot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:device_removal&quot;,=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:obsolete_counts&quot;,<br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.intel:allocation_classes&quot;,<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.freebsd:zstd_compress&quot;,<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmark_written&quot;,<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:head_errlog&quot;,<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 &quot;org.openzfs:blake3&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 NULL<br>};<br></div><div><br></div><div>Any feature not on this list=
 will cause the boot loader to reject the pool.</div><div><br></div><div>Wh=
ether or not it should do that by default, always, or never is an open</div=
><div>question. I&#39;ve thought there should be a &#39;shoot footing&#39; =
override that isn&#39;t</div><div>there today.</div><div><br></div><div>War=
ner=C2=A0</div></div></div>

--000000000000818e1905ece808da--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrdc%2BDbv6sDyDLcWNpXnWScEmpUsGu3q8%2BMbZRjDS8eig>