#3210 PR open: Avoid vgcfgrestore on thin volumes/pools and any other unsupported volume types.

Labels: enhancement, bug

lzaoral opened issue at 2024-04-29 13:37:

Pull Request Details:

This patch was originally created in 2021 by @pcahyna in 5d5d1db3ca621eb80b9481924d1fc470571cfc09 and is applied in Fedora and RHEL 8+. Somehow it has slipped under our radar was never submitted upstream.

vgcfgrestore is not supposed to be able to restore any logical volumes that use kernel metadata. All volume types except linear and striped use kernel metadata. Main purpose of vgcfgrestore (with mandatory --force option) is to let users fix existing thin-pool, not to recreate the pool on empty disks. Do not even try vgcfgrestore on VGs that need any kernel metadata, because it might lead to an inconsistent state (if there are data that the kernel might interpret as LV metadata present on the disks).

For VGs that have any volume with kernel metadata and are thus unsupported by vgcfgrestore, switch automatically to LV creation using lvcreate, similarly to MIGRATION_MODE.

Avoid vgcfgrestore --force entirely, since it should not be needed now.

This mostly reverts changes in commits 311bfb3da1d5e47a2ff144123a2457e634f67893 and 1b779abfbf56693877fe666f56253ec623599674. The former code is preserved and gets enabled if FORCE_VGCFGRESTORE=y. This option is on purpose undocumented though and may be removed in the future.

jsmeix commented at 2024-04-30 07:32:

According to
https://bugzilla.redhat.com/show_bug.cgi?id=1747468#c9
this is our matching upstream issue:
https://github.com/rear/rear/issues/2222

lzaoral commented at 2024-04-30 07:45:

@jsmeix Could you please reassign this to @pcahyna? He is the commit author. Thank you!


[Export of Github issue for rear/rear.]