故障现象
登录某台主机,准备通过lvm在上面挂一个新的文件系统。执行vgdisplay后,发现非rootvg的那个vg不见了。执行lvdisplay和pvdisplay也看不到相关的设备。
通过df -h 可以发现该vg下的lv都正常被挂载,而且可以正常读写,lsblk也能看到这些目录。
故障处理
尝试执行vgscan,无法找到被隐藏的这个vg。
执行lvm后,进入交互界面:
$lvm
lvm> help
Available lvm commands:
Use 'lvm help <command>' for more information
config Display and manipulate configuration information
devtypes Display recognised built-in block device types
dumpconfig Display and manipulate configuration information
formats List available metadata formats
help Display help for commands
fullreport Display full report
lastlog Display last command's log report
lvchange Change the attributes of logical volume(s)
lvconvert Change logical volume layout
lvcreate Create a logical volume
...
在命令行下执行vgck,然后再执行vgs,lvs或者lvdisplay,都能正常查看到故障vg。只要执行vgdisplay,这个vg就又会被隐藏。
执行yum install lvm2,升级了这个软件包,发现问题解决。
关联问题
redhat9以上的版本存在如下问题 Default use_devicesfile value results in non bootable system after upgrade to 9.2 or later - Red Hat Customer Portal
Environment
- Red Hat Enterprise Linux 9
- LVM2
use_devicesfile=1in/etc/lvm/lvm.conf(default value in RHEL 9 is ‘1’:enabled)
Issue
- The system fails to boot and drops to maintenance mode when the default
use_devicefilesvalue is set and upgrading from Red Hat Enterprise Linux 9
Resolution
- We have identified this issue as a bug and have filed a private Bugzilla ticket 2208342 for further action by our Engineering team.
- If you are affected by this issue, we encourage you to open a support case to raise visibility on this bug.
- The timeframe for Bugzilla support cases is different from typical support cases and are nominally outside of Service Level Agreement update times.
- Either fix the contents, or disable use, of
/etc/lvm/devices/system.devices- To disable the use of the LVM2
system.devicescache file, adduse_devicesfile=0in/etc/lvm/lvm.confusing rescue mode. - To fix the contents of
system.devices:-
- Remove any/all the problematic device lines in
/etc/lvm/devices/system.devicesfile
- Remove any/all the problematic device lines in
-
- Add the devices back into the file
-
- Verify with LVM command
-
- Reboot the system
- See Diagnostics for further details.
-
- To disable the use of the LVM2
# lvmdevices --delpvid xxxxxxxxxxxxxxxxxxxxxxxxxxxxeMWc # 1. Remove bad entries by PVID (UUID) -or- # lvmdevices --deldev sdb # 1. Removed bad entries by DEVNAME -or- # 1. Remove the whole file # mv /etc/lvm/devices/system.devices /etc/lvm/devices/system.devices.$(date +%Y%m%d.%H%M%S) # vgimportdevices -a # 2. Add back in all missing devices -or- # lvmdevices --adddev /dev/sdb # 2. Add back in individual devices # pvs # 3. Verify system.devices issue(s) corrected # reboot # 4. Reboot the system
-
See RHEL 9 documentation “14.1.2. Adding devices to the system.devices file” within Configuring and managing logical volumes for more information on
system.devicesfile. it’s format and use. -
Additional reference information is available via the
man pagesand then build-in documentation within the/etc/lvm/lvm.conffile. -
Related/similar issues with
system.devicesfile use in RHEL 9:- “LVM messages “Devices file PVID last seen on /dev/sda not found” in RHEL 9 for IDTYPE=devname”
- “Default use_devicesfile value results in non bootable system after upgrade to RHEL 9” (use_devicesfile option changes)
- “A storage move/clone/migration may cause LVM ‘Devices file sys_wwid last seen on not found’” (device wwids change)
- “LVM messages “Devices file PVID last seen on /dev/sda not found” in RHEL 9 for IDTYPE=.”
- “VMware guest looses access to one or more LVM when device WWIDs enabled in hypervisor for RHEL 9 guest”
- “WARNING: adding device /dev/sdX with PVID which is already used for /dev/sdX”
Diagnostic Steps
- Install Red Hat Enterprise Linux version 9.1
- Upgrade it to Red Hat Enterprise Linux version 9.2
- The system drops to maintenance mode
- The system devices file does not contain all PV’s.
# pvs
Reloading config files
Devices file sys_wwid <wwd> PVID <pv_uuid> last seen on /dev/N not found.
Reloading config files
-
Product(s) - Red Hat Enterprise Linux
-
Component - lvm2
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
QingYo