JP Vossen on 13 Jun 2011 21:01:25 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Hot-swapping Linux RAID1 (was Re: Computer case)

On 06/13/2011 12:51 PM, wrote:
Date: Mon, 13 Jun 2011 12:51:46 -0400
From: Julien Vehent<>

  I've never tried hot swapping sata drives used in a linux soft raid.
  Might be an interesting experience though:)

I have not tried this, but I'd *guess* that if you use 'mdadm' appropriately, it would be fine. YMMV!

	mdadm --manage $RAID --fail $DISK
	mdadm --manage $RAID --remove $DISK

After hot-swap:
	sfdisk -d $GOOD_DISK | sfdisk $BAD_DISK
	mdadm --manage $RAID --add $DISK

One of the tricks is to get "$RAID" & "$DISK" right. 'cat /proc/mdstat' can help. And you may need to loop though the mdadm commands if you've got multiples of anything.

See for more info.

Let us know if this works,  :-)
JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --