LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software raid5, is it using 2 or 3 partitions?? (https://www.linuxquestions.org/questions/linux-software-2/software-raid5-is-it-using-2-or-3-partitions-754827/)

pingu 09-13-2009 10:46 AM

Software raid5, is it using 2 or 3 partitions??
 
My setup is 3 partitions for raid5, /dev/hda6 /dev/hdb1 /dev/sda2 (hdb1 is whole disk)
Creating /dev/md0 with mdadm:
Code:

edgar:~# mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/hda6 /dev/hdb1 /dev/sda2
seems to work fine, array is created.
After reboot only 2 partitions are used, /dev/sda2 is said to be faulty.
I remove sda2 and recreates it. Then add it to array:
Code:

edgar:~# mdadm /dev/md0 --add /dev/sda2
Reboot. What do I have now?

Code:

edgar:~# mdadm --detail /dev/md0/
dev/md0:
        Version : 00.90
  Creation Time : Sun Sep 13 13:37:07 2009
    Raid Level : raid5
    Array Size : 27358464 (26.09 GiB 28.02 GB)
  Used Dev Size : 13679232 (13.05 GiB 14.01 GB)
  Raid Devices : 3
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sun Sep 13 17:38:06 2009
          State : clean, degraded
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : d7dee44c:7886fe78:0a872d5f:65630445
        Events : 0.562

    Number  Major  Minor  RaidDevice State
      0      3        6        0      active sync  /dev/hda6
      1      3      65        1      active sync  /dev/hdb1
      2      0        0        2      removed

Code:

edgar:~# mdadm --examine /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 00.90.00
          UUID : d7dee44c:7886fe78:0a872d5f:65630445
  Creation Time : Sun Sep 13 13:37:07 2009
    Raid Level : raid5
  Used Dev Size : 13679232 (13.05 GiB 14.01 GB)
    Array Size : 27358464 (26.09 GiB 28.02 GB)
  Raid Devices : 3
  Total Devices : 3
Preferred Minor : 0

    Update Time : Sun Sep 13 14:12:31 2009
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0
      Checksum : ffa6da05 - correct
        Events : 14

        Layout : left-symmetric
    Chunk Size : 64K

      Number  Major  Minor  RaidDevice State
this    2      8        2        2      active sync  /dev/sda2

  0    0      3        6        0      active sync  /dev/hda6
  1    1      3      65        1      active sync  /dev/hdb1
  2    2      8        2        2      active sync  /dev/sda2

See? Examinig sda2 and it's said to be active in the array. 3 raid devices, 3 used.
Looking at detail for /dev/md0 it is not. 3 raid devices but only 2 used.
What is true?? Where did I go wrong?

erbngeek 09-30-2009 08:30 PM

Just a wild guess, but is /dev/sda2 an external USB drive? I tried to do this once with external USB drives, but had many intermittent problems. Ultimately I think the array is being initialized before the sda2 drive. Since RAID 5 can lose a drive and still operate, it loads but in a degraded state.

Perhaps you can disable auto raid until after the sda appears then manually (through a local script) assemble it so it doesn't have to rebuild each time.

pingu 10-01-2009 02:21 AM

No USB-drive, all disks are internal - 2 ide & 1 sata.
You could be right, maybe the sata-drive is initialized after raid. I'll check that when I get home, thanks!


All times are GMT -5. The time now is 06:34 AM.