Le problème
Les commandes LVM affichant les erreurs ci-dessous :
# 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
Erreur du fichier /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 solution
Le lvm2-lvmetad.service et lvm2-lvmetad.socket les services ont été désactivés sans suivre les étapes appropriées. Le /etc/lvm/lvm.conf est configuré pour utiliser use_lvmetad, où les services lvm2-lvmetad.service et lvm2-lvmetad.socket ont été masqués.
# 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.
- Démasquer le lvm2-lvmetad.socket et lvm2-lvmetad.service première. Ensuite, démarrez et activez les services au démarrage avec les commandes ci-dessous.
# systemctl unmask lvm2-lvmetad.service lvm2-lvmetad.socket # systemctl start lvm2-lvmetad.service lvm2-lvmetad.socket # systemctl enable lvm2-lvmetad.service lvm2-lvmetad.socket
Si lvm2-lvmetad.socket et lvm2-lvmetad.service doivent être désactivés, le fichier /etc/lvm/lvm.conf doit être configuré pour ne pas utiliser "use_lvmetad". (c'est-à-dire use_lvmetad =0)