tech-kern archive

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

Re: Setting up raid correctly



On 24.02.2013 15:32, Manuel Bouyer wrote:
On Sun, Feb 24, 2013 at 03:58:18PM +0000, Philip Mueller wrote:
This sounds good, but how should I mount /dev/wd3 to read the data
on this storage? Should I dkctl /dev/wd3?
I can not mount wd3 regular, there is no partition shown on it:
$raidctl -uv raid1 && gpt show wd3d
        start        size  index  contents
            0  3907029168
This is my main problem: When I create a raid and in there a
partition as gpt + newfs, I cannot mount this partition without
raid.
You have to create a partition on wd3, and mount this partition.

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
Partition added, use:
        dkctl wd3 addwedge <wedgename> 34 3907029101 <type>
to create a wedge for it
spectre# dkctl wd3 addwedge dk0 34 3907029101 ffs
dk0 created successfully.
spectre# newfs -O2 /dev/rdk0
/dev/rdk0: 1907729.0MB (3907029096 sectors) block size 32768, fragment size 4096
        using 2570 cylinder groups of 742.31MB, 23754 blks, 46848 inodes.
super-block backups (for fsck_ffs -b #) at:
192, 1520448, 3040704, 4560960, 6081216, 7601472, 9121728, 10641984, 12162240,
...............................................................................
mount /dev/dk0 /mnt
spectre# df -h
/dev/dk0           1.8T       4.0K       1.7T   0% /mnt
wd3 is now mounted, fine , but we have no raid1.
Now creating the raid:
spectre# umount /dev/dk0
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

Then I Have a raid, which I ca'nt mount yet:
spectre# gpt show raid1
       start        size  index  contents
           0  3907028959
  3907028959          32         Sec GPT table
  3907028991           1         Sec GPT header
This is a dilemma:
1.) If I destroy this raid, I can mount wd3 regular. But I can not mount this raid to create some data on it 2.) If I create a new gpt table with newfs on raid1, I can mount it and read/write some data on it. But after destroying this raid, I can't mount wd3 to read data.

What do I wrong?


Home | Main Index | Thread Index | Old Index