{"id":2316,"date":"2014-10-26T23:08:54","date_gmt":"2014-10-26T22:08:54","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=2316"},"modified":"2025-08-11T07:24:26","modified_gmt":"2025-08-11T05:24:26","slug":"linux-how-to-rescan-for-new-luns-on-a-emulex-fc-controller","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/linux-how-to-rescan-for-new-luns-on-a-emulex-fc-controller\/","title":{"rendered":"Linux: How to rescan for new LUNs on a Emulex FC Controller"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_2316 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_2316')){$('.twoclick_social_bookmarks_post_2316').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Linux%3A%20How%20to%20rescan%20for%20new%20LUNs%20on%20a%20Emulex%20FC%20Controller\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Arescan%20for%20new%20LUNs%20on%20a%20Emulex%20Fibre%20Channel%20Controller%3A%0D%0A%0D%0AList%20all%20HBAs%0D%0A%5Bshell%5D%20root%40debdev%20%23%20ls%20-l%20%2Fsys%2Fclass%2Ffc_host%0D%0Alrwxrwxrwx%201%20root%20root%200%20Oct%2024%2012%3A22%20host10%20-%26gt%3B%20..%2F%0D%0Alrwxrwxrwx%201%20root%20root%200%20Oct%2024%2012%3A22%20host11%20-%26gt%3B%20..%2F%0D%0Alrwxrwxrwx%201%20root%20root%200%20Oct%2024%2012%3A22%20host7%20-%26gt%3B%20..%2F.%0D%0Alrwxrwxrwx%201%20root%20root%200%20Oct%2024%2012%3A22%20host9%20-%26gt%3B%20..%2F.%0D%0A%5B%2Fshell%5D%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/linux-how-to-rescan-for-new-luns-on-a-emulex-fc-controller\\\/\",\"post_id\":2316,\"post_title_referrer_track\":\"Linux%3A+How+to+rescan+for+new+LUNs+on+a+Emulex+FC+Controller\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>rescan for new LUNs on a Emulex Fibre Channel Controller:<\/p>\n<p>List all HBAs<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # ls -l \/sys\/class\/fc_host\r\nlrwxrwxrwx 1 root root 0 Oct 24 12:22 host10 -&gt; ..\/\r\nlrwxrwxrwx 1 root root 0 Oct 24 12:22 host11 -&gt; ..\/\r\nlrwxrwxrwx 1 root root 0 Oct 24 12:22 host7 -&gt; ..\/.\r\nlrwxrwxrwx 1 root root 0 Oct 24 12:22 host9 -&gt; ..\/.\r\n<\/pre>\n<p><!--more--><br \/>\nStart a rescan for new LUNs on a HBA(means real FC Ports not Adapters)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # echo &quot;1&quot; &gt; \/sys\/class\/fc_host\/host10\/issue_lip\r\n root@debdev # echo &quot;- - -&quot; &gt; &quot;\/sys\/class\/scsi_host\/host10\/scan&quot;<\/pre>\n<p>or some python code to rescan all adapters<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport os\r\n\r\nsSCSIPath=&quot;\/sys\/class\/scsi_host&quot;\r\nSCSIHosts=os.listdir(sSCSIPath)\r\n\r\nfor SCSIHost in SCSIHosts:\r\n\tf = open(sSCSIPath+&quot;\/&quot;+SCSIHost+&quot;\/proc_name&quot;)\r\n\tsLine=f.readline().strip(&#039;\\n&#039;)\r\n\tprint(sLine)\r\n\tif sLine==&quot;lpfc&quot;:\r\n\t\twith open(sSCSIPath+&quot;\/&quot;+SCSIHost+&quot;\/scan&quot;, &quot;w&quot;) as f:\r\n\t\t\tf.write(&quot;- - -\\n&quot;)\r\n<\/pre>\n<p>Get some fibre channel information<br \/>\nThe fabric a HBA is connected to<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/fabric_name\r\n0x100056eb2a367958\r\n<\/pre>\n<p>The WWNN (World wide node name)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/node_name\r\n0x20000060ca3badb8<\/pre>\n<p>The WWPN (World wide port name)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/port_name\r\n0x10000060ca3badb8<\/pre>\n<p>Port speed<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/speed\r\n8 Gbit\r\n<\/pre>\n<p>Current Porttype<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/port_type\r\nNPort (fabric via point-to-point)<\/pre>\n<p>Port State<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> root@debdev # cat \/sys\/class\/fc_host\/host10\/port_state\r\nOnline<\/pre>\n<p>You can also use the <strong>systool<\/strong> to query the sys filesystem<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n root@debdev # systool -c fc_host -v\r\n<\/pre>\n<p>To list the discovered WWNN and WWPNs use<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n root@debdev # systool -c fc_transport -v\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, rescan for new LUNs on a Emulex Fibre Channel Controller: List all HBAs root@debdev # ls -l \/sys\/class\/fc_host lrwxrwxrwx 1 root root 0 Oct 24 12:22 host10 -&gt; ..\/ lrwxrwxrwx 1 root root 0 Oct 24 12:22 host11 -&gt; ..\/ lrwxrwxrwx 1 root root 0 Oct 24 12:22 host7 -&gt; ..\/. lrwxrwxrwx 1 root &hellip; <a href=\"https:\/\/michlstechblog.info\/blog\/linux-how-to-rescan-for-new-luns-on-a-emulex-fc-controller\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Linux: How to rescan for new LUNs on a Emulex FC Controller<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[557,555,224,562,558,559,556,560,561],"class_list":["post-2316","post","type-post","status-publish","format-standard","hentry","category-linux","tag-emulex","tag-fibre-channel","tag-linux-2","tag-list-wwpn","tag-port-speed","tag-port-type","tag-rescan","tag-wwnn","tag-wwpn"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=2316"}],"version-history":[{"count":17,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2316\/revisions"}],"predecessor-version":[{"id":2327,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2316\/revisions\/2327"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=2316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=2316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=2316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}