From owner-freebsd-fs@freebsd.org Fri Apr 3 19:54:22 2020 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C32BF266877 for ; Fri, 3 Apr 2020 19:54:22 +0000 (UTC) (envelope-from SRS0=T8al=5T=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 48v9cL0R7sz4WVd for ; Fri, 3 Apr 2020 19:54:09 +0000 (UTC) (envelope-from SRS0=T8al=5T=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 CFF8D28416; Fri, 3 Apr 2020 21:44:54 +0200 (CEST) Received: from illbsd.quip.test (ip-62-24-92-232.net.upcbroadband.cz [62.24.92.232]) (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 D11212840C; Fri, 3 Apr 2020 21:44:52 +0200 (CEST) Subject: Re: gpart bootcode Operation not permitted To: Artem Kuchin , freebsd-fs@freebsd.org References: <27955efa-01f2-88f6-6a28-d9d8a62dfa2a@artem.ru> <48ba23fa-13dc-4a74-579c-2028479f302a@quip.cz> <1605a04a-ad2c-5b2c-445f-fb8ccd7211d6@artem.ru> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <159cf2f5-1898-019e-9f02-29750ff7fa7e@quip.cz> Date: Fri, 3 Apr 2020 21:44:52 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.3 MIME-Version: 1.0 In-Reply-To: <1605a04a-ad2c-5b2c-445f-fb8ccd7211d6@artem.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48v9cL0R7sz4WVd X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of SRS0=T8al=5T=quip.cz=000.fbsd@elsa.codelab.cz has no SPF policy when checking 94.124.105.4) smtp.mailfrom=SRS0=T8al=5T=quip.cz=000.fbsd@elsa.codelab.cz X-Spamd-Result: default: False [4.01 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(0.83)[ip: (0.29), ipnet: 94.124.104.0/21(0.14), asn: 42000(3.62), country: CZ(0.09)]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[quip.cz]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.989,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.105.124.94.list.dnswl.org : 127.0.10.0]; NEURAL_SPAM_LONG(1.00)[0.996,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[000.fbsd@quip.cz,SRS0=T8al=5T=quip.cz=000.fbsd@elsa.codelab.cz]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ]; FROM_NEQ_ENVFROM(0.00)[000.fbsd@quip.cz,SRS0=T8al=5T=quip.cz=000.fbsd@elsa.codelab.cz]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 19:54:23 -0000 Artem Kuchin wrote on 2020/04/03 21:23: > 03.04.2020 17:42, Miroslav Lachman пишет: >> >> I think you can use "gmirror stop" on boot partition, then "gmirror >> clear" and then update both individual boot partitions by gpart. >> >> > > I am afraid to do it. Gmirror stops mirroring, okay. What what gmirror > clear does? What metadata is cleared and what it is used for? > > How to restart mirroring after that and how to make sure that mirror is > 100% complete? > > Is it possible to exclude only boot partition from mirroring? Of course that's what I am suggesting - just split up mirroring of boot partition and keep mirroring on swap and root! Gmirror clear deletes the very last sector on the given partition where metadata of gmirror are stored. It does not touch the data on the partitions. You don't need to worry. You have 3 mirrors. They are visible in /dev/mirror or by command "gmirror status": boot swap root As the "man gmirror" shows: gmirror stop [-fv] name ... You can run: gmirror stop -v boot It stops only the "boot" mirror. swap and root are still mirrored. Then you can clear metadata on each provider: gmirror clear ada0p1 gmirror clear ada1p1 Or you can use "gmirror destroy -v boot" istead of 3 command above. It should stop the "boot" mirror and then clear metadata on both providers. The you will have / your system will use 2 independent boot partitions: ada0p1 and ada1p1. The machine should be able to boot from any of those 2 disks because each of them has valid boot partitions / boot code. Gpart bootcode should work for them on each system upgrade. gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 Kind regards Miroslav Lachman