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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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 extract RAR files in CentOS/RHEL 7 and 8
  2. What are different Samba Server Types
  3. How to Re-generate initramfs and vmlinuz for Rescue Kernel with Current Kernel in CentOS/RHEL 7
  4. CentOS / RHEL : How to add new swap partition
  5. CentOS / RHEL 6,7 : How to recover an interrupted yum package installation
  6. Getting “parsing errors” When Running ‘yum repolist’
  7. How To Create a Local Yum Repository for MySQL Enterprise Packages
  8. The /var/log/messages is empty, and so are the rotated log files such as messages.0, messages.1
  9. What are SELinux Users and how to Map Linux Users to SELinux Users
  10. How to recover from deleted root entry in /etc/shadow and/or /etc/passwd files in CentOS / RHEL 6

You May Also Like

Primary Sidebar

Recent Posts

  • SQL script to find tables that are fragmented
  • TRUNCATE TABLE not releasing space from tablespace
  • How to reclaim entire space of an oracle database table with “Truncate Table” statement
  • Oracle SQL Script to Report Tablespace Free and Fragmentation
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary