Home > HP, Linux > How to rescan the SCSI bus in Linux

How to rescan the SCSI bus in Linux

You are in front of a Linux box, a VM really, with a bunch of new disks that must be configured and suddenly you remember that there is no ioscan in Linux, you will ask yourself ‘who is so stupid to create an operative system wihtout ioscan?’ at  least I did x-)

Yes it is true, there is no ioscan in Linux and that means that everytime you add a new disk to one of your virtual machine you have to reboot it, at least technically that is the truth. But don’t worry there is a quick and dirty way to circumvent that.

From a root shell issue the following command:

[root@redhat ~]# echo "- - -" > /sys/class/scsi_host/<host_number>/scan

After that if you do a fdsik -l will see the new disks.

If you want to rescan your box for new fiber channel disks the command is slightly different.

[root@redhat ~# echo "1" > /sys/class/fc_host/host#/issue_lip

For the fiber channel part there are also third party utilities. HP for example provides hp_rescan which comes with the Proliant Support Pack.

[root@redhat /]# hp_rescan -h
hp_rescan: rescans LUNs on HP supported FC adapters
Usage: hp_rescan -ailh[n]

-a: rescan all adapters
-i: rescan a specific adapter instance. The specific device should be a
 SCSI host number such as "0" or "6"
-l: lists all FC adapters
-n: do not perform "scsi remove-single-device" when executing probe-luns
-h: help
[root@redhat /]#

If you know other ways to rescan the SCSI bus in a Linux server please comment :-)

Juanma.

About these ads
Categories: HP, Linux Tags: , ,
  1. April 17, 2012 at 15:19 | #1

    On Debian Linux, the scsitools provides the script /sbin/rescan-scsi-bus.sh

    • April 17, 2012 at 15:48 | #2

      Hi Yves! Thanks for the info, didn’t know debian had such script :-)

  2. January 8, 2013 at 05:21 | #3

    This really is the fourth article, of yours I browsed. But yet I really like this specific one, “How
    to rescan the SCSI bus in Linux Juanma’s Blog” the very best. All the best ,Liam

  3. De Hur
    January 10, 2013 at 15:59 | #4

    On RedHat, the “sg3_utils” provides the “scsi-rescan” command.

  4. April 27, 2013 at 09:30 | #5

    If people want to purchase any product so all the detail
    is given on website. You can decide on to have in some thing alluring.
    When you find yourself a woman, how to gown is a tiny
    little extra complicated. The linings are associated with
    the interior red suede. http://protector.wakfu.
    free.fr/member.php?action=profile&uid=3654

  5. April 27, 2013 at 11:24 | #6

    I got this website from my friend who shared with me on the topic of this
    web page and now this time I am browsing this web page and reading very informative posts here.

  1. October 30, 2010 at 05:53 | #1

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 157 other followers

%d bloggers like this: