Operating System - Linux
1829106 Members
2505 Online
109986 Solutions
New Discussion

Re: multipath map VS lvm2 map

 
Mohan Wickramasinghe
Occasional Contributor

multipath map VS lvm2 map

Hi All

Having issue in linux with lvm kicking in before multipath.

since lvm is depending on the volumes setup in /dev/mapper by multipath
and if lvm cannot find any, the multipath volumes are not used by lvm. so i have written a shell to do all the work manually on startup.
please let me know a way to fix this issue.
thank you
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: multipath map VS lvm2 map

Welcome to ITRC Forums!

The LVM configuration file /etc/lvm/lvm.conf contains some settings that can prevent this issue.

All versions of LVM2 support the "filter" keyword, which can be used to make LVM use only multipathed devices.

Newer versions (about RHEL 4.5 and above, I think) also have the "preferred_names" keyword, which can be used to make LVM favor multipath devices over non-multipath devices. If the "preferred_names" keyword is supported in your Linux distribution, the lvm.conf file usually contains a commented-out example line for exactly this purpose:
-----
preferred_names = [ ]

# Try to avoid using undescriptive /dev/dm-N names, if present.
# preferred_names = [ "^/dev/mpath/", "^/dev/mapper/", "^/dev/[hs]d" ]
-----
If your lvm.conf includes lines like this, just comment out the first preferred_names line, and uncomment the second one.

The lvm.conf file is a readable text file, and it usually contains a lot of commented-out examples for the most important keywords. There is also a man page: type "man lvm.conf" to read it.

(If you're using multipathed disks and your lvm.conf does not support the preferred_names keyword, your system is rather old. You should seriously consider upgrading to the latest update level: after the preferred_names keyword was added, many other important updates to both LVM an dm-multipath have been released, so you would be likely to get other reliability improvements too.)

MK
MK
Mohan Wickramasinghe
Occasional Contributor

Re: multipath map VS lvm2 map

Hi Matti
Thank you.


The contents of /dev/mapper for multipath devices are as follows

data-part1 (LVM partition of data)
wal-part1 (LVM partition of wal)
indices-part1 (LVM partition of indices)

Note: data, wal and indices are the volumes mapped from MSA to linux using friendly names,

and in lvm.conf

under devices section ...

devices {
dir = "/dev"
scan = [ "/dev" ]
preferred_names = [ ]
filter = [ "a/mapper/", "r/.*/" ]
cache_dir = "/etc/lvm/cache"
cache_file_prefix = ""
write_cache_state = 1
types = [ "device-mapper", 254 ]
sysfs_scan = 1
md_component_detection = 1
ignore_suspended_devices = 0
}

and this does not work.


so i will have to change the preferred_names to
preferred_names = [ "^/dev/mapper/" ]


these are the only active settings, other settings are commented out.
thanks.