Bug 2222949 - RFE - Request to remove missing devices with lvmdevices command
Summary: RFE - Request to remove missing devices with lvmdevices command
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: lvm2
Version: 9.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-14 14:51 UTC by John Pittman
Modified: 2023-08-15 07:12 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Story
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-162391 0 None None None 2023-07-14 14:52:57 UTC

Description John Pittman 2023-07-14 14:51:35 UTC
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

Comment 3 David Teigland 2023-07-24 20:18:42 UTC
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


Note You need to log in before you can comment on or make changes to this bug.