Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JeremyVV/17751a60640b9b05876d827695e18d21 to your computer and use it in GitHub Desktop.

Select an option

Save JeremyVV/17751a60640b9b05876d827695e18d21 to your computer and use it in GitHub Desktop.
[How to Add Multipath LVM Storage LUNs in RHEL 6] #rhel6 #lvm #storage #multipath #san

Table of Contents

Detect New SCSI Devices

Assuming that the multipath device has already been presented from the SAN side we need to scan for the new devices.

for host in /sys/class/scsi_host/* ; do echo "- - -" > ${host}/scan ; done

Then list the new devices created in the last day and review the WWN’s for those devices

find /dev -name "sd*" -type b -cmin -600 | sort | \
  xargs -I{} sh -c 'printf "{}\tWWN:"; /lib/udev/scsi_id --whitelisted --device={}' \
  | sort -k 2

Configure the Multipath Device

Backup the configuration

cp /etc/multipath.conf /etc/multipath.conf.bak

Add blacklist configuration to /etc/multipath.con If there is a blacklist_exceptions tag then add the WWID to it, for example:

blacklist_exceptions {
    # Lun 0 1 GB
    wwid 36001234567890abcdef1234567890abc
}

Do a dry run of the new configuration.

multipath –d

If that is good then then force multipath to detect new paths and validate.

multipath –v2
multipath –ll

Once the multipath –v# command is run, look at the date/time stamp of /etc/multipath/bindings file. If this file has a current date/time stamp then look in it to see if it’s been updated with new multipath alias names. This typically means there is an issue with your syntax in the updated /etc/multipath.conf file.

Once the multipath –v# is run it builds device under /dev/mapper/<alias-name##>

When a new LUN is discovered and configured it adopts the basic multipath settings. The LUN will not adopt any EMC Array default settings that are defined in the /etc/multipath.conf file. Run the reload command to force the new LUN to use the default EMC defined settings. This command is not disruptive so can be run without issue.

service multipathd reload

Review the new multipath device(s) and make sure they have adopted the correct storage options. Eg…

multipath -ll Lun0
Lun0 (36001234567890abcdef1234567890abc) dm-11 EMC,Invista
size=1G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='queue-length 0' prio=1 status=active
|- 5:0:1:1 sdd 8:48 active ready running
|- 5:0:0:1 sdad 65:208 active ready running
|- 4:0:1:1 sdbf 67:144 active ready running
`- 4:0:0:1 sddp 71:112 active ready running

Any time a new LUN is presented and built into /etc/multipath.conf file you need to rebuild the kernel image file in /boot.

Rebuild the Initial Ramdisk

Backup the original kernel image

cp -p /boot/initramfs-`uname -r`.img /boot/initramfs-`uname -r`.img-`date +%b%d%Y`-New_LUNs

Create the new kernel image. This will read, among many other configuration files, the /etc/multipath.conf file

dracut --force --add multipath --include /etc/multipath /etc/multipath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment