问题原文
原帖链接 · John · CC BY-SA 4.0
I had a CentOS 7 server configured with a volume group that spanned 5 external hard drives. I upgraded the OS to Rocky 9, and now Rocky 9 isn't seeing the physical volumes, volume group or logical volume.
My physical volumes (external drives) are /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd, and /dev/sde.
When I run pvscan -vvv &| grep "/dev/sd[abcde]", I get this:
Found dev 8:0 /dev/sda - new alias.
Found dev 8:16 /dev/sdb - new alias.
Found dev 8:32 /dev/sdc - new alias.
Found dev 8:48 /dev/sdd - new alias.
Found dev 8:64 /dev/sde - new alias.
/dev/sda: Skipping (deviceid)
/dev/sdb: Skipping (deviceid)
/dev/sdc: Skipping (deviceid)
/dev/sdd: Skipping (deviceid)
/dev/sde: Skipping (deviceid)
Why is pvscan skipping my devices?
The only way I can scan my physical devices is if I do: sudo pvscan --devices /dev/sda,/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde, which gives me:
PV /dev/sda VG WD_VG lvm2 [<5.46 TiB / 0 free]
PV /dev/sdc VG WD_VG lvm2 [232.88 GiB / 0 free]
PV /dev/sdb VG WD_VG lvm2 [<5.46 TiB / 0 free]
PV /dev/sdd VG WD_VG lvm2 [<5.46 TiB / 0 free]
PV /dev/sde VG WD_VG lvm2 [<5.46 TiB / 0 free]
Total: 5 [<22.06 TiB] / in use: 5 [<22.06 TiB] / in no VG: 0 [0 ]
But after that, the devices still don't show up in the output of pvdisplay
Update: It seems like running these commands fixed it:
sudo lvmdevices --adddev /dev/sda
sudo lvmdevices --adddev /dev/sdb
sudo lvmdevices --adddev /dev/sdc
sudo lvmdevices --adddev /dev/sdd
sudo lvmdevices --adddev /dev/sde
Why is this necessary? I thought lvm scanned all block devices, every time? Why does it keep a list of devices to scan?
已采纳解答
原帖链接 · asktyagi · CC BY-SA 4.0
Listing out all potential reasons which case pvscan skip it.
- An lvm.conf filter containing symlinks to the dev like /dev/disk/by-id/lvm-pv-uuid-xyz entries.
- To use a device with lvm, add it to the devices file with the command lvmdevices --adddev, and to prevent lvm from seeing or using a device,remove it from the devices file with lvmdevices --deldev. The vgimportdevices command adds all PVs from a VG to the devices file, and updates the VG metadata to include device IDs of the PVs. Might be some tried -deldev already.
- Might be some skip option enabled in lvm.conf
Working lvmdevices --adddev proves explicitly adding pv's work it mean it's skipped due to some reason intensionally or by mistake. You need to check lvm.conf carefully.
I am not sure if this help, but feel free to add your findings in question.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
