Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2022 01:24:54 +0100
From:      Nuno Teixeira <eduardo@freebsd.org>
To:        Paul Mather <paul@gromit.dlib.vt.edu>
Cc:        Alan Somers <asomers@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Good practices with bectl
Message-ID:  <CAFDf7U%2Bv8QkkgbcYdw7A3WiKN6zuzqwNN4SFh%2BDmyg-OJbWj3A@mail.gmail.com>
In-Reply-To: <780F7E98-661B-49B5-BF0C-1E5A7EB7F1EE@gromit.dlib.vt.edu>
References:  <CAFDf7UL42z-m9P-gp6eY-orwcPz_UdJpiAM3ab-z4XLbY0LOdg@mail.gmail.com> <CAOtMX2gdoh2XxF0ofohyBA3DY-tgB5wAWb6%2BQmMb5tZRjieEvw@mail.gmail.com> <780F7E98-661B-49B5-BF0C-1E5A7EB7F1EE@gromit.dlib.vt.edu>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi Paul,

Really nice! I will test it soon.

Cheers

Paul Mather <paul@gromit.dlib.vt.edu> escreveu no dia quarta, 21/09/2022
à(s) 00:17:

> On Sep 20, 2022, at 6:19 PM, Alan Somers <asomers@freebsd.org> wrote:
>
> > On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira <eduardo@freebsd.org>
> wrote:
> >>
> >> Hello to all,
> >>
> >> I will use becl for the first time for current upgrades.
> >> Just to check that I'm thinking correctly:
> >>
> >> Create a test environment for upgrade:
> >>> bectl create -r test (should I use '-r'?)
> >> Activate test:
> >>> bectl activate test
> >>> reboot
> >> ...
> >>> upgrade OS on test
> >>> reboot
> >> ...
> >> if a problem happens, reboot default from BE loader
> >> ---
> >> if everything fine destroy default and rename test to default
> >>> bectl destroy -o default
> >>> bectl rename test default
> >> repeat on next upgrade
> >>
> >> Don't know if a faster way exists with chroot or bectl jail...
> >>
> >> Any hints appreciated.
> >>
> >> Thanks,
> >> --
> >> Nuno Teixeira
> >> FreeBSD Committer (ports)
> >
> > I don't think you need to use "-r".  Also, you're forgetting one of
> > the best things about boot environments: you can upgrade them even
> > when not booted into them.  That's faster than upgrading the running
> > BE.  Here is the procedure I use:
> >
> > RELEASE=Whatever
> > sudo bectl create ${RELEASE}
> > sudo bectl mount ${RELEASE}
> > BASEDIR=/tmp/be_mount.XXXX    # Use mount point returned by bectl mount
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> > upgrade -r ${RELEASE}
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > # Ignore admonitions to reboot, since we're using a boot environment
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > sudo bectl activate ${RELEASE}
> > sudo reboot
> >
> > This general procedure works just as well if you're upgrading from
> source, too.
> >
> > sudo make DESTDIR=${BASEDIR} installworld
> > sudo mergemaster -m $PWD -D $BASEDIR -U
>
>
> There's even a handy tool in /usr/src/tools/build that can be used as a
> wrapper to install a SRC build into a new boot environment.  It's
> /usr/src/tools/build/beinstall.sh (see man beinstall(8) for details).  It
> will create a new boot environment from a source build, run etcupdate and
> so forth, and even mark the new boot environment as the one to be active on
> reboot.  All you need to do is reboot.  I've been using it for source
> upgrades for a while now without problems.  The best thing, for me, is it
> cuts out all that time doing "make installworld" and etcupdate in single
> user mode, thus minimising downtime.
>
> Cheers,
>
> Paul.
>
>
>

-- 
Nuno Teixeira
FreeBSD Committer (ports)

