LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Raid 5 array messing around (https://www.linuxquestions.org/questions/linux-server-73/raid-5-array-messing-around-752955/)

viperuk 09-05-2009 04:35 PM

Raid 5 array messing around
 
I have a server running a raid 5 array. 2 SATA and 2 IDE drives. for some resin when one of the IDE drives seems to have stopped working, that is ok, but the problem is now that the second drive on the IDE interface seems to have excluded its self form the array perusal when i do a mdadm --detail /dev/md0 i get
Code:

/dev/md0:
        Version : 00.90
  Creation Time : Mon Aug 25 13:59:13 2008
    Raid Level : raid5
  Used Dev Size : 478126464 (455.98 GiB 489.60 GB)
  Raid Devices : 4
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Fri Sep  4 22:44:59 2009
          State : active, degraded, Not Started
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : e4b653bb:d10a5cef:399aafef:fdf3ae5e
        Events : 0.1639022

    Number  Major  Minor  RaidDevice State
      0      0        0        0      removed
      1      0        0        1      removed
      2      8        3        2      active sync  /dev/sda3
      3      8      19        3      active sync  /dev/sdb3

which shows both SATA drive working in the array but both IDE drives excluded but when I do mdadm --examine /dev/hdc3 wich is the remaining IDE drive that is working I get.
Code:

/dev/hdc3:
          Magic : a92b4efc
        Version : 00.90.00
          UUID : e4b653bb:d10a5cef:399aafef:fdf3ae5e
  Creation Time : Mon Aug 25 13:59:13 2008
    Raid Level : raid5
  Used Dev Size : 478126464 (455.98 GiB 489.60 GB)
    Array Size : 1434379392 (1367.93 GiB 1468.80 GB)
  Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

    Update Time : Fri Sep  4 13:43:08 2009
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
      Checksum : 4667a71c - correct
        Events : 1633875

        Layout : left-symmetric
    Chunk Size : 64K

      Number  Major  Minor  RaidDevice State
this    1      3      67        1      active sync

  0    0      3        3        0      active sync
  1    1      3      67        1      active sync
  2    2      8        3        2      active sync  /dev/sda3
  3    3      8      19        3      active sync  /dev/sdb3

which from what I can tell the drive is fine. hasnt been formatted or anything but is just not being included in the array. is there anyway to re-add it to the array without losing everything on it then I can replace the problem drive also. any help would be greatly appreciated

viperuk

esaym 09-06-2009 08:17 AM

Probably something like
mdadm --fail /dev/md0 /dev/hdc3
mdadm --remove /dev/md0 /dev/hdc3
mdadm --add /dev/md0 /dev/hdc3

esaym 09-06-2009 08:23 AM

If the array has been stopped already then you might have to force it to assemble with:
mdadm --assemble --force /dev/md0 /dev/hdc3 /dev/sda3 /dev/sdb3 (note that I left out the other ide drive, not sure if that is what you want or not...) Regardless of how many drives you list here, forcing assemble will only assemble the array with 3 of the 4 drives so you will still have to add the other drive before it will begin to resync.

Either way, after you are done with either adding the drive or assembling, you will have to fsck the filesystem to fix all of the errors induced by the broken array. With /dev/md0 NOT mounted:
e2fsck -f -D /dev/md0

Make sure to only run that after you have the array working right!

viperuk 09-07-2009 06:41 PM

I got it resolved, I had to include all 4 drives in the --assemble --force as every time I attempted with only 3 it was coming up saying there weren't enough drives to start the array. When I did build saying to use all 4 drives it only used the 3 good drives and then I replaced the faulty drive and was then able to resync the whole array.

although before I got as far as completing the rebuild I took a copy of any data that was available from the 3 drives to ensure I had a current backup just in case things went down hill again. I didnt like the --force command is why I turned here for an answer but now I have a bit more confidants and more understanding of mdadm

thank you for your help

viperuk


All times are GMT -5. The time now is 03:55 AM.