Julien Vehent on 14 Jun 2011 04:37:44 -0700

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

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

On Tue, 14 Jun 2011 00:01:18 -0400, JP Vossen wrote:
On 06/13/2011 12:51 PM, plug-request@lists.phillylinux.org wrote:
Date: Mon, 13 Jun 2011 12:51:46 -0400
From: Julien Vehent<julien@linuxwall.info>

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 http://www.kernelhardware.org/replacing-failed-raid-drive/ for more info.

Let us know if this works,  :-)

I didn't know of 'sfdisk', that was the missing piece: dumping the partitions table and recreating it on the new drive. With that, I don't know why it wouldn't work. I will give it a shot with a spare drive (that doesn't have the same geometry) and let you know.

I traded my 2*3.5" for 2*3.5", both 500GB and 7200rpm as well, for just $10 difference per drive. Not too bad of a deal :) However, it seems that the small drives consume as much as the big one. I was expecting some saving there.


Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug