{"id":1080,"date":"2020-07-01T17:11:24","date_gmt":"2020-07-01T17:11:24","guid":{"rendered":"https:\/\/www.nicktailor.com\/?p=1080"},"modified":"2022-10-21T11:27:24","modified_gmt":"2022-10-21T11:27:24","slug":"how-to-add-a-new-scsi-lun-while-server-is-live","status":"publish","type":"post","link":"https:\/\/nicktailor.com\/tech-blog\/how-to-add-a-new-scsi-lun-while-server-is-live\/","title":{"rendered":"How to add a new SCSI LUN while server is Live"},"content":{"rendered":"<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong>REDHAT\/CENTOS:<\/strong><\/p>\n<p>In order to get wwn ids from a server:<\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>cat \/sys\/class\/scsi_host\/host0\/device\/fc_host\\:host0\/port_name<\/em><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>cat \/sys\/class\/scsi_host\/host1\/device\/fc_host\\:host1\/port_name<\/em><\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\">Or:<\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>systool -av -cfc_host | grep port_name | awk &#8216;{ print $3 }&#8217; | cut -d\\&#8221; -f 2 | cut -dx -f 2<\/em><\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt;\">1.<\/span>To add a new SAN LUN while live:<\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\">Run this to find the new disks after you have added them to your VM<\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>rescan-scsi-bus.sh<\/em><\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong><em>Note: rescan-scsi-bus.sh is part of the sg3-utils package<\/em><\/strong><\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt;\">2.<\/span>Check that it has been found, will be mpath(something)<\/div>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 67.6pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>multipath \u2013l<\/em><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"># That&#8217;s it, unless you want to fix the name from mpath(something) to something else<\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt;\">1.<\/span>Change the shortcut name<\/div>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 67.6pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>vi \/etc\/multipath_bindings<\/em><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt;\">2.<\/span>Remove the default mpath device autogenerated<\/div>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 67.6pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>multipath \u2013f mpath(something)<\/em><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"># Go into the multipath consolde and re add the multipath device with your new shortcut name (nickdsk2 in this case)<\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 67.6pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>multipathd \u2013k<\/em><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 67.6pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>&nbsp;<\/span><em>add map nickdsk2<\/em><\/p>\n<p><strong>Note: Not going to lie, sometimes you could do all this and still need a reboot, majority of the time this should work. But what do i know&#8230;haha<\/strong><\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>REDHAT\/CENTOS: In order to get wwn ids from a server: \u2022&nbsp;cat \/sys\/class\/scsi_host\/host0\/device\/fc_host\\:host0\/port_name \u2022&nbsp;cat \/sys\/class\/scsi_host\/host1\/device\/fc_host\\:host1\/port_name Or: \u2022&nbsp;systool -av -cfc_host | grep port_name | awk &#8216;{ print $3 }&#8217; | cut -d\\&#8221; -f 2 | cut -dx -f 2 . 1.To add a new SAN LUN while live: Run this to find the new disks after you have added them to your<a href=\"https:\/\/nicktailor.com\/tech-blog\/how-to-add-a-new-scsi-lun-while-server-is-live\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,125,138,126],"tags":[],"class_list":["post-1080","post","type-post","status-publish","format-standard","hentry","category-centos","category-diskstuff","category-linux","category-scsi-stuff"],"_links":{"self":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=1080"}],"version-history":[{"count":9,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1080\/revisions"}],"predecessor-version":[{"id":1594,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1080\/revisions\/1594"}],"wp:attachment":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=1080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=1080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=1080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}