cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: ST3250310NS Rev: MA07
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: ATA Model: WDC WD2003FZEX-0 Rev: 1A01
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: ATA Model: ST2000DM001-1ER1 Rev: CC25
Type: Direct-Access ANSI SCSI revision: 05
Then find the associated letter:
ls -ld /sys/block/sd*/device
lrwxrwxrwx 1 root root 0 Oct 31 13:47 /sys/block/sda/device -> ../../../0:0:0:0
lrwxrwxrwx 1 root root 0 Oct 31 13:47 /sys/block/sdb/device -> ../../../0:0:1:0
lrwxrwxrwx 1 root root 0 Oct 31 13:47 /sys/block/sdc/device -> ../../../0:0:2:0
Just match Channel and Id
echo "- - -" > /sys/class/scsi_host/hostxxx/scan
echo 1 > /sys/class/scsi_device/device/rescan
echo 1 > /sys/block/$DISK/device/delete
echo offline > /sys/block/$DISK/device/state