1758535 Members
1895 Online
108872 Solutions
New Discussion юеВ

device-mapper-multipath

 
Tonatiuh
Super Advisor

device-mapper-multipath

Red Hat Enterprise Linux 4
(Kernel 2.6.9-22ELsmp)

I have executed the "multipath -v2" command and it generates and shows grouped multipathed devices.

But in several articules I have seen that it should generates a "/dev/disk/by-name/WWID" block devices, but I only get a "/dev/dm-X", "/dev/mapper/WWID" and "/dev/mapper/dm-XpY" block devices; and this generated devices are lost after reboot.

"/dev/dm-X", and "/dev/mapper/WWID" block devices are created after I run again the "multipath -v2" command. And "/dev/mapper/dm-XpY" block devices are created after I run the "kpartx -a /dev/dm-X" command.

Any idea about my case?
22 REPLIES 22
Matti_Kurkela
Honored Contributor

Re: device-mapper-multipath

Apparently you haven't enabled the multipathd daemon, which is needed by device-mapper-multipath.

Go to /usr/share/doc/device-mapper-multipath- directory on your RHEL4 server and read all the documentation found there.

There are specific initial setup instructions (Multipath-usage.txt in the above-mentioned directory). Follow these instructions exactly.

Note that some of the documentation in this directory is directly from the "generic" multipath-tools source package, and does *not* refer specifically to RHEL 4 unless it explicitly says so.

You should get your multipath devices as /dev/mapper/mpath*, and symlinks to them as /dev/mpath/mpath*.

The "/dev/disk/by-name/WWID" style of naming seems to be achievable when the multipath tools and udev are configured to work together. Apparently this integration was not yet done when RHEL 4 configuration was frozen for release. At that point, the device-mapper-multipath seems to have been quite recent development and not very well documented. Any documentation written later is likely to refer to the newer (much changed) versions, unless it is specifically written for RHEL 4.

RHEL 4 has multipath-tools version 0.4.5: the udev integration was done in 0.4.6. Further changes were made in 0.4.7, which is the "latest" version.

The device-mapper-multipath developers' web page has a Change Log which might be useful:
http://christophe.varoqui.free.fr/wiki/wakka.php?wiki=Home
MK
Tonatiuh
Super Advisor

Re: device-mapper-multipath

Matt, your info is VERY ambigous to me. I am a VERY newbie about this multipathing technolgies.

The multipathd is started up at startup time of the server. The problem is other configuration.
Tonatiuh
Super Advisor

Re: device-mapper-multipath

My /var/log/messages is being adding with this messages every 11 seconds (constantly):

Aug 20 17:32:44 rac1 kernel: Device sdaa not ready.
Aug 20 17:32:44 rac1 kernel: Device sdb not ready.
Aug 20 17:32:44 rac1 kernel: Device sdd not ready.
Aug 20 17:32:44 rac1 kernel: Device sdg not ready.
Aug 20 17:32:44 rac1 kernel: Device sdh not ready.
Aug 20 17:32:44 rac1 kernel: Device sdj not ready.
Aug 20 17:32:44 rac1 kernel: Device sdl not ready.
Aug 20 17:32:44 rac1 kernel: Device sdm not ready.
Aug 20 17:32:44 rac1 kernel: Device sdp not ready.
Aug 20 17:32:44 rac1 kernel: Device sdr not ready.
Aug 20 17:32:44 rac1 kernel: Device sdu not ready.
Aug 20 17:32:44 rac1 kernel: Device sdv not ready.
Aug 20 17:32:44 rac1 kernel: Device sdx not ready.
Aug 20 17:32:44 rac1 kernel: Device sdz not ready.
Kodjo Agbenu
Honored Contributor

Re: device-mapper-multipath

Hi,

Make sure that the multipath daemon is automatically loaded at reboot :
grep -i autopath /etc/rc.d/rc.sysinit
find /etc/rc.d -print | grep -i autopath

In your last mesage, it looks like a path have changed or have been lost, then all LUNs seen under that path disappeared and Linux kernel is trying to reconnect to them.

Reboot the system to get a neat situation, then check again that autopath daemon has been automatically loaded.

Good lcuk.
Kodjo
Learn and explain...
Tonatiuh
Super Advisor

Re: device-mapper-multipath

Both commands:

grep -i autopath /etc/rc.d/rc.sysinit
find /etc/rc.d -print | grep -i autopath

Returns nothing.

The situation with the messages in /var/log/messages is the same after a reboot.

Tonatiuh
Super Advisor

Re: device-mapper-multipath

If I change the commands to look for "multipath" instead of "autopath" they returns something:

# grep -i multipath /etc/rc.d/rc.sysinit
if [ -x /sbin/lvm.static -o -x /sbin/multipath -o -x /sbin/dmraid ]; then
if [ -f /etc/multipath.conf -a -x /sbin/multipath ]; then
modprobe dm-multipath >/dev/null 2>&1
/sbin/multipath -v 0
if [ -x /sbin/multipath ]; then
modprobe dm-multipath >/dev/null 2>&1
/sbin/multipath -v 0
if [ -x /sbin/multipath ]; then
modprobe dm-multipath >/dev/null 2>&1
/sbin/multipath -v 0
# find /etc/rc.d -print | grep -i multipath
/etc/rc.d/rc4.d/S13multipathd
/etc/rc.d/rc3.d/S13multipathd
/etc/rc.d/rc6.d/K87multipathd
/etc/rc.d/rc0.d/K87multipathd
/etc/rc.d/init.d/multipathd
/etc/rc.d/rc2.d/S13multipathd
/etc/rc.d/rc1.d/K87multipathd
/etc/rc.d/rc5.d/S13multipathd
David Child_1
Honored Contributor

Re: device-mapper-multipath

Okay, first thing make sure multipathd is set to run on bootup;

# chkconfig --list multipathd
multipathd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Check if it's currently running;
# service multipathd status
multipathd (pid 3961) is running...

Now, with all that said multipathd deals with path checking and restoration. It has nothing to do with setting up the device files on bootup.

I've never seen the /dev/sdk/by-name/WWID setup, but it is possible by setting up multipath and udev rules correctly (and maybe a little scripting). Generally you will have /dev/mpath/ for your names.

1. Unless you really want the WWID name (e.g. SEMC_____SYMMETRIX______9903673E9000) you should set up some aliases in /etc/multipath.conf. Here is an example of one of mine;

multipath {
wwid SEMC_____SYMMETRIX______9903673E9000
alias sym3E9mp
}

2. You may need to edit /etc/udev/rules.d/40-multipath.rules if you want to tweak your end-results. The defaults should work in most cases.

To help get more specific I would need to know what storage array you are using and perhaps an example of a WWN.

Thanks,
David
Tonatiuh
Super Advisor

Re: device-mapper-multipath

Hi David,

The "chkconfig --list multipathd" and "service multipathd status" returns me that the service is correctly started at server start up time.

Eventhough the devices are not created on startup time. I need to run "multipath -v2" and "kpartx -a ..." manually to generate again the devices.

About the name of devices and udev. No more questions about that.

David Child_1
Honored Contributor

Re: device-mapper-multipath

I created the attached script for the creation of device files. It handles the loading of the modules, device file creation (e.g. multipath -v2), and kpartx. I set it up to be used with the service command for ease of implementation.

Just put the file in /etc/rc.d/init.d/create_multipath_devices (or whatever you want to call it). Then run 'chkconfig create_multipath_devices on'.

You can just use it as is or roll your own.

David