#linux #mdamd #raid

Add a drive to raid1

  1. First get information about the raid array:

    cat /proc/mdstat
  2. Then get information about the drive you’re going to add

    fdisk -l /dev/DISK_TO_ADD
  3. If there are any partitions, delete them and create a one new primary partition with type fd – Auto RAID Add the prepared drive to the array:

    mdadm --add  /dev/RAID /dev/DISK_TO_ADD
  4. And expand it:

    mdadm --grow /dev/RAID --raid-devices= N+1
    # N - the number of drives in the raid array before the expansion
  5. Seat comfortable and watch the raid being rebuilded:

    watch cat /proc/mdstat