有时我们需要为在线系统添加热插拔的SCSI硬盘,此时我们不能停机,可以以下指令将新的硬盘加入系统中
# echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi // 添加硬盘
# echo "scsi remove-single-device 0 0 1 0" > /proc/scsi/scsi // 删除硬盘
对于指令中的四个数字分别表示scsi号、Channel号、Id号和LUN号 我们可以通过下述指令查看系统内SCSI硬盘的这些信息
# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00 // 四位数字的含义
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 03 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 04 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access