Day: July 1, 2020

How to add a new SCSI LUN while server is Live

REDHAT/CENTOS:

In order to get wwn ids from a server:

• cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_name
• cat /sys/class/scsi_host/host1/device/fc_host\:host1/port_name

Or:

• systool -av -cfc_host | grep port_name | awk ‘{ print $3 }’ | cut -d\” -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 VM

• rescan-scsi-bus.sh

Note: rescan-scsi-bus.sh is part of the sg3-utils package

2.Check that it has been found, will be mpath(something)
• multipath –l

# That’s it, unless you want to fix the name from mpath(something) to something else

1.Change the shortcut name

• vi /etc/multipath_bindings

 

2.Remove the default mpath device autogenerated
• multipath –f mpath(something)

# Go into the multipath consolde and re add the multipath device with your new shortcut name (nickdsk2 in this case)

• multipathd –k

• add map nickdsk2

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…haha