Sunday, 8 January 2023

Replacing A Failed Disk in a software Raid 1 array

 2 Disk array, /dev/sda & /dev/sdc where /dev/sdc has failed.

  • Mark disk as failed 
    • # mdadm --manage /dev/md0 --fail /dev/sdc1

  • Remove disk from array  
    • # mdadm --manage /dev/md0 --remove /dev/sdc1

  • Remove physical disk


  • Copy partition table from working disk 
    • # sfdisk -d /dev/sda | sfdisk /dev/sdc

  • Add disk to mirror 
    • # mdadm --manage /dev/md0 --add /dev/sdc1

  • Verify & check on rebuild status
    • # mdadm --detail /dev/md0
    • # cat /proc/mdstat

No comments:

Post a Comment