0

I am not able to list the root_disk LVM in lvm commands (like pvs, vgs etc.) output. The lvm.conf file does have global_filter and it looks like below -

global_filter = [ "a|^/dev/mapper/96005076307ffc6a60000000000001501.*|", "r/.*/" ] 

96005076307ffc6a60000000000001501 happens to be my root_disk and there is only 1 disk. Have tried with other options in global_filter like having '$' sign at end of root_disk (like /dev/mapper/96005076307ffc6a60000000000001501p2) also did not help.

The preferred_names entry in lvm.conf is as below -

preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]

The root_lvm gets detected, say for example in "pvs" command output, if I include "/dev/dm-0" into the global-filter. However, working with "/dev/dm-N" is discouraged as the names are not constant and is used internally by OS.

This is happening only for root_lvm and other disks if part of global_filter are detected in the expected way.

Not sure of the reason. I need to get the /dev/mapper entries for root_disk as well in "pvs" command output.

0

Are you using device-mapper-multipath?

Note that the /dev/mapper/<WWID> device name is not among the preferred_names in lvm.conf. (RedHat uses user_friendly_names yes in /etc/multipath.conf by default.)

What happens if you change preferred_names to something like this?

preferred_names = [ "^/dev/mpath/", "^/dev/mapper/[0-9][0-9a-fp]*", "^/dev/mapper/mpath", "/dev/[hs]d" ]

You should also ensure that your initramfs is configured to start multipathing before the LVM volume group containing the root filesystem is activated. In RHEL 5 or older, ensure that /etc/sysconfig/mkinitrd/multipath has MULTIPATH=yes in it if your root filesystem is on a multipathed disk.

If you need to fix this, the steps in RHEL 5 and older are:

  • add MULTIPATH=yes to /etc/sysconfig/mkinitrd/multipath
  • update your initramfs
  • if /boot is a separate filesystem, temporarily comment it out of /etc/fstab
  • reboot
  • confirm that LVM is now accessing the root VG through the multipath device
  • uncomment /boot in /etc/fstab, mount it and ensure it's now also getting mounted using the multipath device.

When a multipath device is opened, the multipath subsystem applies an exclusive lock to the component devices of the multipathed device, and that should be enough to make LVM avoid the component devices. But if the multipath subsystem cannot get that lock, it means something else is already using one of the component devices: that usually means the multipath subsystem has been started too late in the system boot-up sequence. The result is usually similar to what you seem to be experiencing.

If I guessed wrong, then the output of vgscan -vvvv might be helpful in figuring it out.

  • Thank you for the explanation. 1. Yes, I am using device-mapper-multipath. 2. My RHEL OS is of 7.2 release. Updating the preferred_names did not work. Please find the vgscan -vvvv output in the below link. paste.ubuntu.com/p/fyqxC2YFKD – user7290726 Oct 15 '18 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.