SCSI HOWTO

Various recipies for SCSI maintenance.

Hot Swap SCSI

This is only supported on a machine with Hot Swap SCSI bays.

  • Unmount all volumes on the drive and/or remove it from RAID configurations and/or stop swap.
  • Tell linux that the device is gone. You need to know the following.
    • Host Adapter number (first is zero)
    • SCSI channel (first is zero)
    • SCSI ID (normally 0 through 7)
    • SCSI LUN (normally 0)
  • You can view the current SCSI devices with the following command.
  # cat /proc/scsi/scsi
  • You can find out where Linux mounted your disk with the following command.
  # dmesg | grep 'Attached scsi disk'
  Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
  Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
  Attached scsi disk sdc at scsi0, channel 0, id 2, lun 0
  Attached scsi disk sdd at scsi0, channel 0, id 3, lun 0
  • Use the following command, but replace A with the adapter number, C with the channel number, I with the SCSI ID and L with the LUN.
  # echo "scsi remove-single-device A C I L" >/proc/scsi/scsi
  • You can verify that the drive is gone by checking /proc/scsi/scsi.
  # cat /proc/scsi/scsi
  • Now pull out the drive and replace it. Once the new drive has been installed, tell Linux.
  # echo "scsi add-single-device A C I L" >/proc/scsi/scsi

If all goes well, you can now repartition and mount the replacement drive.

 
howto/scsi.txt · Last modified: 2006/07/05 19:40 by dpotter