[partition reuse] LVM VGs can't be deleted and recreated with the same name

Bug #1873328 reported by Paride Legovini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Triaged
Medium
Unassigned

Bug Description

[Bug spun-off from LP: #1837214]

When installing on a disk which already has a LVM VG on it, the VG can't be deleted and recreated with the same name. The error is: "vg0 is not a valid name for a volume group" in the case of vg0.

This happens because in lvm.py subiquity checks if the new VG name already exists in /dev:

if v in ('.', '..', 'md') or os.path.exists('/dev/' + v):
    return _("{} is not a valid name for a volume group")

I understand (took me a while) why the check is there: we don't want the user to name the VG as an existing device, like "tty1" or "zero". We should find a way to exclude volume groups from this check. The check in duplicate VG names is done already:

if v in self.vg_names:
    return _("There is already a volume group named '{}'")

so excluding them from the name sanity check shouldn't cause problems.

Tags: easy
Paride Legovini (paride)
affects: curtin → subiquity
Paride Legovini (paride)
description: updated
description: updated
Changed in subiquity:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Paride Legovini (paride) wrote :

In any case the protection against silly VG names is kind of weak, as just a fraction of the possible device names exist in /dev at install time.

What if we maintain a list of forbidden patterns instead? Boring to compile but it's not going to be huge, and would easily offer better protection than now.

tags: added: easy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.