GPT partitions on whole disk gmirror - questions about the metadata issue

Matthias Petermann matthias at petermann-it.de
Wed Nov 21 04:48:19 UTC 2018


Hello,

in section 18.3 of the FreeBSD handbook[1] there is a warning regarding 
using whole disc mirroring with gmirror together with GPT:

"gmirror(8) stores one block of metadata at the end of the disk. Because 
GPT partition schemes also store metadata at the end of the disk, 
mirroring entire GPT disks with gmirror(8) is not recommended. MBR 
partitioning is used here because it only stores a partition table at 
the start of the disk and does not conflict with the mirror metadata."

Why is it that gmirror does not represent the mirrored device for the 
levels above it in a way that does not allow access to the last block 
containing the metadata? Would it be enough to simply mimic a smaller 
device, one block less than the underlying providers?

In the case mentioned above, the workaround is to first partition both 
providers using GPT and then form gmirrors from two GPT partitions each. 
In this case, the metadata problem should not be critical because 
gmirror exists within the partition itself. Here is my further question: 
how does the file system (UFS) ensure that e.g. newfs does not overwrite 
the last block of a gmirror in this setting?

Best regards,
Matthias

[1] https://www.freebsd.org/doc/handbook/geom-mirror.html

-- 
Matthias Petermann <matthias at petermann-it.de> | www.petermann-it.de
GnuPG: 0x5C3E6D75 | 5930 86EF 7965 2BBA 6572  C3D7 7B1D A3C3 5C3E 6D75



More information about the freebsd-questions mailing list