• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to disable lvmetad in CentOS/RHEL

by admin

What is lvmetad

To improve performance and automatic activation of volume groups and logical volumes by udev, LVM makes use of a metadata cache. By default, LVM manages its metadata centrally using a daemon, lvmetad.

How to disable lvmetad

Sometimes, especially in a clustered environment, you may find that when you create a volume group on one node of the cluster, the same is not reflected on the other nodes of the cluster. This is mainly due to the cached metadata on the other nodes. Some users may want to completely disable lvmetad in order to avoid this issue.

To disable the lvmetad, follow the steps given below:

Modify /etc/lvm/lvm.conf

1. Edit the /etc/lvm/lvm.conf file and set use_lvmetad as 0.

# vi /etc/lvm/lvm.conf
use_lvmetad = 0

When set to 1 and when lvmetad is running (it is not auto-started), the volume group metadata and PV state flags are obtained from the lvmetad instance and no scanning is done by the individual commands. In a setup with lvmetad, lvmetad udev rules must be set up for LVM to work correctly. Without proper udev rules, all changes in block device configuration will be ignored until a manual “pvscan –cache” is performed.

2. After the use of the lvmetad metadata cache is disabled, the lvmetad service can be disabled as well.

For CentOS/RHEL 6

# service lvm2-lvmetad stop
# chkconfig lvm2-lvmetad off

For CentOS/RHEL 7

# systemctl stop lvm2-lvmetad
# systemctl disable lvm2-lvmetad
# systemctl stop lvm2-lvmetad.socket
# systemctl disable lvm2-lvmetad.socket

You may also want to mask both the services:

# systemctl mask lvm2-lvmetad.service 
# systemctl mask lvm2-lvmetad.socket
Note: When the value of use_lvmetad is changed from 1 to 0, you must reboot or stop the lvmetad service manually.

3. After making changes to the /etc/lvm.conf file, we will need to rebuild the initramfs to ensure the LVM configuration is loaded properly at boot time.

# cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.$(date +%m-%d-%H%M%S).bak
# dracut -f -v
CentOS / RHEL 6 : How to rebuild Initial Ramdisk Image

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. Manage ASM Audit Files with syslog – configure lograte and auditing
  2. CentOS / RHEL 6 : How to boot into rescue mode
  3. DNF Update Fails With Error “GPG check FAILED” – CentOS/RHEL 8
  4. How to use “yum downloadonly” to download a package without installing it
  5. Allow cronjobs to run by pam even if user password is expired
  6. Configure Network Bonding in Ubuntu Server
  7. ufw Command Options
  8. How to Reinstall Corrupted Library with yum
  9. How to Manage Zimbra Account Status from CLI
  10. Linux OS service ‘iscsid’

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright