Rescan SCSI to add, remove SCSI device without rebooting

Posted In Storage, System - By Tum. On Monday, May 11th, 2009 With 0 Comments

To rescan an entire SCSI bus and re-register all devices found:
เมื่อต้องการ rescan SCSI ให้ระบบเห็น SCSI Device ตัวใหม่ ซึ่งการ rescan SCSI นั้นใน Linux บางตัวจะเป็นการ add หรือ remove device ด้วย
สำหรับ storage พวก Fibre ให้ใช้คำสั่งด้านล่างดังนี้

echo “1” > /sys/class/fc_host/host#/issue_lip

สำหรับ storage ทั่วไปใช้คำสั่ง แต่ก็สามารถใช้คำสั่งด้านบนได้เช่นกันแต่อาจจะเสียเวลาสำหรับการ rescan

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

# คือ เลขของ SCSI bus

สำหรับคำสั่งการ remove scsi device คือ

# echo 1 > /sys/block//device/delete
หรือ
# echo “scsi remove-single-device ” > /proc/scsi/scsi

และสำหรับคำสั่ง add scsi device คือ

# echo “scsi add-single-device ” > /proc/scsi/scsi

tip
การหา สามารถดูได้ที่ /sys (2.6 kernels) หรือ /proc/scsi/scsi หรือ dmesg

คำค้นยอดนิยม: remove scsi device linux

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*