EL 9 系统下 LVM 2 Devices file PVID last seen on /dev/sda not found 问题解决

2024年1月2日 1252点热度 3人点赞 0条评论

EL 9 下,磁盘扩容后,在尝试对 LVM 卷扩容时发现 LVM 相关命令均报错:

Devices file PVID xxxxxxxxxxxxxxxxxxxxxxxxxxxxjA2h last seen on /dev/sda not found.

使用 LiveCD 引导,检查 LVM 却一切正常,此问题及其刁钻,多方查找后最终找到了两种解决方法。

问题原因:

在 EL9 系统上,LVM 的 use_devicesfile 参数默认在操作系统安装时启用,这导致磁盘参数变化后,系统拒绝加载该磁盘。

解决方法:

解决方法有两种,第一种是编辑 /etc/lvm/lvm.conf 文件 devices{} 部分中的 use_devicesfile 参数,将 1 改成 0,# 号去掉,保存文件即恢复正常,该方法来自戴尔的文档。

第二种方法来自红帽文档,通过更新 /etc/lvm/devices/system.devices 文件解决。

# 首先要清理掉旧的配置
echo "" > /etc/lvm/devices/system.devices
# 接着重新生成配置
vgimportdevices --all

操作完成后可运行 lvmdevices 命令检查,对于第一种方法,会返回 Devices file not enabled.,对于第二种方法,会返回所有设备的信息。

没问题以后就可以接着扩容了。

参考文档地址:

https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/9/html/configuring_and_managing_logical_volumes/limiting-lvm-device-visibility-and-usage_configuring-and-managing-logical-volumes

https://www.dell.com/support/manuals/zh-cn/powerpath-for-linux/pp_pub_core_linux_7x_install_guide/disable-use-of-devices-file-on-rhel9-and-ol9

耗子

练习时长 4 年半的个人程序员 喜欢PHP、Go、Vue 和 Python Music~

文章评论

Loading...