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?