From owner-freebsd-geom@freebsd.org Sun Feb 7 20:29:05 2021 Return-Path: Delivered-To: freebsd-geom@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 A03FD536737 for ; Sun, 7 Feb 2021 20:29:05 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.70]) (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 (2048 bits) client-digest SHA256) (Client CN "gromit.dlib.vt.edu", Issuer "Chumby Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYgjY49gwz3LB0; Sun, 7 Feb 2021 20:29:05 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from mbp-2012.gromit23.net (unknown [73.99.214.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gromit.dlib.vt.edu (Postfix) with ESMTPSA id 170A5B1; Sun, 7 Feb 2021 15:28:59 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: Making gmirror metadata cooperate with gpt metadata From: Paul Mather In-Reply-To: Date: Sun, 7 Feb 2021 15:28:58 -0500 Cc: pjd@freebsd.org, freebsd-geom@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5E7EFDC6-0089-4D6C-B81C-3D98A04C0FA7@gromit.dlib.vt.edu> References: To: Abner Gershon <6731955@gmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DYgjY49gwz3LB0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2021 20:29:05 -0000 On Feb 7, 2021, at 8:50 AM, Abner Gershon <6731955@gmail.com> wrote: > Disclaimer, I am not a programmer but have tinkered with shell and = perl > scripts. Having said that, I think many would appreciate the option of > using gmirror with disks larger than 2T. >=20 > The reason this is currently impossible is due to GPT and gmirror both > trying to store metadata in the last disk sector. >=20 > MBR does not allow for partitioning of disk greater 2T. >=20 > Workaround to gmirror partitions rather than whole disk is less than = ideal. Personally, I don't find mirroring individual partitions "less than = ideal" or at least onerous enough to enforce "whole-disk" semantics. = For one, it lets you use different balance algorithms for different = partitions, e.g., "prefer" on mirrored swap (so crash dumps work without = extra effort) and other balance algorithms for other file systems. For = another, you might potentially have to rebuild less data, depending on = the failure that leads to loss of mirror synchronisation. In a = whole-disk mirror, you are always going to have to resynchronise the = whole disk, whereas with partition-level mirrors you might be lucky and = have to resynchronise only a single partition. Also, you could turn = automatic resynchronisation off where it's not needed, e.g., for = auto-encrypted swap partitions. Gmirror's naive resilvering is also why I prefer to use ZFS for = mirroring: it resilvers (resynchronises) only actual data, and so is = much faster for pools that are emptier. (I only use gmirror for swap nowadays and use ZFS for everything else.) > Lines 254-293 of geom_mirror.c =C2=AB mirror =C2=AB geom =C2=AB lib - = src - FreeBSD source > tree > = > relate > to clearing and storing metadata on last sector of disk. >=20 > What would be the ramifications of altering gmirror to store metadata = on > the 2nd to last sector? This is basically what it ends up doing already. You make a GPT = covering the whole disk and the GPT uses the last sector for the backup. = You then make a gmirror inside this GPT container and it uses the last = sector of the container (second-to-last sector of the drive) for its = gmirror stored metadata. Also, couldn't you achieve your end using BSD partitions, or are they = disallowed inside GPT partitions? (I.e., create a GPT covering the = whole disk; create a GPT partition covering the entire GPT; create a = gmirror out of that; create a BSD partition on the gmirror for your file = systems.) Cheers, Paul.=