From nobody Wed Sep 21 00:24:54 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MXK1b2Z4nz4cn4l for ; Wed, 21 Sep 2022 00:25:07 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MXK1b23x6z3jwS; Wed, 21 Sep 2022 00:25:07 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663719907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9DJYAGjvbMI9I6Le3gGddBVu/A7ob4CoVOzl7SFTcTE=; b=v8e6NKQsO2e8OOymBmZJpkmLoRzxxE85Hb3TahTl7vYhkDa8rAuiwhAxJemM/0aVI4WDRE 3121rtA3Paa48GbinUOGi9Xtr2sgF38PunvNon3z+H6rbHjZUoRZgNfYHAqbhf6jWy/OVr rcNXTkUAf7fp2/oTM0WUhqismF99q8ppXcapYONA0beaZeQBcSK3fxQPtzQ1MEpVqrIsdx as6IUXnHcLFpvZb4XsTEe9HKMS9XZneJmsbC0qD3pbppT8XlNouE542vd4zYTuz8gVo5ia RiLGJG1CLm+9gnUAWToYGZfr6VJD5mLZv3ocso088d/BBioTwYZ0AchZ/J6PVw== Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4MXK1b0xqXz1D4Z; Wed, 21 Sep 2022 00:25:07 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-vs1-f43.google.com with SMTP id a129so5065277vsc.0; Tue, 20 Sep 2022 17:25:07 -0700 (PDT) X-Gm-Message-State: ACrzQf3O1c9B/8mf3IAi/11xgI6q7+t8NW9mmUvZQ31rXH3RWlq7USaB ZLWIYM7UwlxlklQDjiRa5Qiz8ijcOSbEKSR2emw= X-Google-Smtp-Source: AMsMyM666UnRsr0tFiXyi0IotSOoCG1kSo41Xk9a6jG6utly1Q/FX8BVRkfuHsS9wS3wGk/I2+uQu2n0n9s2pSKW2Ps= X-Received: by 2002:a67:a202:0:b0:39b:181d:bd20 with SMTP id l2-20020a67a202000000b0039b181dbd20mr4096917vse.51.1663719906299; Tue, 20 Sep 2022 17:25:06 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <780F7E98-661B-49B5-BF0C-1E5A7EB7F1EE@gromit.dlib.vt.edu> In-Reply-To: <780F7E98-661B-49B5-BF0C-1E5A7EB7F1EE@gromit.dlib.vt.edu> From: Nuno Teixeira Date: Wed, 21 Sep 2022 01:24:54 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Good practices with bectl To: Paul Mather Cc: Alan Somers , FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000055b0605e924fa53" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663719907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9DJYAGjvbMI9I6Le3gGddBVu/A7ob4CoVOzl7SFTcTE=; b=iIISb+L8DR92mgG+kv/vqEm6f7xeraZikmNCTlkC2p9X8+n9d/DctSKCVmBi19kFUtSHiu WAc5Vm0WniW9adoaN685RkoDzD0ntZUuywnoK9mHBHwtM74kYRtRKa0tI1OWhCL0TLvHbo Y/0iHSVqG7usSEgfS5xG/vAklrs9tAzSHkqAkAi49VbQIB2RV/LFBI1yfWiQY/dSCxFWfK xSKq9ctoGX5NijykY8tbYdfiReh+RMfKKfepdL0LxoY9AOVtrZ0eDDF9QBTh1L6sH3jR8m poriXRBJxYDYCqkcawiiSYmhDJCfd8B4PVTManVahGAW/em6xuEDph78gJEgrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663719907; a=rsa-sha256; cv=none; b=vUANhd0mJC+Ktj9PB+CPRJs0O+llZxYC1vBJujmQl46i8TK5b7H/sbcjVjZL1T/Xz1fwRu gGWUTUw6dyTzYo26cntTlLNPy5JxGCRl8oWj2H7UMSraGmSYsBn5wcWw56l5H6ilTWj6dU VuM9oGiA3Fc7gfsePp1DFIFwUPJLQ3ikZMWQCxT32xSWTk7sb9Xzp1mwc5GGTefGNBNsbK NP3LWX0SU4yYetDMK3XquB+zSjOks7D/pkzlkDiIOkrVXN4Cc34+jsSLT4b/W/KAEfT3IN yMOvHCmwaIQqr2gN0d5kgkFwW/m9jV5jH4abl9piIP7yY9Th+CtxwFR5Anw4hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --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 escreveu no dia quarta, 21/09/2022 =C3=A0(s) 00:17: > On Sep 20, 2022, at 6:19 PM, Alan Somers wrote: > > > On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira > 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
Hi Paul,

Really nice! I will= test it soon.

Cheers

Paul Mather <paul@gromit.dlib.vt.edu> esc= reveu no dia quarta, 21/09/2022 =C3=A0(s) 00:17:
On Sep 20, 2022, at 6:19 PM, Alan Somers &= lt;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".=C2=A0 Also, you'= re forgetting one of
> the best things about boot environments: you can upgrade them even
> when not booted into them.=C2=A0 That's faster than upgrading the = running
> BE.=C2=A0 Here is the procedure I use:
>
> RELEASE=3DWhatever
> sudo bectl create ${RELEASE}
> sudo bectl mount ${RELEASE}
> BASEDIR=3D/tmp/be_mount.XXXX=C2=A0 =C2=A0 # Use mount point returned b= y bectl mount
> sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update<= br> > 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 environme= nt
> 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.=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.

Cheers,

Paul.




--
Nun= o Teixeira
FreeBSD Committer (ports)
--000000000000055b0605e924fa53--