[-- Attachment #2 --]
<div dir="ltr"><div>Hi Paul,</div><div><br></div><div>Really nice! I will test it soon.</div><div><br></div><div>Cheers<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Paul Mather &lt;<a href="mailto:paul@gromit.dlib.vt.edu">paul@gromit.dlib.vt.edu</a>&gt; escreveu no dia quarta, 21/09/2022 à(s) 00:17:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sep 20, 2022, at 6:19 PM, Alan Somers &lt;<a href="mailto:asomers@freebsd.org" target="_blank">asomers@freebsd.org</a>&gt; wrote:<br>
<br>
&gt; On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira &lt;<a href="mailto:eduardo@freebsd.org" target="_blank">eduardo@freebsd.org</a>&gt; wrote:<br>
&gt;&gt; <br>
&gt;&gt; Hello to all,<br>
&gt;&gt; <br>
&gt;&gt; I will use becl for the first time for current upgrades.<br>
&gt;&gt; Just to check that I&#39;m thinking correctly:<br>
&gt;&gt; <br>
&gt;&gt; Create a test environment for upgrade:<br>
&gt;&gt;&gt; bectl create -r test (should I use &#39;-r&#39;?)<br>
&gt;&gt; Activate test:<br>
&gt;&gt;&gt; bectl activate test<br>
&gt;&gt;&gt; reboot<br>
&gt;&gt; ...<br>
&gt;&gt;&gt; upgrade OS on test<br>
&gt;&gt;&gt; reboot<br>
&gt;&gt; ...<br>
&gt;&gt; if a problem happens, reboot default from BE loader<br>
&gt;&gt; ---<br>
&gt;&gt; if everything fine destroy default and rename test to default<br>
&gt;&gt;&gt; bectl destroy -o default<br>
&gt;&gt;&gt; bectl rename test default<br>
&gt;&gt; repeat on next upgrade<br>
&gt;&gt; <br>
&gt;&gt; Don&#39;t know if a faster way exists with chroot or bectl jail...<br>
&gt;&gt; <br>
&gt;&gt; Any hints appreciated.<br>
&gt;&gt; <br>
&gt;&gt; Thanks,<br>
&gt;&gt; --<br>
&gt;&gt; Nuno Teixeira<br>
&gt;&gt; FreeBSD Committer (ports)<br>
&gt; <br>
&gt; I don&#39;t think you need to use &quot;-r&quot;.  Also, you&#39;re forgetting one of<br>
&gt; the best things about boot environments: you can upgrade them even<br>
&gt; when not booted into them.  That&#39;s faster than upgrading the running<br>
&gt; BE.  Here is the procedure I use:<br>
&gt; <br>
&gt; RELEASE=Whatever<br>
&gt; sudo bectl create ${RELEASE}<br>
&gt; sudo bectl mount ${RELEASE}<br>
&gt; BASEDIR=/tmp/be_mount.XXXX    # Use mount point returned by bectl mount<br>
&gt; sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update<br>
&gt; upgrade -r ${RELEASE}<br>
&gt; sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install<br>
&gt; # Ignore admonitions to reboot, since we&#39;re using a boot environment<br>
&gt; sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install<br>
&gt; sudo bectl activate ${RELEASE}<br>
&gt; sudo reboot<br>
&gt; <br>
&gt; This general procedure works just as well if you&#39;re upgrading from source, too.<br>
&gt; <br>
&gt; sudo make DESTDIR=${BASEDIR} installworld<br>
&gt; sudo mergemaster -m $PWD -D $BASEDIR -U<br>
<br>
<br>
There&#39;s even a handy tool in /usr/src/tools/build that can be used as a wrapper to install a SRC build into a new boot environment.  It&#39;s /usr/src/tools/build/beinstall.sh (see man beinstall(8) for details).  It will create a new boot environment from a source build, run etcupdate and so forth, and even mark the new boot environment as the one to be active on reboot.  All you need to do is reboot.  I&#39;ve been using it for source upgrades for a while now without problems.  The best thing, for me, is it cuts out all that time doing &quot;make installworld&quot; and etcupdate in single user mode, thus minimising downtime.<br>
<br>
Cheers,<br>
<br>
Paul.<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committer (ports)</span></div></div>
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7U%2Bv8QkkgbcYdw7A3WiKN6zuzqwNN4SFh%2BDmyg-OJbWj3A>