gmirror on a slice uncertainty

Harry Newton hn+freebsd at yewbarrow.net
Fri Jun 29 19:34:58 UTC 2007


Arne - many thanks for your help. I've a couple more questions if you
don't mind ...

[...]

>>  - this error message about partition c:
>>     hydra# bsdlabel ad6s2
>>     # /dev/ad6s2:
>>       c: 583207694        0    unused        0     0         # "raw" part,
>>     bsdlabel: partition c doesn't cover the whole unit!
>>
> see: ...694 (one sector less)
> This is because gmirror uses the last sector of the slice, so that the gmirror
> device (mirror/home) is one sector shorter than the slice...

[...]

I understand this now: gmirror reserves one sector for its metadata
(the last sector). I disklabel /dev/mirror/home which is one sector
smaller than the underlying disks. When I look at /dev/mirror/home
with bsdlabel there is no problem because the disklabel is consistent
with the size of the device (/dev/mirror/home).  However, when I
report on the underlying disks with bsdlabel (which I can do because
they start at the same place) it notes the size discrepancy and issues
the warning.

I don't have to worry about that at all because I should be only
accessing through /dev/mirror/home.


>>  - and this line in /var/log/messages:
>>     WARNING: Expected rawoffset 0, found 41929650
>>
> 41929650 == 41929587+63
> This is the beginning of slice 2 (see fdisk)...
> I would guess, that slice 2 ends on the last sector of the disk, so that
> gmirror is disturbed (it doesnt know if ad4 or ad4s2 (which share both the same
> last sector) is its underlying disk)...

I haven't followed this. If I look at the disk with sysinstall:

    Disk name:      ad4                                    FDISK Partition Editor
    DISK Geometry:  38913 cyls/255 heads/63 sectors = 625137345 sectors (305242MB)
    
    Offset       Size(ST)        End     Name  PType       Desc    Subtype  Flags
    
             0         63         62        -     12     unused        0
            63   41929587   41929649    ad4s1      8    freebsd      165
      41929650  583207695  625137344    ad4s2      8    freebsd      165          
     625137345       5103  625142447        -     12     unused        0

I see there's space at the end of the disk. The code that produces the
message is in geom_bsd.c and is:

        if (rawoffset != 0 && (off_t)rawoffset != ms->mbroffset)
                printf("WARNING: Expected rawoffset %jd, found %jd\n",
                    (intmax_t)ms->mbroffset/dl.d_secsize,
                    (intmax_t)rawoffset/dl.d_secsize);

But I'm now confused as to what the importance of this message is ?


> You could solve that
> 1. by using hard coded disk names in gmirror

Is this to prevent ad4 and ad4s2 being confused ? Doesn't gmirror know
what the components that make up the provider are ? 

[...]

> All errors/warnings r not so important possibly...
> I think ur gmirror device would work fine (but dont trust me without
> tests)...

I think you're probably right, but I'd like to do it right and
understand it more.

[...]

Thanks

 - Harry


More information about the freebsd-geom mailing list