1

I set up a RAID 1 of 2 drives using mdadm on a Linux machine. What would happen if I – while the device is busy – disconnected one of the drives and then some time later reconnected it? Assume that the hardware doesn't break due to the drive being disconnected from power while busy.

  • Would the ongoing read and write operations just continue in any case (even if the drive I disconnected was the one the read operation was physically happening on as a read operation only requires the RAID software to access one drive)?
  • Would the RAID software automatically recognize the drive once I connected it again and write the newest data onto it, therefore automatically repairing the array?
    • If so, will the RAID software copy all of the data of the drive which wasn't disconnected to the one which was or just the changed data?
  • If I disconnected drive 1 first, changed some files, then disconnected drive 2, then reconnected drive 1, changed some files, and then reconnected drive 2, what would happen?
1

Operations should continue, with the disconnected drive kicked from the RAID. But if you're unlucky and the controller doesn't like it or something else jitters then you might be looking at a complete crash of the RAID instead.

RAID does not usually automatically repair kicked drives. You have to issue commands yourself, such as mdadm --re-add /dev/mdx /dev/sdy1. If you had a write intent bitmap then with some luck only the changed parts would be rewritten; otherwise it would do a full sync.

If both drives think they are the only valid, remaining drive in the RAID array — and the pulled drive, by itself, will think so because nothing will update its metadata after it got pulled, it needs the other drive to know of its own failure — you might suffer a split brain condition, a conflict you will have to resolve manually on your own, by looking at the files on each side and decide whether to pick one side or somehow mix the two.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.