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>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000055b0605e924fa53 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Paul, Really nice! I will test it soon. Cheers Paul Mather <paul@gromit.dlib.vt.edu> escreveu no dia quarta, 21/09/2022 =C3=A0(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=3DWhatever > > sudo bectl create ${RELEASE} > > sudo bectl mount ${RELEASE} > > BASEDIR=3D/tmp/be_mount.XXXX # Use mount point returned by bectl mou= nt > > 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=3D${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. > > > --=20 Nuno Teixeira FreeBSD Committer (ports) --000000000000055b0605e924fa53 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"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 clas= s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Paul Mather <<a = href=3D"mailto:paul@gromit.dlib.vt.edu">paul@gromit.dlib.vt.edu</a>> esc= reveu no dia quarta, 21/09/2022 =C3=A0(s) 00:17:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex">On Sep 20, 2022, at 6:19 PM, Alan Somers &= lt;<a href=3D"mailto:asomers@freebsd.org" target=3D"_blank">asomers@freebsd= .org</a>> wrote:<br> <br> > On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira <<a href=3D"mailto:ed= uardo@freebsd.org" target=3D"_blank">eduardo@freebsd.org</a>> wrote:<br> >> <br> >> Hello to all,<br> >> <br> >> I will use becl for the first time for current upgrades.<br> >> Just to check that I'm thinking correctly:<br> >> <br> >> Create a test environment for upgrade:<br> >>> bectl create -r test (should I use '-r'?)<br> >> Activate test:<br> >>> bectl activate test<br> >>> reboot<br> >> ...<br> >>> upgrade OS on test<br> >>> reboot<br> >> ...<br> >> if a problem happens, reboot default from BE loader<br> >> ---<br> >> if everything fine destroy default and rename test to default<br> >>> bectl destroy -o default<br> >>> bectl rename test default<br> >> repeat on next upgrade<br> >> <br> >> Don't know if a faster way exists with chroot or bectl jail...= <br> >> <br> >> Any hints appreciated.<br> >> <br> >> Thanks,<br> >> --<br> >> Nuno Teixeira<br> >> FreeBSD Committer (ports)<br> > <br> > I don't think you need to use "-r".=C2=A0 Also, you'= re forgetting one of<br> > the best things about boot environments: you can upgrade them even<br> > when not booted into them.=C2=A0 That's faster than upgrading the = running<br> > BE.=C2=A0 Here is the procedure I use:<br> > <br> > RELEASE=3DWhatever<br> > sudo bectl create ${RELEASE}<br> > sudo bectl mount ${RELEASE}<br> > BASEDIR=3D/tmp/be_mount.XXXX=C2=A0 =C2=A0 # Use mount point returned b= y bectl mount<br> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update<= br> > upgrade -r ${RELEASE}<br> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update = install<br> > # Ignore admonitions to reboot, since we're using a boot environme= nt<br> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update = install<br> > sudo bectl activate ${RELEASE}<br> > sudo reboot<br> > <br> > This general procedure works just as well if you're upgrading from= source, too.<br> > <br> > sudo make DESTDIR=3D${BASEDIR} installworld<br> > sudo mergemaster -m $PWD -D $BASEDIR -U<br> <br> <br> 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.=C2=A0 It's= /usr/src/tools/build/beinstall.sh (see man beinstall(8) for details).=C2= =A0 It will create a new boot environment from a source build, run etcupdat= e and so forth, and even mark the new boot environment as the one to be act= ive on reboot.=C2=A0 All you need to do is reboot.=C2=A0 I've been usin= g it for source upgrades for a while now without problems.=C2=A0 The best t= hing, for me, is it cuts out all that time doing "make installworld&qu= ot; and etcupdate in single user mode, thus minimising downtime.<br> <br> Cheers,<br> <br> Paul.<br> <br> <br> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g= mail_signature"><div dir=3D"ltr"><span style=3D"color:rgb(102,102,102)">Nun= o Teixeira<br>FreeBSD Committer (ports)</span></div></div> --000000000000055b0605e924fa53--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7U%2Bv8QkkgbcYdw7A3WiKN6zuzqwNN4SFh%2BDmyg-OJbWj3A>