Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 May 2022 14:14:22 +0200
From:      Julien Cigar <julien@perdition.city>
To:        Christos Chatzaras <chris@cretaforce.gr>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: ZFS replace a mirrored disk
Message-ID:  <20220511121422.baddv74m65xsbwmj@x1>
In-Reply-To: <C46DD702-BED7-466F-986D-289A4A56DC4F@cretaforce.gr>
References:  <C46DD702-BED7-466F-986D-289A4A56DC4F@cretaforce.gr>

next in thread | previous in thread | raw e-mail | index | archive | help

--jeheqoynuvnmbpnt
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 11, 2022 at 01:22:36PM +0300, Christos Chatzaras wrote:

Hello,

> When a disk fails and want to replace it with a NEW disk are these comman=
ds correct?
>=20
> ----
> gpart backup nvd1 | gpart restore -F nvd0
> gmirror forget swap
> gmirror insert swap /dev/nvd0p2
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 nvd0
> zpool replace zroot nvd0
> ----
>=20
>=20
> I try to simulate a disk "failure". I tried the above commands with the S=
AME disk without success. I believe the "issue" is because the "new" disk i=
s the SAME as before.

First please define "without success", what doesn't work?

please paste output of:

$> gpart show nvd1

also, is it an UEFI system or classicla BIOS with GPT? What FreeBSD
version?

zpool replace zroot nvd0 is invalid, you should use:

$> zpool replace zroot nvd1 nvd0 (but it uses the entire disk, which is
probably incorrect too)

>=20
> I did these steps:
>=20
> 1) Boot with mfsBSD and did "gpart destroy -F nvd0"
> 2) Reboot the server in the main OS.
>=20
> If the "new" disk is the SAME as before do I have to change the commands =
to these?
>=20
> ----
> gpart backup nvd1 | gpart restore -F nvd0
> gmirror forget swap
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 nvd0
> zpool offline zroot nvd0
> zpool online zroot nvd0
> ----
>=20
>=20
> Also I notice that with the SAME disk "gmirror forget swap" starts rebuil=
ding swap immediately and "gmirror insert swap /dev/nvd0p2" is not needed. =
Is this the correct behaviour when the "new" disk is the SAME?

--=20
Julien Cigar
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.

--jeheqoynuvnmbpnt
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEnF27CBNtOraRNmgqCLYqJMpBHmkFAmJ7qJsACgkQCLYqJMpB
HmkChhAAhYqFUl4Zj6kS6U5Ig3F3EeMhjwa1potcttDiJEoTxMTdAo1eLeBKDNca
zSou9ZkwAkcc8wctfRvgkzgc0+fYkDvKKQsxo+HHkqLm+iavFTPkNNKzn9FB5UpE
cdagZsdlXKzcE3ORM2/6H+k5fw71YQvlaOvKTbE7mlBgC5IymGJ5NI7pqIPK83xs
uDrje69b8VU+DXHZHpDEREatVrtbVvPSlPbnz5l+lvpvDntrf4m2NzQeNfxLWZWT
3ycpR/ZQaUYmCAk9Bo+W5ZrW3iUk4Gk2dFRn09Jkp5PEL44Vkn1/an6uaPbk/dOq
z4ct8cMDDI7jShjojURKicbufxtwLR61PSIpVgVylE2e4PON1yojI8J5mLeVzPMR
DizfSQLPENzjst3WSITZ1rVY4lhcvL4yv8tWULoauerBU0lZMbnz/IM0gzdFtjSE
uJ3E7IYkDx3RoRBycCCR4+lIXoJgq6F/8vuq7/hOHU0pZXOwrVsov88P/VJd5DFW
NYEc+SQjXhMeP5nORQokNo7bC9Ib1cczaZoy1ZuIKlK3n+FSA0xtHNdCEn9GIehu
yU3zC94cWPWOdjFLMHmlu39WmXwV7XHSHLK7awsEW/3ix+Yqq142T9BcuZKvG7mG
WIPh5LCb7IEuHodNBccHiUeTLg6vRE7dyCECsfGo5+Zt8cfgng0=
=eAWZ
-----END PGP SIGNATURE-----

--jeheqoynuvnmbpnt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220511121422.baddv74m65xsbwmj>