Il problema
I comandi LVM che mostrano di seguito gli errori:
# 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
Errore dal file /var/log/messages:
# 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.
La soluzione
Il lvm2-lvmetad.service e lvm2-lvmetad.socket servizi sono stati disabilitati senza seguire i passaggi appropriati. Il /etc/lvm/lvm.conf è configurato per utilizzare use_lvmetad, mentre i servizi lvm2-lvmetad.service e lvm2-lvmetad.socket erano mascherati.
# 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:29systemd[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.
- Smaschera lvm2-lvmetad.socket e lvm2-lvmetad.service primo. Quindi avvia e abilita i servizi all'avvio con i comandi seguenti.
# systemctl unmask lvm2-lvmetad.service lvm2-lvmetad.socket # systemctl start lvm2-lvmetad.service lvm2-lvmetad.socket # systemctl enable lvm2-lvmetad.service lvm2-lvmetad.socket
Se lvm2-lvmetad.socket e lvm2-lvmetad.service devono essere disabilitati, allora /etc/lvm/lvm.conf richiede di essere configurato per non usare "use_lvmetad". (cioè use_lvmetad =0)