4

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?

1 Answer 1

3

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.

4
  • Hot-plugging is not supported by the hardware. Commented Aug 18, 2013 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
    Commented Aug 18, 2013 at 21:45
  • Will the bitmap be used then to speed the rebuild? Commented Aug 18, 2013 at 21:51
  • 1
    @MartinSchröder Yes, the bitmap should speed up rebuilding the array.
    – gypaetus
    Commented Aug 18, 2013 at 22:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .