Scan for new disk without rebooting Linux server

After you add a new disk on a Red Hat Linux server you can scan for the new disk without rebooting.

List the number of scsi host controllers

ls /sys/class/scsi_host
host0 host1 host2

Run this command to to scan each host0, host1 and host2

echo “- – -” /sysc/class/scsi_host/host0

Alternatively you can do all the above with this one line script

ls /sys/class/scsi_host/ | while read host; do echo “- – -“> /sys/class/scsi_host/$host/scan; done

About Andrew Lin

Hi, I have always wanted to creat a blog site but never had the time. I have been working in Information Technology for over 15 years. I specialize mainly in networks and server technologies and dabble a little with the programming aspects. Andrew Lin

View all posts by Andrew Lin →