Koozali.org: home of the SME Server

Mdadm + Raid5 + Spare - replacing disks

Offline Brave Dave

  • *
  • 185
  • +0/-0
Mdadm + Raid5 + Spare - replacing disks
« on: April 08, 2016, 12:11:45 AM »
I have a Server - SME9 / 4 Disks / Raid5 3 Active - 1 Spare

This is the older config, to get this build SME as a Raid5 on 3 disks then add the 4th

If you have been around servers for a while you can usually feel if something is not quite right, SMART produces an error or dmesg gives a hint - you wind up feeling one hard drive is going to fail - but it hasn't .. yet.

And it's active - not the spare

To move it out I use:
  • mdadm --manage /dev/md1 --fail /dev/sdc2
  • wait for the raid to build onto the spare
  • mdadm --manage /dev/md1 --remove /dev/sdc2
  • shutdown, replace hard disk
  • partition etc. etc
  • mdadm --manage /dev/md1 --add /dev/sdc2
  • etc. etc

during step 2, your array is degraded and - if one of the good disks fails it's goodnight - and that happened - and I lost the machine

of course you can do due diligence - i.e. smartctl -t long [all your disks], done that

so the question
if your config is: md1 : active raid5 sdc2[3](S) sdd2[4] sdb2[5] sda2[0]

is there a command to change the config to md1 : active raid5 sdc2[3] sdd2[4](S) sdb2[5] sda2[0]
which doesn't degrade the array during the process ?



.:DB:.