LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How do I resync a "dirty" software raid1? (https://www.linuxquestions.org/questions/linux-server-73/how-do-i-resync-a-dirty-software-raid1-558876/)

isync 06-03-2007 03:45 PM

How do I resync a "dirty" software raid1?
 
I have a software raid 1 array here, consiting of two drives:
sudo mdadm --create /dev/md0 -a -l 1 -n 2 /dev/sdb /dev/sdc

To test it I pulled out one disk, made changes to the ramining disk and then plugged back in the other drive.

I ended up with:
Code:

  md0 : active raid1 sdb[0] sdc[2](F)
      488386496 blocks [2/1] [U_]

Which - as it seems - the system does not automatically resync. Now, how do I tell the system to re-accept the reappeared drive sdc and sync it up with sdb?

For further description of my problem and how I ran into it, please read: http://www.linuxquestions.org/questi...59#post2769659

rtspitz 06-03-2007 04:04 PM

you need to remove the failed/missing device with mdadm first and the re-add it to start the rebuild/sync.
Code:

mdadm --manage /dev/md0 --remove /dev/sdc
mdadm --manage /dev/md0 --add /dev/sdc

you could have tested it without actually pulling a disk. mdadm can "software-fail" a device with

Code:

mdadm --manage /dev/md0 --fail /dev/sdc

isync 06-04-2007 01:12 AM

Thanks a LOT!
That did it.

Actually I got a
Code:

hot remove failed for /dev/sdc No such device or address
first, which brought me to http://www.mail-archive.com/linux-ra.../msg01930.html.

As it seems re-booting/waiting during the process made mdadm remove the drive completely from the array during the process. So, when I tried to "--remove" it, it was in fact already gone. So
Code:

sudo mdadm /dev/md0 -a /dev/sdc
did the trick!

And when resync was slow (7000min! on a non-production machine) I did "sudo -s -H" to circumvent the ubuntu “permission denied” problem and then "echo 50000 >/proc/sys/dev/raid/speed_limit_min" - and instantly I was down to 240min.



Now my last question: Should I worry about fdisk giving
Code:

sudo fdisk -l /dev/sdb
...
...
Disk /dev/sdb doesn't contain a valid partition table



All times are GMT -5. The time now is 04:49 PM.