Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2022 12:04:32 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Peter Jeremy <peterj@freebsd.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>, John Kennedy <warlock@phouka.net>
Subject:   Re: boot environment and /var/db/etcupdate ?
Message-ID:  <284888814.115.1661335472728@localhost>
In-Reply-To: <YwXlUoDPuWZLDHw%2B@server.rulingia.com>
References:  <389080342.286.1661263368708@localhost> <YwVaRSq6KnvPNXH6@phouka1.phouka.net> <YwXlUoDPuWZLDHw%2B@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_114_202692365.1661335472722
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

 
Van: Peter Jeremy <peterj@freebsd.org>
Datum: woensdag, 24 augustus 2022 10:46
Aan: John Kennedy <warlock@phouka.net>
CC: Ronald Klop <ronald-lists@klop.ws>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Onderwerp: Re: boot environment and /var/db/etcupdate ?
> 
> On 2022-Aug-23 15:52:53 -0700, John Kennedy <warlock@phouka.net> wrote:
> >On Tue, Aug 23, 2022 at 04:02:48PM +0200, Ronald Klop wrote:
> >> Hi,
> >>
> >> I'm running the super duper boot environment using ZFS. [1]
> >>
> >> I have /var and /usr/local as separate datasets. These do not change when I upgrade the OS and that keeps the backups a lot smaller as the backup sees a new BE as a new dataset and fully zfs sends all the data again.
> >>
> >> But when I rollback /var/db/etcupdate is not in sync with / anymore.
> >> And /var/db/ports and /var/db/pkg should be kept in sync with /usr/local. But I do not need to rollback these if I need to go back to the previous BE.
> 
> Looking in /var, the only thing I can see that needs to track the BE
> is /var/db/etcupdate - everything else should preferentially be
> outside the BE (and having things like e.g. /var/mail in the BE will
> cause problems if you rollback the BE).
> 
> /usr/local and /var/db/pkg need to track to prevent package installation
> metadata getting out of step with the actual installed packages.
> 
> >  For my part, /var/db/pkg is mostly just a reference to my local
> >poudriere package stash and is relevant to the BE (but pretty stagnant
> >unless I'm changing major versions between 12/13/14).  On my system,
> >/var/db is part of /.
> 
> Several database ports default to putting their data under /var/db so
> having that in a BE is likely to cause problems if you rollback.
> 
> >  I'd be a little leery of having /usr/local decoupled from the BE,
> >but that's mostly worried about things like kernel drivers that would
> >get out of sync with the kernel in the BE.
> 
> Kernel driver ports should all be in /boot/modules, not /usr/local (this
> does mean that rolling back a BE will cause problems with the metadata
> associated with those ports, but typically there are relatively few
> such ports).  I don't believe there are any other ports that are
> tightly bound to the actual running kernel (though sysutils/lsof comes
> close).
> 
> A downside of putting /usr/local in the BE is that another large
> collection of ports default to storing their data under /usr/local
> and that should be decoupled from BEs.
> 
> Overall, I don't believe there's a one-size-fits-all solution to
> identifying what should be part of the BE.  If you are using BEs
> to switch between major versions, it probably does make sense to
> include /usr/local in the BE - but then you need to extricate all
> the application data that needs to not be rolled back.
> 
> -- 
> Peter Jeremy
> 
> 
> 
>  


Hi,

I agree. I think the structure of /var is a bit inconsistent with the recommendation from the BootEnvirtonments wiki page [1] and bsdinstall [2].
AFAIS /var/db/pkg and /var/db/ports could better be in something like /usr/local/var/db. /var/db/portsnap has similar issues to stay in sync with /usr/ports.

And when I do a major upgrade of pkgs I find it ok to make a separate snapshot of /usr/local. I use BEs primarily to have predictable OS upgrades.

You are right the one size fits all is a hard one. And the current structure of /var makes it hard to customize also. ;-)

Regards,
Ronald.

[1] https://wiki.freebsd.org/BootEnvironments
[2] https://www.freebsd.org/cgi/man.cgi?bsdinstall(8)
------=_Part_114_202692365.1661335472722
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body>&nbsp;
<p><strong>Van:</strong> Peter Jeremy &lt;peterj@freebsd.org&gt;<br />
<strong>Datum:</strong> woensdag, 24 augustus 2022 10:46<br />
<strong>Aan:</strong> John Kennedy &lt;warlock@phouka.net&gt;<br />
<strong>CC:</strong> Ronald Klop &lt;ronald-lists@klop.ws&gt;, FreeBSD-STABLE Mailing List &lt;freebsd-stable@freebsd.org&gt;<br />
<strong>Onderwerp:</strong> Re: boot environment and /var/db/etcupdate ?</p>

