Rocky Linux 9.1: "Error parsing metadata for VG ..." while trying to create lvm snapshot


I installed Rocky Linux 9.1 on a Broadwell system with Intel i3-5010U CPU, 4 GB RAM and 32 GB 2,5" SSD.
I did a minimal installation and used LVM for disk partitioning.

The volume group used all available space and I assigned 10 GB to the root partition so that there are still ~14 GB available space in the volume group. Please see here:

[root@localhost ~]# vgs
  VG #PV #LV #SN Attr   VSize   VFree  
  rl   1   2   0 wz--n- <27.30g <14.41g

[root@localhost ~]# lvs
  LV   VG Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rl -wi-ao---- 10.00g                                                    
  swap rl -wi-ao----  2.89g                                                    

[root@localhost ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                713M  9.1M  704M   2% /run
/dev/mapper/rl-root   10G  1.1G  9.0G  11% /
/dev/sda2           1014M  214M  801M  22% /boot
/dev/sda1            599M  7.0M  592M   2% /boot/efi
tmpfs                357M     0  357M   0% /run/user/0

After the installation went well I want to create a lvm snapshot for the root partition (before installing more software) but unfortunately this fails with the following error:

[root@localhost ~]# lvcreate -v -s rl/root -n root_snapshot -L 5G
  Setting chunksize to 4.00 KiB.
  Creating logical volume root_snapshot
  Archiving volume group "rl" metadata (seqno 3).
  Parse error at byte 401 (line 20): unexpected token
  Error parsing metadata for VG rl.
  Failed to write VG rl.

[root@localhost ~]# lvm version
LVM version:     2.03.16(2) (2022-05-18)
Library version: 1.02.185 (2022-05-18)
Driver version:  4.46.0

Does anybody has an idea what is going wrong and how this can be fixed?

Kind regards,

PS: The same is working with Rocky Linux 8.7


I think I found the root cause meanwhile in the metadata backup file - the -"- in device_id:

			device_id_type = "sys_wwid"
			device_id = "t10.ATA_____2.5"_SATA_SSD_3MG2-P____________________20161128AA0018230001"

In Rocky Linux 9.x the device_id is written to metadata and if this contains a -"- this breaks the metadata :roll_eyes:

How can this been fixed?

Kind regards,

I would report it upstream here

Was fixed in upstream :+1:;a=commit;h=dc99f0def17b936f95c63612a56ae2a6ae81db0e