Loading...
 

RAID Maintenance Procedures

Repairing Broken Sectors

  1. Mark the device as failed in the array
    mdadm <raid dev> -f <problem device>
  2. Remove the failed device from the array
    mdadm <raid dev> -r <problem device>
  3. Make the drive read all its sectors to detect all the problems
    dd if=<problem device> of=/dev/null conv=noerror
  4. With the problems known to the drive, erase all its data so it can do sector re-mapping
    dd if=/dev/zero of=<problem device> bs=8192
  5. Verify the drive has no bad sectors now
    smartctl -t long <problem device>
  6. Wait for test completion
    smartctl -l selftest <problem device>
  7. Re-create the partition table
    parted <known good RAID member> unit s print  # Learn what a correct geometry looks like
    parted <problem device> mklabel gpt mkpart primary <start>s <end>s  # Configure the correct geometry
  8. Make sure the system is aware of the newly created partition
    partprobe <problem device>
  9. Add the device into the array
    mdadm <raid dev> -a <problem device>
  10. Monitor RAID rebuild progress
    cat /proc/mdstat

Forcing Drive Detection

  1. You have to know which SCSI host (bus) to scan, but once that is known:
    echo "- - -" > /sys/class/scsi_host/host#/scan