2

I have a home raid1 with 2 disks and one of them just failed (lightning strike on the house). I'm really unfamiliar with mdadm so I'm asking before doing anything stupid. I can hot-plug a new HD on sdd (it's safe, I do my backups this way), but what are the commands to add the new disk to the raid and rebuild it ?

I've already done the following to remove the dead disk and keep using the read in read-only and it works:

# mdadm --manage /dev/md0 --fail /dev/sda1
# mdadm --manage /dev/md0 --remove /dev/sda1
# mdadm --assemble --readonly /dev/md0 /dev/sdb1

My mdadm.conf:
ARRAY /dev/md0 metadata=1.2 name=penguin:0 UUID=89ec9aaf:745ed728:87e2211a:22ea2fae

My fstab:
/dev/md0 /raid ext4 noatime,relatime 0 0
1
  • Yes, I backup my raid by hot-plugging a drive and running an rsync script before moving it back off-location. Still, I'd like to know how to add a new drive now !
    – dargaud
    Commented Aug 29, 2022 at 10:17

1 Answer 1

1

I found a very concise description here: https://www.thegeekdiary.com/replacing-a-failed-mirror-disk-in-a-software-raid-array-mdadm/

It breaks down to:

# sfdisk -d /dev/sdb | sfdisk /dev/sdd
# mdadm --manage /dev/md0 --add /dev/sdd1

Then it starts rebuilding

You must log in to answer this question.

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