From owner-freebsd-questions@freebsd.org Fri Sep 6 14:29:03 2019 Return-Path: Delivered-To: freebsd-questions@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 423F1F508B for ; Fri, 6 Sep 2019 14:29:03 +0000 (UTC) (envelope-from SRS0=z+5a=XB=perdition.city=julien@bebif.be) Received: from orval.bbpf.belspo.be (orval.bbpf.belspo.be [193.191.208.90]) by mx1.freebsd.org (Postfix) with ESMTP id 46Q0L64P0Wz4QZC for ; Fri, 6 Sep 2019 14:29:02 +0000 (UTC) (envelope-from SRS0=z+5a=XB=perdition.city=julien@bebif.be) Received: from home.lan (unknown [77.109.105.33]) by orval.bbpf.belspo.be (Postfix) with ESMTPSA id E2BA01D4FC2C; Fri, 6 Sep 2019 16:29:00 +0200 (CEST) Date: Fri, 6 Sep 2019 16:28:59 +0200 From: Julien Cigar To: Polytropon Cc: freebsd-questions@freebsd.org Subject: Re: gpart bootcode for MBR + ZFS? Message-ID: <20190906142858.GK38457@home.lan> References: <20190906100649.GH38457@home.lan> <20190906115531.GI38457@home.lan> <20190906155834.685b57a2.freebsd@edvax.de> <20190906141342.GJ38457@home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BFVE2HhgxTpCzM8t" Content-Disposition: inline In-Reply-To: <20190906141342.GJ38457@home.lan> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 46Q0L64P0Wz4QZC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of SRS0=z@bebif.be designates 193.191.208.90 as permitted sender) smtp.mailfrom=SRS0=z@bebif.be X-Spamd-Result: default: False [-6.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; IP_SCORE(-2.99)[ip: (-8.89), ipnet: 193.191.192.0/19(-4.44), asn: 2611(-1.62), country: BE(-0.01)]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; SUBJECT_ENDS_QUESTION(1.00)[]; DMARC_NA(0.00)[perdition.city]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[90.208.191.193.list.dnswl.org : 127.0.10.0]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[julien@perdition.city,SRS0=z@bebif.be]; RCVD_NO_TLS_LAST(0.10)[]; RECEIVED_SPAMHAUS_PBL(0.00)[33.105.109.77.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:2611, ipnet:193.191.192.0/19, country:BE]; TAGGED_FROM(0.00)[5a=XB=perdition.city=julien]; FROM_NEQ_ENVFROM(0.00)[julien@perdition.city,SRS0=z@bebif.be]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2019 14:29:03 -0000 --BFVE2HhgxTpCzM8t Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 06, 2019 at 04:13:42PM +0200, Julien Cigar wrote: > On Fri, Sep 06, 2019 at 03:58:34PM +0200, Polytropon wrote: > > On Fri, 6 Sep 2019 13:55:31 +0200, Julien Cigar wrote: > > > From what I understand I /boot/boot0 (or mbr) only provides stage 0, = for > > > stage 1 and stage 2 I should use: > > > $> dd if=3D/boot/zfsboot of=3D/dev/ada1s1 count=3D1 > > > $> dd if=3D/boot/zfsboot of=3D/dev/ada1s1a iseek=3D1 oseek=3D1024 > > >=20 > > > However I'm getting a "Operation not permitted" even with > > > kern.geom.debugflags=3D0x10 .. any idea? > >=20 > > Judging by the prompt... are you doing this as root? $ suggests > > a non-root user, who of course is not permitted to write to a > > disk device file directly. >=20 > Yes, I'm doing this as root ..=20 >=20 > I did the following: >=20 > $> gpart backup ada0 | gpart restore -F ada1 > $> gpart backup ada0s1 | gpart restore -F ada1s1 > $> zpool attach bootpool ada0s1a ada1s1a > $> zpool attach zroot ada0s1d ada1s1d > $> gpart bootcode -b /boot/mbr ada1 > $> sysctl kern.geom.debugflags=3D0x10 > $> dd if=3D/boot/zfsboot of=3D/dev/ada1s1 count=3D1 > $> dd if=3D/boot/zfsboot of=3D/dev/ada1s1a iseek=3D1 oseek=3D1024 >=20 > (last two steps failed) >=20 > I'm wondering if this is because ZFS is involved ..? > (although man 4 geom doesn't say anything about thatr) ok it was because of that .., it worked with: $> gmirror remove swap ada1s1b $> zpool offline bootpool ada1s1a $> zpool offline zroot ada1s1d $> dd if=3D/home/jcigar/zfsboot of=3D/dev/ada1s1 count=3D1 $> dd if=3D/home/jcigar/zfsboot of=3D/dev/ada1s1a iseek=3D1 oseek=3D1024 $> gmirror insert swap ada1s1b $> zpool online bootpool ada1s1a $> zpool online zroot ada1s1d $> sysctl kern.geom.debugflags=3D0 does it sounds ok ..? >=20 > Julien >=20 > >=20 > >=20 > > --=20 > > Polytropon > > Magdeburg, Germany > > Happy FreeBSD user since 4.0 > > Andra moi ennepe, Mousa, ... >=20 > --=20 > Julien Cigar > Belgian Biodiversity Platform (http://www.biodiversity.be) > PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 > No trees were killed in the creation of this message. > However, many electrons were terribly inconvenienced. --=20 Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. --BFVE2HhgxTpCzM8t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE7vn2l0to0nV7EWolsrs3EKIEI8AFAl1ybSYACgkQsrs3EKIE I8CDyBAAnY8ZXhO5+ye1c3Kr6vH/y24zZxXMLohdHbQIRsLAPhZLYccdSs+B2ioS TRSr5CooeQG3Xqt0wPHjVDK9hBcY+vjcqdh469efo/i2QioFLMgFGtUEmBck+MTQ 526IRqL1pyPsV1IsQUq7UMV6O9iMdsjqGRz9oLf4gnKqWIstN9TX+rM2C11mVcn6 UJzlT8gK9d7VZ+ws5fdE6V+pfaEL8XgdOIPAwawbE7i8okm/uLknuujwwo5K5MmP KxccHb12muORhMyaD9L7wX3qPij/2IfwN3yJTlWiY9aBT8kBnZZnxiY7yzTn6FTv xmYhb4R86HrLHojY6AOtzXpIFqCyx4+jpJNbmQTz28+DPQy09ErZorZBHoGWvpD7 V9R9JYgtufgXCgYu1RdUfD8pu5xG2qUuhYvpS3tIGYsZk+JLp5hli1x4bNvQrbuv FGC9K84OpkUACotQ26ASz7VU/fkj+aimRGOtk/lpwyNjeXnBTS00LIdFzji+1HZk u3WOJ0HmkSWU978P0LUnEnX2aFtGFx7rM3I5i4v2wAVYXBQB1z8tlwZU4woOhS+B 4MC3VA7MgEKmE3NLiwkgd8bV3/Zjulk1AfEhOBMb7Ehqz8HFCMt6nwSZJDlEOu6e HBMvqYzOtJ/vjEg9njW8QTGahpziiqGbACoqDZKfunuJofsPFRs= =j6Ad -----END PGP SIGNATURE----- --BFVE2HhgxTpCzM8t--