NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GPT and raid seems ok, missing disks awkward



On Wed, May 23, 2012 at 08:44:10AM -0400, Greg Troxel wrote:
> 
> I ended up figuring out my issues, but I'm thinking this note may be
> useful to others.
> 
> summary:
>   Does raidframe on dkN via gpt work? (yes, it seems to)
>   Does the "absent" keyword in raidctl still work? (yes, but with -C)
> 
> My system is up-to-date netbsd-5/i386.
> 
> I just got two 2T SATA drives, intending to migrate a system from 2 *
> 400G RAID-1 to a RAID-1 pair with the new drives.  (Not relevant, I
> think: I got one Seagate and one Hitachi drive, both 7200 rpm, to reduce
> the chance of correlated failures.)
> 
> I put the Seagate drive in an Aluratek docking enclosure, and it shows
> up as sd4 and seems to work.
> 
> I used gpt create, gpt add, gpt label, and addwedge, and can access dk0.
> It looks fine (yes, I started at 64 not 34 due to 4K sectors which I
> probably have):
> 
>        start        size  index  contents
>            0           1         PMBR
>            1           1         Pri GPT header
>            2          32         Pri GPT table
>           34          30         
>           64  3907029071      1  GPT part - NetBSD RAIDFrame component
>   3907029135          32         Sec GPT table
>   3907029167           1         Sec GPT header


If you intend to boot from this (ffs @ gpt @ raidframe @ gpt @ disk),
you'll probably need this ugly duckling:

    Index: bootxx/boot1.c                             
    ===================================================================
    RCS file: /cvsroot/src/sys/arch/i386/stand/bootxx/boot1.c,v        
    retrieving revision 1.20                                   
    diff -u -r1.20 boot1.c  
    --- bootxx/boot1.c      6 Jan 2011 01:08:48 -0000       1.20
    +++ bootxx/boot1.c      30 Mar 2012 13:58:33 -0000          
    @@ -86,7 +86,7 @@                                 
             * (Maybe this should only be done if the filesystem
             * magic number is absent.)
             */
    -       bios_sector += RF_PROTECTED_SECTORS;
    +       bios_sector += RF_PROTECTED_SECTORS+34;
            fd = ob();
            if (fd != -1)
                    goto done;
    Index: lib/biosdisk.c     
    ===================================================================
    RCS file: /cvsroot/src/sys/arch/i386/stand/lib/biosdisk.c,v        
    retrieving revision 1.40                                   
    diff -u -r1.40 biosdisk.c
    --- lib/biosdisk.c      16 Jan 2012 18:47:57 -0000      1.40
    +++ lib/biosdisk.c      30 Mar 2012 13:58:33 -0000          
    @@ -760,7 +760,7 @@                               
            d->boff = d->part[partition].offset;

            if (d->part[partition].fstype == FS_RAID)
    -               d->boff += RF_PROTECTED_SECTORS; 
    +               d->boff += RF_PROTECTED_SECTORS+34;
                                                       
     #ifdef _STANDALONE
            bi_wedge.startblk = d->part[partition].offset;

while the offset in your case would be 64.  Should boot if your fs is on
raid level 1, won't boot in case of raid level 0.


Home | Main Index | Thread Index | Old Index