Add a New Disk/Lun to RHEL5/CentOS5 without Rebooting

Ming Honestly I cannot believe that i have not put this one up on Fatmin before. I have to add new disks to RHEL servers all the time and can never remember I can never remember this procedure. I end up hitting up google all the time.

Anyway the command below causes a rescan of the scsi bus which is what you need to do for your server to detect a newly added disk. I find myself doing this on virtual machines all the time. Oh and for the love of all that is holy, please create your new disk a logical volume, and dont be lazy and just format the disk and stick a filesystem on it.

In this example I am using host0 as the target, however this may differ on your box.

echo “- – -” > /sys/class/scsi_host/host0/scan

One thought on “Add a New Disk/Lun to RHEL5/CentOS5 without Rebooting

  1. There’s an even easier way. You can download the Qlogic tools which have a script that will run a scsi scan on all scsi_hosts (assuming you have multiple paths when not dealing with vmware).
    http://driverdownloads.qlogic.com/QLogicDriverDownloads_UI/SearchByOs.aspx?ProductCategory=39&OsCategory=2&Os=65&OsCategoryName=Linux&ProductCategoryName=Fibre+Channel+HBAs&OSName=Linux+Red+Hat+%2864-bit%29
    Scroll down and download Linux Utilities.
    If you have emulex adapters, then you want to download the lun_scan.sh script.
    http://www.emulex.com/files/downloads/linux/linux_tools.html
    You will need the following packages for this to work:
    libnl (for more information, refer to http://www.infradead.org/~tgr/libnl/)
    sg3_utils (for more information, refer to http://sg.danny.cz/sg/sg3_utils.html
    elxlinuxapps-3.4a14-8.2.0.22-2-2.tar

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s