• 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

“WARNING: Failed to connect to lvmetad. Falling back to device scanning” – error while running LVM commands

by admin

The Problem

The LVM commands showing below errors:

# pvs
WARNING: Failed to connect to lvmetad. Falling back to device scanning.    <<<
PV VG Fmt Attr PSize PFree
/dev/sd[X][partition_number] [vg_name] lvm2 a-- [size]g [available_free_space]g
# vgs
WARNING: Failed to connect to lvmetad. Falling back to device scanning.    <<<
VG #PV #LV #SN Attr VSize VFree
[vg_name] [number_of_pvs]  [number of lvs] 0 wz--n- [size]g [available_free_space]g
# lvs
WARNING: Failed to connect to lvmetad. Falling back to device scanning.    <<<
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[lv_name] [vg_name] -wi-ao---- [size]g

Error from /var/log/messages file:

# grep lvmetad /var/log/messages
Sep 8 20:34:29 [hostname] systemd: Cannot add dependency job for unit lvm2-lvmetad.socket, ignoring: Unit is masked.
Sep 8 20:34:29 [hostname] lvm: WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Sep 8 20:34:31 [hostname] lvm: WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Sep 8 20:34:31 [hostname]t lvm: pvscan[642] activating all directly (lvmetad unused) 8:17
Sep 8 20:34:31 [hostname] lvm: WARNING: Autoactivation reading from disk instead of lvmetad.
Sep 8 20:34:31 [hostname] lvm: WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Sep 8 20:34:31 [hostname] lvm: pvscan[644] activating all directly (lvmetad unused) 8:2
Sep 8 20:34:31 [hostname] lvm: WARNING: Autoactivation reading from disk instead of lvmetad.

The Solution

The lvm2-lvmetad.service and lvm2-lvmetad.socket services were disabled without following proper steps. The /etc/lvm/lvm.conf is configured to use use_lvmetad, where as the lvm2-lvmetad.service and lvm2-lvmetad.socket services were masked.

# grep "use_lvmetad =" /etc/lvm/lvm.conf
use_lvmetad = 1
# systemctl status lvm2-lvmetad.service
● lvm2-lvmetad.service
Loaded: masked (/dev/null; bad)      >>>>> Masked      
Active: inactive (dead)
Warning: lvm2-lvmetad.service changed on disk. Run 'systemctl daemon-reload' to reload units.
# systemctl status lvm2-lvmetad.socket
● lvm2-lvmetad.socket
Loaded: masked (/dev/null; bad)      >>>>> Masked
Active: inactive (dead)

Sep 08 20:34:29  systemd[1]: Cannot add dependency job for unit lvm2-lvmetad.socket, ignoring: Unit is masked.
Sep 08 20:34:32  systemd[1]: Cannot add dependency job for unit lvm2-lvmetad.socket, ignoring: Invalid request descriptor
Sep 08 20:34:38  systemd[1]: Cannot add dependency job for unit lvm2-lvmetad.socket, ignoring: Unit is masked.
Sep 08 20:34:38  systemd[1]: Cannot add dependency job for unit lvm2-lvmetad.socket, ignoring: Unit is masked.
Warning: lvm2-lvmetad.socket changed on disk. Run 'systemctl daemon-reload' to reload units.

- Unmask the lvm2-lvmetad.socket and lvm2-lvmetad.service first. Then start and enable the services on boot with below commands.

# systemctl unmask lvm2-lvmetad.service lvm2-lvmetad.socket
# systemctl start lvm2-lvmetad.service lvm2-lvmetad.socket
# systemctl enable lvm2-lvmetad.service lvm2-lvmetad.socket

If lvm2-lvmetad.socket and lvm2-lvmetad.service needs to be disabled then the /etc/lvm/lvm.conf requires to be configured not to use "use_lvmetad". (i.e use_lvmetad = 0)

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

Some more articles you might also be interested in …

  1. How to Create/Format/Extend Virtual Data Optimizer(VDO) Volumes using Cockpit Web Console in CentOS/RHEL 8
  2. OpenLDAP Server and Client Utilities list
  3. How to Troubleshoot Performance Issues on Linux – Beginners Guide
  4. Apache HTTP server – most commonly used containers (special configuration directives)
  5. Why Does “/var/log/messages” Report Martian Packets
  6. CentOS / RHEL 7 : Configuring an NFS server and NFS client
  7. Integrate Linux Servers with Active Directory using Samba, Winbind, and Kerberos
  8. How to Extend allowed number of loopback devices
  9. ‘ip’ Command cheat sheet (Command Line Reference)
  10. How To Disable Weak Cipher And Insecure HMAC Algorithms in SSH services for CentOS/RHEL 6 and 7

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