Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-03-2007, 04:45 PM   #1
Registered: Feb 2007
Posts: 32

Rep: Reputation: 15
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:
  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:
Old 06-03-2007, 05:04 PM   #2
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
you need to remove the failed/missing device with mdadm first and the re-add it to start the rebuild/sync.
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

mdadm --manage /dev/md0 --fail /dev/sdc
Old 06-04-2007, 02:12 AM   #3
Registered: Feb 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks a LOT!
That did it.

Actually I got a
hot remove failed for /dev/sdc No such device or address
first, which brought me to

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
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
sudo fdisk -l /dev/sdb
Disk /dev/sdb doesn't contain a valid partition table

Last edited by isync; 06-04-2007 at 02:36 AM.


linux, mdadm, raid, software, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 10:40 AM
Dirty "RAID"-array in linear mode after hdd went offline tomas412 Linux - Software 1 08-14-2004 11:12 AM
does failed using urpmi messed up my "Install Software" / "mandrake update" ??? sirpelidor Mandriva 1 11-02-2003 10:00 PM

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration