From nobody Thu Feb 24 18:51:13 2022 X-Original-To: freebsd-stable@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 1FC5319D3DB6 for ; Thu, 24 Feb 2022 18:51:19 +0000 (UTC) (envelope-from SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4K4MSQ1kBqz3vv8 for ; Thu, 24 Feb 2022 18:51:18 +0000 (UTC) (envelope-from SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 836F228417; Thu, 24 Feb 2022 19:51:15 +0100 (CET) Received: from illbsd.quip.test (ip-78-45-215-131.net.upcbroadband.cz [78.45.215.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 4222E28411; Thu, 24 Feb 2022 19:51:14 +0100 (CET) Subject: Re: bootcode update after zpool upgrade To: Warner Losh Cc: Alexander Leidinger , FreeBSD Stable Mailing List References: <20220224104322.Horde.akByDDeJzjTUIyGt_Few2RI@webmail.leidinger.net> <5715fdc2-fb94-99d4-7a11-fe0666807866@quip.cz> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <6c9758cc-056f-c1d3-e2ff-45f0adbd2c2f@quip.cz> Date: Thu, 24 Feb 2022 19:51:13 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4K4MSQ1kBqz3vv8 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of "SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz" has no SPF policy when checking 94.124.105.4) smtp.mailfrom="SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz" X-Spamd-Result: default: False [0.48 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.70)[-0.703]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[quip.cz]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981]; NEURAL_SPAM_LONG(0.96)[0.960]; MLMMJ_DEST(0.00)[freebsd-stable]; FORGED_SENDER(0.30)[000.fbsd@quip.cz,SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz]; R_SPF_NA(0.00)[no SPF record]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[000.fbsd@quip.cz,SRS0=rzo6=TH=quip.cz=000.fbsd@elsa.codelab.cz]; RECEIVED_SPAMHAUS_PBL(0.00)[78.45.215.131:received] X-ThisMailContainsUnwantedMimeParts: N On 24/02/2022 17:55, Warner Losh wrote: > > > On Thu, Feb 24, 2022 at 4:49 AM Miroslav Lachman <000.fbsd@quip.cz > > wrote: > > On 24/02/2022 10:43, Alexander Leidinger wrote: > > Quoting Miroslav Lachman <000.fbsd@quip.cz > > (from Wed, 23 Feb 2022 > > >> I am not sure what I should update. This machine is EFI boot only > >> (this is the only one EFI machine we have). > > > >> Should I run: > >> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 nvd0 > >> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 nvd1 > > > > This is the bootcode zpool upgrade talks about. > > > >> Or should I update EFI partitions? (if so, then how?) > > > > The EFI partition contains the loader, not the bootcode. > > > > While we are at it, I'm still looking for the place where I can find > > which features the bootcode supports. Not all features are > supported for > > a root pool. > > Thank you for the clarification! > > > If you've updated your ZFS pool and have an old system, you do need to > update > the EFI boot code. None of the mbr stuff is used for EFI booting. > > If you have an old installation, it may be small. So ideally, you'd copy > over /boot/loader.efi > to ESP:efi/boot/bootx64.efi. However, it may be too big if you have an > ESP created by the > old installer. In that case, you'll need to either create a new, larger > ESP, or copying /boot/boot1.efi > instead. This machine was installed 2 years ago as FreeBSD 11.2 and then upgraded to 11.4 and 12.2. The last update was from 12.2-p9 to 12.2-p13 so the machine was booting fine without modification of bootcode and with FreeBSD 12.2-p9 but after the last update to -p13 I decided to run "zpool upgrade". So the question is, do I need to update efi/boot/bootx64.efi? I tried to look at it: # mount -t msdosfs /dev/nvd0p1 /media/ # ll /media/efi/boot/ total 385 -rwxr-xr-x 1 root wheel 384K Apr 16 2018 BOOTx64.efi* -rwxr-xr-x 1 root wheel 12B Apr 16 2018 startup.nsh* The BOOTx64.efi is old, from 11.2 install. The newer one in /boot/ looks bigger 478K Mar 24 2021 loader.efi And the second question is back on bootcode. I already run gpart bootcode: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 nvd0 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 nvd1 But I found something in my notes from install time few years ago: gpart bootcode -p /boot/boot1.efifat -i 2 /dev/nvd01 What really should be installed on freebsd-boot partition? /boot/gptzfsboot or /boot/boot1.efifat # gpart show => 40 1953525088 nvd0 GPT (932G) 40 409600 1 efi (200M) 409640 1024 2 freebsd-boot (512K) 410664 113624 - free - (55M) 524288 20971520 3 freebsd-swap (10G) 21495808 1932001280 4 freebsd-zfs (921G) 1953497088 28040 - free - (14M) I am sorry for asking this questions but this is the only machine with EFI I had and never did "zpool upgrade" on it. Is there a way to test if the machine will be bootable befor I try to reboot it? The machine is not physically accessible to me so the recovery from failed boot is very problematic. Kind regards Miroslav Lachman