2 Replies - 1291 Views - Last Post: 16 April 2012 - 05:59 PM

#1 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Software raid (mdadm) won't reassemble after unplugging a drive

Posted 29 March 2012 - 12:13 PM

So I've successfully setup a software RAID 1 using mdadm across two hard drive partitions. Then just for kicks I decided to unplug one of the drives and see if the data was still fine. It was! Great, but then when I plugged in the drive again, it was first detected as /dev/sdc instead of what it used to be /dev/sdb. I didn't want to confuse my system so I decided to reboot, and it was picked up as /dev/sdb proper, but mdadm didn't seem willing to enter it back into the RAID.

I think it was telling me...
$  cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0]
      1464845671 blocks super 1.2 [2/1] [U_]  



I tried lots of stuff, but couldn't get it to be an 'active' [UU] raid again... stuff like...
$  mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1
mdadm: /dev/md0 assembled from 1 drive - need all 2 to start it (use --run to insist).



The bottom of my /etc/mdadm/mdadm.conf looked like this:
ARRAY /dev/md0 metadata=1.2 name=Mycomp:0 UUID=6e7efcee:e9bc12a6:cb210f4f:0f0b4736


Which I believe was generated by $ mdadm --detail --scan >> /etc/mdadm/mdadm.conf.


Now I'm re-mirroring the drives... (ughh, such a pain...) and starting over, to make sure it was originally a [UU] raid, and it seems like it is in fine condition, but now, how do I perform this 'drive unplugging' test and rebuild the array properly? Am I missing a step/ conf configuration?

Is This A Good Question/Topic? 0
  • +

Replies To: Software raid (mdadm) won't reassemble after unplugging a drive

#2 NotarySojac  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 53
  • View blog
  • Posts: 428
  • Joined: 30-September 10

Re: Software raid (mdadm) won't reassemble after unplugging a drive

Posted 03 April 2012 - 03:42 PM

I finally decided to just reattempt the test and the second time, it worked without a glitch. I'm not sure what could have caused it in the first place. I thought I was going to need to do something more technical like http://www.ducea.com...dm-cheat-sheet/ but that wasn't the case.
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,384
  • Joined: 10-May 07

Re: Software raid (mdadm) won't reassemble after unplugging a drive

Posted 16 April 2012 - 05:59 PM

Glad to see that you got this working!

In the past when I spanned a volume across multiple SCSI drives, if there was an unsuspected power outage that crashed the system, I would have to clean the file system on the drives before I could address them as a single block device. & with no block device, there is nothing to mount :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1