[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hot swapping failed disk /dev/sda in RAID 1 array



Peter Ludikovsky <peter@ludikovsky.name> writes:

> Ad 1: Yes, the SATA controller has to support Hot-Swap. You _can_ remove
> the device nodes by running
> # echo 1 > /sys/block/<device>/device/delete

Thanks, I have now my RAID array fully working again.  This is what I
have done:

1. Like you suggested above I deleted the drive (/dev/sda* and entries
   in /proc/partitions)

        echo 1 > /sys/block/sda/device/delete

2. Hotplug-added the new drive.  Obviously, my controller doesn't
   support or isn't configured to notify the kernel.  Using Google I
   found the command the have the kernel rescan for drives:

        echo "- - -" > /sys/class/scsi_host/host0/scan

3. The rest is straight-forward:

        fdisk /dev/sda          [Add partition /dev/sda1 with type 0xfd]
        mdadm /dev/md0 --add /dev/sda1
        update-grub

Now, everything is up again and both drives synced, without reboot:

        # cat /proc/mdstat 
        Personalities : [raid1] 
        md0 : active raid1 sda1[2] sdb1[1]
              1953381376 blocks super 1.2 [2/2] [UU]
              bitmap: 1/15 pages [4KB], 65536KB chunk
        
        unused devices: <none>
        # uptime
         11:49:01 up 106 days, 22:44, 23 users,  load average: 0.13, 0.19, 0.15

I only wonder if it's normal that the drives are numbered 2 and 1
instead of 0 and 1.        

> Ad 2: Depends on the controller, see 1. It might recognize the new
> drive, or not. It might see the correct device, or not.

Next time I reboot the machine I will check whether there are any BIOS
settings to make the controller support hot-plugging.

urs


Reply to: