If the second disk in your RAID-1 array has bad sectors, the system can still function, but it depends on the extent of the damage. Here’s an explanation of how RAID-1 works and how you can proceed:


How RAID-1 Handles Disk Issues

  1. RAID-1 Redundancy: In a RAID-1 setup, data is mirrored across two disks. If one disk fails or becomes unreliable, the system can continue operating with the remaining healthy disk.

  2. I/O Errors on One Disk:

    • If the installer reports I/O errors and “continues with just 1 disk,” it means the RAID array was created using the healthy disk only (degraded mode).
    • The second disk is excluded from the array because it failed to synchronize properly due to the bad sectors.

Future Disk Replacement

You can add another disk to the array later to restore redundancy. Here’s how:

Steps to Replace or Reintroduce a Disk:

  1. Replace the Faulty Disk:

    • Physically replace the bad disk with a new one, or if the current disk is still usable, repair it (e.g., using badblocks or a disk diagnostic tool).
  2. Partition the New Disk:

    • Ensure the new disk has the same partition layout as the healthy disk.
    • Use sfdisk to copy the partition table:
      sfdisk -d /dev/sda | sfdisk /dev/sdb
      
  3. Add the New Disk to the Array: Use the following mdadm command to re-add the disk to the array:

    mdadm --add /dev/md0 /dev/sdb2
    
  4. Resynchronize the Array: Once the new disk is added, the RAID array will start syncing automatically. You can monitor the progress:

    cat /proc/mdstat
    

Things to Keep in Mind

  • Performance Degradation: While the array is degraded (using only one disk), there is no redundancy. A failure of the remaining disk will result in data loss.

  • Using the Disk with Bad Sectors:

    • You may attempt to use the problematic disk, but this could lead to continued errors and slow performance.
    • Use smartctl to assess the health of the disk:
      smartctl -a /dev/sdb
      
    • Run badblocks to identify and map bad sectors (if they are not severe):
      badblocks -n -v /dev/sdb
      

Key Takeaways

  1. Your system will work with just one disk, but it won’t have redundancy until you replace or repair the second disk.
  2. A new disk can be added later, and the array can be resynchronized to restore RAID-1 functionality.
  3. Monitor the health of both disks regularly to ensure reliability.