[partition reuse] LVM VGs can't be deleted and recreated with the same name
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.
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.
affects: | curtin → subiquity |
description: | updated |
description: | updated |
Changed in subiquity: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: easy |
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.