[Bug 2083322] Re: Partial reformat partially works
Olivier Gayot
2083322 at bugs.launchpad.net
Fri Feb 21 08:45:29 UTC 2025
** Changed in: subiquity (Ubuntu Noble)
Milestone: None => ubuntu-24.04.2
** Changed in: subiquity (Ubuntu Noble)
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to subiquity in Ubuntu.
https://bugs.launchpad.net/bugs/2083322
Title:
Partial reformat partially works
Status in subiquity:
Fix Released
Status in subiquity package in Ubuntu:
Fix Released
Status in subiquity source package in Noble:
Fix Released
Bug description:
I was investigating a bug report involving a guided reformat in a disk
that had a partition "in-use" (i.e., mounted). In such a scenario, the
installer tries to delete the partitions that are *not* in-use.
Unfortunately, this does not work as it should. We iterate over the
partitions and remove them at the same time. This is basic iterator
invalidation.
In the example below (I added extra debugging information), the disk
has 4 partitions and partition number 2 appears in-use. We should get
partition number 1, 3 and 4 removed.
DEBUG disk.partitions() = [
Partition(device=disk-sda, ..., number=1, ...),
Partition(device=disk-sda, ..., number=2, ...),
Partition(device=disk-sda, ..., number=3, ...),
Partition(device=disk-sda, ..., number=4, ...)
]
DEBUG in_use_parts = [
Partition(device=disk-sda, ..., number=2, ...)
]
DEBUG iterating over disk.partitions()
DEBUG current element: Partition(device=disk-sda, ..., number=1, ...)
DEBUG partition is not in use, calling delete_partition(Partition(device=disk-sda, ..., number=1, ...))
DEBUG current element: Partition(device=disk-sda, ..., number=3, ...)
DEBUG partition is not in use, calling delete_partition(Partition(device=disk-sda, ..., number=3, ...))
^ We didn't iterate over either sda2 or sda4.
To manage notifications about this bug go to:
https://bugs.launchpad.net/subiquity/+bug/2083322/+subscriptions
More information about the foundations-bugs
mailing list