![错误“/run/lvm/lvmetad.socket:连接失败:没有这样的文件或目录” - 但与 Grub 无关](https://linux22.com/image/63972/%E9%94%99%E8%AF%AF%E2%80%9C%2Frun%2Flvm%2Flvmetad.socket%EF%BC%9A%E8%BF%9E%E6%8E%A5%E5%A4%B1%E8%B4%A5%EF%BC%9A%E6%B2%A1%E6%9C%89%E8%BF%99%E6%A0%B7%E7%9A%84%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%E2%80%9D%20-%20%E4%BD%86%E4%B8%8E%20Grub%20%E6%97%A0%E5%85%B3.png)
所有 LVM 命令都会给出错误/run/lvm/lvmetad.socket: connect failed: No such file or directory
。我用 Google 搜索了这个错误,只找到了与 Grub 和 Grub-install 相关的帖子。
希望摆脱这些错误
# 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
答案1
如果您使用 lvm 和 systemd,请执行以下操作:
systemctl enable lvm2-lvmetad.service
systemctl enable lvm2-lvmetad.socket
systemctl start lvm2-lvmetad.service
systemctl start lvm2-lvmetad.socket
顺便说一句,这也与 grub 有关。我认为grub获取内核参数根来自/run/lvm/lvmetad.socket。
当它发挥作用时,没有耐心详细测试所有这些。如果我错了,请有人纠正我。
编辑:这仅与使用 systemd 进行 init 的系统相关。如果你使用的是较旧的 ubuntu,你可能会使用 upstart,而在其他系统上则使用 openrc。
答案2
假设您运行的是 Linux,如下/etc/lvm/lvm.conf
所示:
use_lvmetad = 0
在执行此操作之前停止 LVM:/etc/init.d/lvm stop
。进行更改并重新启动 LVM:/etc/init.d/lvm start
。
编辑:我意识到 Linux Mint 上没有这样的文件或目录,因此我可以推断,Debian 和 Ubuntu 上都没有这样的文件或目录。如果没有这样的服务,只需重新启动计算机即可。
暗示:将您的操作系统添加到标签列表中。