Re: How to salvage a degraded mdadm RAID1 with as little data loss as possible?

Michel Verdier <[email protected]>
Newsgroups gmane.linux.debian.user
Message-ID <[email protected]>
On 2026-06-21, Paul Leiber wrote:

> I managed to rebuild the md RAID1 using the data on the seemingly failed
> device (partition_1). First, I did a dd dump of partition_2 (currently in
> usage) in order not to lose data. Then, I recreated the RAID1 using the data
> from partition_1:
>
> mdadm --stop /dev/md0 # This stops the degraded RAID1
> mdadm --assemble --update=uuid /dev/md0 /dev/mapper/partition_1 # This creates a new RAID1 using the partition_1, a new array UUID is required in order for --assembly to work
> mdadm --manage --add /dev/md0 /dev/mapper/partition_2 # This adds partition_2 to the RAID1, contents of partition_1 are replicated to partition_2 automatically

Your commands are strange : the partitions should be the disk partitions
from /dev and not mapped ones. Or you have another layer ? From where
come /dev/mapper/partition_1 and /dev/mapper/partition_2 ?

Beside this it is much quicker and safer to go this way :
- do not stop the md array (and thus the assemble is not needed)
- remove the failed partition
  mdadm --manage /dev/md0 --remove "failed partition"
- add the new clean partition
  mdadm --manage /dev/md0 --add "good partition"
- and let mdadm sync the array
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.