1

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?

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
John
  • 141
  • 4
  • Please show important parts of `/etc/lvm/lvm.com`, e.g. `filter`, `scan`. Also show `lsblk` and tell if you are using multipath. – Nikita Kipriyanov Aug 28 '22 at 04:22
  • @NikitaKipriyanov the issue is solved. The only remaining question is why lvm works like this. My exact setup is irrelevant. – John Aug 28 '22 at 04:39

1 Answers1

1

Listing out all potential reasons which case pvscan skip it.

  1. An lvm.conf filter containing symlinks to the dev like /dev/disk/by-id/lvm-pv-uuid-xyz entries.
  2. 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.
  3. 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.

asktyagi
  • 2,401
  • 1
  • 5
  • 19