• 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. How to Disable IPv6 in CentOS/RHEL 8
  2. How to Start NTP Service With Slewing Enabled in Linux
  3. Common Error Messages from Command xfs_repair in Linux
  4. df: command not found
  5. btrfs scrub Command Examples in Linux
  6. dig Command Examples in Linux
  7. How to Add a 3rd Disk to Create a 3-way Mirror RAID1 MD Device (CentOS/RHEL 7)
  8. lrztar Command Examples in Linux
  9. asciidoctor: A processor that converts AsciiDoc files to a publishable format
  10. cpulimit: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)
  • “az storage account” Command Examples (Manage storage accounts in Azure)
  • “az sshkey” Command Examples (Manage ssh public keys with virtual machines)
  • “az redis” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright