tech-kern archive

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

Re: Setting up raid correctly



On Sun, Feb 24, 2013 at 05:36:20PM +0000, Philip Mueller wrote:
> On 24.02.2013 16:11, Manuel Bouyer wrote:
> >On Sun, Feb 24, 2013 at 05:00:07PM +0000, Philip Mueller wrote:
> >>If I partition wd3 single, then I can't setup a raid1 on it.
> >>Because:
> >>spectre# dd if=/dev/zero of=/dev/wd3d
> >>^C8457+0 records in
> >>8456+0 records out
> >>4329472 bytes transferred in 3.467 secs (1248766 bytes/sec)
> >>spectre#gpt show wd3
> >>        start        size  index  contents
> >>            0  3907029168
> >>spectre#gpt create wd3
> >>spectre# gpt add -t ffs wd3
> >You didn't understand what I wrote. You have to create the partition on wd3
> >*after* setting up the raid1 and creating the filesystem on it.
> >The start of the partition on wd3 has to match the location of the ffs
> >on raid1, shifted by the raid1 metadata, which, I think, is 128 sectors.
> >Also, you may have to create a raid-type partition on wd3 so that
> >the partition table on wd3 and the raid1 metadata don't overwrite each other.
> >This means you'll have 2 overlapping partitions on wd3, one to be used by
> >raid1 and another one to be used to mount the ffs.
> >
> Ok, this is a little much for me.
> Can we take this step by step?
> 1.) undo all configurations
> spectre# raidctl -uv raid1
> spectre# gpt destroy wd3d
> spectre# dd if=/dev/zero of=/dev/wd3
> ^C408832+0 records in
> 408831+0 records out
> 209321472 bytes transferred in 5.371 secs (38972532 bytes/sec)

I think you createed a 209321472 byte regular file /dev/wd3 here,
you didn't clear the wd3 partition table as intended. To write to
the drive, use /dev/wd3d.

> 
> 1.) wd3 is empty, now create raid1 on empty wd3
> spectre# raidctl -C /etc/raid1.conf raid1
> spectre# label=`date +%Y%m%d%H%M`
> spectre# raidctl -I $label raid1
> spectre# raidctl -i raid1
> Initiating re-write of parity
> 
> Is this right so?

No, I think you first have to create a partition of type raid on wd3, 
instead of using the whole disk. If your disk is less than 2TB, it may
be easier to use disklabel instead of gpt.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index