<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px">
<div class="MessageRFC822Viewer" id="P">
<div class="MultipartMixedViewer">
<div class="TextPlainViewer" id="P.P.P1">On 2022-Aug-23 15:52:53 -0700, John Kennedy &lt;warlock@phouka.net&gt; wrote:<br />
&gt;On Tue, Aug 23, 2022 at 04:02:48PM +0200, Ronald Klop wrote:<br />
&gt;&gt; Hi,<br />
&gt;&gt;<br />
&gt;&gt; I'm running the super duper boot environment using ZFS. [1]<br />
&gt;&gt;<br />
&gt;&gt; I have /var and /usr/local as separate datasets. These do not change when I upgrade the OS and that keeps the backups a lot smaller as the backup sees a new BE as a new dataset and fully zfs sends all the data again.<br />
&gt;&gt;<br />
&gt;&gt; But when I rollback /var/db/etcupdate is not in sync with / anymore.<br />
&gt;&gt; And /var/db/ports and /var/db/pkg should be kept in sync with /usr/local. But I do not need to rollback these if I need to go back to the previous BE.<br />
<br />
Looking in /var, the only thing I can see that needs to track the BE<br />
is /var/db/etcupdate - everything else should preferentially be<br />
outside the BE (and having things like e.g. /var/mail in the BE will<br />
cause problems if you rollback the BE).<br />
<br />
/usr/local and /var/db/pkg need to track to prevent package installation<br />
metadata getting out of step with the actual installed packages.<br />
<br />
&gt; &nbsp;For my part, /var/db/pkg is mostly just a reference to my local<br />
&gt;poudriere package stash and is relevant to the BE (but pretty stagnant<br />
&gt;unless I'm changing major versions between 12/13/14). &nbsp;On my system,<br />
&gt;/var/db is part of /.<br />
<br />
Several database ports default to putting their data under /var/db so<br />
having that in a BE is likely to cause problems if you rollback.<br />
<br />
&gt; &nbsp;I'd be a little leery of having /usr/local decoupled from the BE,<br />
&gt;but that's mostly worried about things like kernel drivers that would<br />
&gt;get out of sync with the kernel in the BE.<br />
<br />
Kernel driver ports should all be in /boot/modules, not /usr/local (this<br />
does mean that rolling back a BE will cause problems with the metadata<br />
associated with those ports, but typically there are relatively few<br />
such ports). &nbsp;I don't believe there are any other ports that are<br />
tightly bound to the actual running kernel (though sysutils/lsof comes<br />
close).<br />
<br />
A downside of putting /usr/local in the BE is that another large<br />
collection of ports default to storing their data under /usr/local<br />
and that should be decoupled from BEs.<br />
<br />
Overall, I don't believe there's a one-size-fits-all solution to<br />
identifying what should be part of the BE. &nbsp;If you are using BEs<br />
to switch between major versions, it probably does make sense to<br />
include /usr/local in the BE - but then you need to extricate all<br />
the application data that needs to not be rolled back.<br />
<br />
--&nbsp;<br />
Peter Jeremy</div>

<hr />
<div class="DefaultViewer">&nbsp;</div>
</div>
</div>
</blockquote>
<br />
<br />
Hi,<br />
<br />
I agree. I think the structure of /var is a bit inconsistent with the recommendation from the BootEnvirtonments wiki page [1] and bsdinstall [2].<br />
AFAIS /var/db/pkg and /var/db/ports could better be in something like /usr/local/var/db. /var/db/portsnap has similar issues to stay in sync with /usr/ports.<br />
<br />
And when I do a major upgrade of pkgs I find it ok to make a separate snapshot of /usr/local. I use BEs primarily to have predictable OS upgrades.<br />
<br />
You are right the one size fits all is a hard one. And the current structure of /var makes it hard to customize also. ;-)<br />
<br />
Regards,<br />
Ronald.<br />
<br />
[1] https://wiki.freebsd.org/BootEnvironments<br />
[2] https://www.freebsd.org/cgi/man.cgi?bsdinstall(8)</body></html>;
------=_Part_114_202692365.1661335472722--



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