Linux 掃描儲存設備而不重開機

先看一下是哪個設備要重新掃描

# ls /sys/class/scsi_host
host0 host1 host2 host3 host4 host5 host6

然後用 lsscsi 指令查看是哪個設備要重新掃描

# lsscsi
[0:0:0:0] disk SEAGATE ST9600204SS FM09 –
[0:0:1:0] disk SEAGATE ST9600204SS FM09 –
[0:1:0:0] disk Dell Virtual Disk 1028 /dev/sda
[1:0:0:0] cd/dvd PLDS DVD-ROM DS-8D3SH HD51 /dev/sr0
[3:0:0:0] disk iDRAC LCDRIVE 0323 /dev/sdb
[4:0:0:0] cd/dvd iDRAC Virtual CD 0323 /dev/sr1
[4:0:0:1] disk iDRAC Virtual Floppy 0323 /dev/sdd
[5:0:0:0] disk IFT DS S16F-G2840-4 388A /dev/sdc
[5:0:0:1] enclosu IFT DS S16F-G2840-4 388A –
[6:0:0:0] disk IFT DS S16F-G2840-4 389E /dev/sde

假設我要對 host6 重新掃描,就使用下列指令

# echo “- – -” > /sys/class/scsi_host/host6/scan

如果設備斷線然後又重新連上了,還可以用下列指令重整

# echo 1 > /sys/class/scsi_device/6\:0\:0\:0/device/rescan

這樣就不用重新開機了

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.