On Feb 7, 2021, at 8:50 AM, Abner Gershon <6731...@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.
> 
> The reason this is currently impossible is due to GPT and gmirror both
> trying to store metadata in the last disk sector.
> 
> MBR does not allow for partitioning of disk greater 2T.
> 
> 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 « mirror « geom « lib - src - FreeBSD source
> tree
> <https://cgit.freebsd.org/src/tree/lib/geom/mirror/geom_mirror.c?h=releng/13.0>
> relate
> to clearing and storing metadata on last sector of disk.
> 
> 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.
_______________________________________________
freebsd-geom@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "freebsd-geom-unsubscr...@freebsd.org"

Reply via email to