LVM-相关命令报错-Devices file PVID xxxxxxxxx last seen on /dev/xvda4 not found

发布时间 2024-01-05 10:56:50作者: 520_1351

环境:AWS平台,使用t2.medium机型创建的EC2,然后制作的镜像

现象:通过镜像,创建 m5.large 机型的EC2,执行lvm相关的命令,报如下错误

[root@qq-5201351 ~]# vgs
  Devices file PVID sQ2p8KDx0VDRB5bpzsGq5uR6wPcnRJD3 last seen on /dev/xvda4 not found.
[root@qq-5201351 ~]# vgscan
  Devices file PVID sQ2p8KDx0VDRB5bpzsGq5uR6wPcnRJD3 last seen on /dev/xvda4 not found.

然后查阅资料,https://access.redhat.com/zh_CN/solutions/7046677

可以看到有几种解决方法:最后笔者选择了如下的方式得到了解决

[root@qq-5201351 ~]# cat /etc/lvm/lvm.conf |grep use_devi
        # Configuration option devices/use_devicesfile.
        # use_devicesfile = 1

将/etc/lvm/lvm.conf文件,上面内容中的 use_devicesfile = 1 取消注释,然后修改成 use_devicesfile = 0

最后再次执行lvm相关的命令就正常了

[root@qq-5201351 ~]# vgs
  VG    #PV #LV #SN Attr   VSize VFree
  vgEBS   1  10   0 wz--n- 9.31g 16.00m
[root@qq-5201351 ~]#

 

 

 

尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/17946873