gmirror on a slice uncertainty

Harry Newton hn+freebsd at yewbarrow.net
Mon Jul 2 19:24:16 UTC 2007


Arne "Wörner" <arne_woerner at yahoo.com> writes:

[...]

>> > 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
>>
> Ohoh... OK - so ad4 and ad4s2 do not share the last sector...
> That makes my theory worthless...
>
>> 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);
>>
> Hmm... Dont know what that might mean...

I've reinstalled FreeBSD, but with the same slice values as given
above. I'm following Arne's suggestion and putting no disklabel on the
slice (the idea of having one lay in an abandoned partitioning scheme).

What I did exactly was:

 gmirror label -v home ad4s2 ad6s2

    Metadata value stored on ad4s2
    Metadata value stored on ad6s2

 gmirror load

... and then the machine froze. Looking in the logs, I see:

    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home created (id=2510448576).
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home: provider ad6s2 detected.
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home: provider ad4s2 detected.
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home: provider ad6s2 activated.
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home: provider ad4s2 activated.
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Device home: provider mirror/home launched.
    Jul  2 19:23:48 hydra kernel: WARNING: Expected rawoffset 0, found 41929650
    Jul  2 19:23:48 hydra last message repeated 13 times
    Jul  2 19:23:48 hydra kernel: GEOM_MIRROR: Cannot add disk mirror/homecccccccccccccc to home (error=17).
    Jul  2 19:23:48 hydra kernel: WARNING: Expected rawoffset 0, found 41929650
    Jul  2 19:23:48 hydra last message repeated 38 times
    Jul  2 19:23:48 hydra kernel: WARNING: Device name truncated! (mirror/homecccccccccccccccccccccccccccccccccccccccccccccccccccc)
    Jul  2 19:23:48 hydra kernel: WARNING: Expected rawoffset 0, found 41929650
    
with the last message repeated over 30 times before the reboot.

I repeated this after rebooting and got exactly the same. I then tried:

 dd if=/dev/zero of=/dev/ad4s2 bs=512 count=79
 dd if=/dev/zero of=/dev/ad6s2 bs=512 count=79

 gmirror label -v home ad4s2 ad6s2

    Metadata value stored on ad4s2
    Metadata value stored on ad6s2

 gmirror load

    GEOM_MIRROR: Device home created (id=1852978599).
    GEOM_MIRROR: Device home: provider ad6s2 detected.
    GEOM_MIRROR: Device home: provider ad4s2 detected.
    GEOM_MIRROR: Device home: provider ad6s2 activated.
    GEOM_MIRROR: Device home: provider ad4s2 activated.
    GEOM_MIRROR: Device home: provider mirror/home launched.

    
So I am now quite concerned, and cautious about putting any data onto this machine. Does anyone have any ideas about this, and would you suggest this is a software bug or faulty hardware ?

Thanks

 - Harry


More information about the freebsd-geom mailing list