错误“ /run/lvm/lvmetad.socket:连接失败:没有这样的文件或目录”-但与Grub不相关


19

所有LVM命令都会给我错误/run/lvm/lvmetad.socket: connect failed: No such file or directory。我用Google搜索了此错误,仅发现与Grub和Grub安装相关的帖子。

希望摆脱那些错误

# pvs
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  PV         VG      Fmt  Attr PSize  PFree
  /dev/vdb1  vdatavg lvm2 a--  16.00g 6.00g

您是否处于受限制的环境中?
Stephan Schielke

我是。我该怎么办?
isaaclw

Answers:


20

如果您使用的是lvm和systemd,请执行以下操作:

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

顺便说一句,这也与g有关。我认为grub 从/run/lvm/lvmetad.socket 获取内核参数

在工作正常时,耐心耐心地对所有这些进行详细测试。如果我错了,请有人纠正我。

编辑:这仅与使用systemd进行初始化的系统有关。如果您使用的是较旧的ubuntu,则可能会改用upstart和其他系统上的openrc。


我做了所有这些命令,没有一个给我任何错误。但是,当我chroot并尝试使用更新我的grub时grub2-mkconfig -o /boot/grub2/grub.cfg,它仍然返回错误/run/lvm/lvmetad.socket: connect failed: No such file or directory
Igettäjä

2
Ubuntu 16.04现在使用systemd
JrBenito

1
“在chroot中运行,忽略请求”
isaaclw

10

假设您正在运行Linux,请按以下步骤操作/etc/lvm/lvm.conf

use_lvmetad = 0

停止LVM之前这样做:/etc/init.d/lvm stop。进行更改并重新启动LVM :/etc/init.d/lvm start

编辑:我意识到Linux Mint上没有这样的文件或目录,因此在Debian和Ubuntu上都没有,我应该推断。如果您没有这样的服务,只需重新启动计算机即可。

提示:在标签列表中添加您的操作系统。


1
在Ubuntu 16.04上,我确实有一个/etc/lvm/lvm.conf
安德鲁
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.