Description of problem: RFE - Request to add --removemissing to lvmdevices command. For example if a user removes 50 backend luns that are PVs, the --removemissing command could remove all entries from the devices file in one command. Version-Release number of selected component (if applicable): lvm2-2.03.17-7.el9 lvm2-libs-2.03.17-7.el9
pushed to main https://gitlab.com/lvmteam/lvm2/-/commit/7cc414135a5afd5b5536eb3e2b612cdec7be72ab
The new command is: lvmdevices --update --delnotfound. # cat /etc/lvm/devices/system.devices # LVM uses devices listed in this file. # Created by LVM command vgimportdevices pid 1186715 at Mon Jul 24 15:16:15 2023 SYSTEMID=foo VERSION=1.1.2 IDTYPE=sys_wwid IDNAME=naa.50014ee058bfe7b3 DEVNAME=/dev/sda2 PVID=qaWEiaFIIGJwyAgTWucDK00wVFg0s3dj PART=2 # echo "IDTYPE=sys_wwid IDNAME=naa.123 DEVNAME=/dev/sdx1 PVID=aaa PART=1" >> /etc/lvm/devices/system.devices # echo "IDTYPE=devname IDNAME=/dev/sdy DEVNAME=/dev/sdy PVID=bbb" >> /etc/lvm/devices/system.devices # pvs Devices file sys_wwid naa.123 PVID aaa last seen on /dev/sdx1 not found. Devices file PVID bbb last seen on /dev/sdy not found. PV VG Fmt Attr PSize PFree /dev/sda2 rhel_null-04 lvm2 a-- <464.76g 0 # lvmdevices --update --delnotfound Devices file sys_wwid naa.123 PVID aaa last seen on /dev/sdx1 not found. Devices file PVID bbb last seen on /dev/sdy not found. Not searching for missing devnames, search_for_devnames="none". Deleting IDTYPE=sys_wwid IDNAME=naa.123 PVID=aaa Deleting IDTYPE=devname IDNAME=/dev/sdy PVID=bbb Updated devices file to version 1.1.3 # cat /etc/lvm/devices/system.devices # LVM uses devices listed in this file. # Created by LVM command lvmdevices pid 1186745 at Mon Jul 24 15:17:11 2023 SYSTEMID=foo VERSION=1.1.3 IDTYPE=sys_wwid IDNAME=naa.50014ee058bfe7b3 DEVNAME=/dev/sda2 PVID=qaWEiaFIIGJwyAgTWucDK00wVFg0s3dj PART=2