{"id":3140,"date":"2014-06-15T02:25:15","date_gmt":"2014-06-14T18:25:15","guid":{"rendered":"http:\/\/rmohan.com\/?p=3140"},"modified":"2014-06-15T02:25:15","modified_gmt":"2014-06-14T18:25:15","slug":"scan-for-new-scsi-device-to-detect-new-lun-without-reboot-centos","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3140","title":{"rendered":"Scan for New Scsi Device to Detect New Lun Without Reboot -Centos"},"content":{"rendered":"<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">This will scan the scsi host and no need to reboot to make devices(luns) visible.<\/p>\n<blockquote style=\"background: #f5f5f5; font: 14.28px\/21px Arial, Helvetica, sans-serif; margin: 0px 0px 15px; padding: 15px 15px 1px; border: 1px solid #e5e5e5; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; display: block; white-space: normal; -webkit-text-stroke-width: 0px;\">\n<p style=\"margin-top: 0px; margin-bottom: 15px;\">echo \u201c- &#8211; -\u201d &gt; \/sys\/class\/scsi_host\/host#\/scan<\/p>\n<\/blockquote>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">Verify<\/p>\n<blockquote style=\"background: #f5f5f5; font: 14.28px\/21px Arial, Helvetica, sans-serif; margin: 0px 0px 15px; padding: 15px 15px 1px; border: 1px solid #e5e5e5; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; display: block; white-space: normal; -webkit-text-stroke-width: 0px;\">\n<p style=\"margin-top: 0px; margin-bottom: 15px;\">fdisk -l<br \/>\ntail -f \/var\/log\/message<\/p>\n<\/blockquote>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">Replace host# with actual value such as host0. You can find scsi_host value using the following command<\/p>\n<blockquote style=\"background: #f5f5f5; font: 14.28px\/21px Arial, Helvetica, sans-serif; margin: 0px 0px 15px; padding: 15px 15px 1px; border: 1px solid #e5e5e5; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; display: block; white-space: normal; -webkit-text-stroke-width: 0px;\">\n<p style=\"margin-top: 0px; margin-bottom: 15px;\"># ls \/sys\/class\/scsi_host<\/p>\n<\/blockquote>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">Now type the following to send a rescan request:<\/p>\n<blockquote style=\"background: #f5f5f5; font: 14.28px\/21px Arial, Helvetica, sans-serif; margin: 0px 0px 15px; padding: 15px 15px 1px; border: 1px solid #e5e5e5; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; display: block; white-space: normal; -webkit-text-stroke-width: 0px;\">\n<p style=\"margin-top: 0px; margin-bottom: 15px;\">echo \u201c- &#8211; -\u201d &gt; \/sys\/class\/scsi_host\/host0\/scan<\/p>\n<\/blockquote>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\"><strong>Can devices be rescanned in Linux OS without reloading the Linux driver?<\/strong><\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">A new LUN was added to the storage, but the LUN cannot be seen by the driver or the OS. Rebooting or reloading the driver would be too disruptive.<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\"><strong>Answer<\/strong><\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">There is a procedure which forces the driver to rescan the targets to allow a new device to be added. This triggers the driver to initiate a LUN discovery process.<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">To force a rescan from the command line, type the following command<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\"># echo \u201cscsi-qlascan\u201d &gt; \/proc\/scsi\/\/<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">Where:<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">&#8211; = qla2100, qla2200, qla2300 (2.4 kernel drivers) or qla2xxx (2.6 kernel drivers)<br \/>\n&#8211; = the instance number of the HBA<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">After executing this command, force the SCSI mid layer to do its own scan and build the device table entry for the new device by typing the following command<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\"># echo \u201cscsi add-single-device 0 1 2 3? &gt;\/proc\/scsi\/scsi<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">Where:<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">&#8211; \u201c0 1 2 3? = your \u201cHost Channel ID LUN\u201d<\/p>\n<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">The scanning must be done in the above mentioned order: first the driver (qla2300\/qla2200 driver, etc.), and then the Linux SCSI mid layer (i.e. OS scan).<\/p>\n<p><span style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">&#8211; See more at: http:\/\/linoxide.com\/how-tos\/linux-scan-scsi\/#sthash.CUZ4SYF6.dpuf<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p style=\"font: 14.28px\/21px Arial, Helvetica, sans-serif; text-align: left; color: #666666; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 0px; margin-bottom: 15px; word-spacing: 0px; white-space: normal; background-color: #cbe4fe; -webkit-text-stroke-width: 0px;\">This will scan the scsi host and no need to reboot to make devices(luns) visible.<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 15px;\">echo \u201c- &#8211; -\u201d &gt; \/sys\/class\/scsi_host\/host#\/scan<\/p>\n<p style=\"font: 14.28px\/21px [...] \n\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3140"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3140"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3140\/revisions"}],"predecessor-version":[{"id":3142,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3140\/revisions\/3142"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}