Log in

No account? Create an account

Josh-D. S. Davis

Xaminmo / Omnimax / Max Omni / Mad Scientist / Midnight Shadow / Radiation Master

Previous Entry Share Next Entry
Just for me.
Josh 201604 KWP

Hot-swapping with SCA
With SCA, it is possible to hot-plug devices. Unfortunately, this is not as simple as it should be, but it is both possible and safe.

Replace the RAID device, disk device, and host/channel/id/lun numbers with the appropriate values in the example below:

Dump the partition table from the drive, if it is still readable:

sfdisk -d /dev/sdb > partitions.sdb

Remove the drive to replace from the array:

raidhotremove /dev/md0 /dev/sdb1

Look up the Host, Channel, ID and Lun of the drive to replace, by looking in


Remove the drive from the bus:

echo "scsi remove-single-device 0 0 2 0" > /proc/scsi/scsi

Verify that the drive has been correctly removed, by looking in


Unplug the drive from your SCA bay, and insert a new drive

Add the new drive to the bus:

echo "scsi add-single-device 0 0 2 0" > /proc/scsi/scsi

(this should spin up the drive as well)

Re-partition the drive using the previously dumped partition table:

sfdisk /dev/sdb < partitions.sdb

Add the drive to your array:

raidhotadd /dev/md0 /dev/sdb2

The arguments to the "scsi remove-single-device" commands are: Host, Channel, Id and Lun. These numbers are found in the "/proc/scsi/scsi" file.