I have a software RAID5 array (Linux md) on 4 disks; the OS is OpenSUSE 12.3.

Recently I replaced a disc with a larger one (fail disc, remove it, add new disc). The capacity of the array has not yet increased as I didn't replace all discs. Now the new one seems to be bad and I want to replace it with the old one. Can I simply remove the new one (fail, remove) and replace it with the unchanged old one or should I format the old one before adding it to the array? The array has a bitmap.

What would happen if I simply shut down the machine and replaced the discs without using mdadm?


If the bitmap has not changed when the old disk was replaced by the new one, it should work to mark the disk as failed and remove it from the array.

mdadm -f /dev/md0 /dev/sda1
mdadm -r /dev/md0 /dev/sda1

Then replace the disk and add the old one to the array:

mdadm --add /dev/md0 /dev/sde1

I think that shutting down the machine and replacing the disks would also work, but the mdadm method has the advantage that the disks can be hot-plugged if supported by the machine.

| improve this answer | |
  • Hot-plugging is not supported by the hardware. – Reinstate Monica - M. Schröder Aug 18 '13 at 21:29
  • @MartinSchröder I think it will be safer to remove the disk using mdadm, then add the old disk and let the array rebuild itself. – gypaetus Aug 18 '13 at 21:45
  • Will the bitmap be used then to speed the rebuild? – Reinstate Monica - M. Schröder Aug 18 '13 at 21:51
  • @MartinSchröder Yes, the bitmap should speed up rebuilding the array. – gypaetus Aug 18 '13 at 22:15

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.