[afnog] FreeBSD mirroring

Brian Candler B.Candler at pobox.com
Fri Apr 28 11:33:34 EAT 2006


On Fri, Apr 28, 2006 at 09:59:51AM +0200, Phil Regnauld wrote:
> 	I don't, I assume gmirror, which has been used in production for
> 	almost two years now, does the right thing.
> 
> 	I haven't met any disks yet where the exact disk size, minus
> 	the label offset, exactly matches a multiple of 512 bytes.

I think you mean "the exact disk size ... exactly matches a multiple of the
cylinder size"

> 	For example, the slice I create (s1) on my workstation disk:
> 
> DISK Geometry:  10011 cyls/255 heads/63 sectors = 160826715 sectors (78528MB)
> 
> Offset       Size(ST)        End     Name  PType       Desc  Subtype    Flags
> 
>          0         63         62        -     12     unused        0
>         63  160826652  160826714    ad4s1      8    freebsd      165
>  160826715       9765  160836479        -     12     unused        0          
> 
> 	Notice the "unused" space at the end, of 9765 sectors.

I see. I think that's due to the old geometry allocation stuff, which says
that the last block of a DOS partition must also be the last block in a
"cylinder".

In your case, 160836715 = 10011 (cyls) * 255 (heads) * 63 (sects/track) so
the last sector of cylinder #10010 is one less than this, i.e. 160836714.
The remainder of the disk is a fraction of a cylinder and is ignored.

So I think you're right; for legacy DOS-style machines you're probably safe
enough, as long as you mirror the whole disk (/dev/da0) rather than just the
FreeBSD slice (/dev/da0s1)

For machines which have more modern partitioning systems (Macs?) this might
not work. If you choose the so-called "dangerously dedicated mode", where
the whole disk is used by FreeBSD with no partition table, then also you
might be at risk.

Of course, if you create the partition as mirrored in the first place before
you populate it then everything is fine whatever you do, but I'm not sure if
the install process lets you do this at the moment.

Regards,

Brian.



More information about the afnog mailing list