On 24.02.2013 17:15, Manuel Bouyer wrote:
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 wd3You 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.
Oh Sorry, thats right. dd if=/dev/zero of=/dev/wd3d ^C7769+0 records in 7768+0 records out 3977216 bytes transferred in 3.081 secs (1290884 bytes/sec)
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.
I want to use gpt, if possible, my size is 2TB How do we create a raid partition, like: spectre# gpt show wd3d start size index contents 0 3907029168 spectre# gpt create wd3d spectre# gpt add -t gpt wd3d usage: gpt add [-b lba] [-i index] [-s lba] [-t type] device ... spectre# gpt add -t raid wd3d Partition added, use: dkctl wd3d addwedge <wedgename> 34 3907029101 <type> to create a wedge for itAnd now should I dkctl wd3d and copy dkX in my raid1.conf or should I use wd3d?