[Bug 2097091] Re: Reformat does not always honor the ptable parameter

Olivier Gayot 2097091 at bugs.launchpad.net
Thu Apr 17 15:38:36 UTC 2025


The fix is included in Subiquity 25.04
https://github.com/canonical/subiquity/releases/tag/25.04

** Changed in: subiquity
       Status: Fix Committed => Fix Released

** Changed in: subiquity (Ubuntu Plucky)
       Status: Fix Committed => 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/2097091

Title:
  Reformat does not always honor the ptable parameter

Status in subiquity:
  Fix Released
Status in subiquity package in Ubuntu:
  Fix Released
Status in subiquity source package in Plucky:
  Fix Released

Bug description:
  The FilesystemManipulator.reformat function takes an optional ptable
  argument, defaulting to None.

  Unfortunately, it is not always honored today. If the disk has
  partitions, the `ptable` parameter is essentially ignored.

  This is because:
  * the assignment of disk.ptable happens before removing existing partitions
  * removing partitions relies on FilesystemModel.remove_partition() - which resets the partition table to the default value when deleting the last partition of a disk.

  https://github.com/canonical/subiquity/blob/1d074a1c0ea888d7d3367aa5c6d9076dd6ebc28c/subiquity/common/filesystem/manipulator.py#L271-L277
  https://github.com/canonical/subiquity/blob/1d074a1c0ea888d7d3367aa5c6d9076dd6ebc28c/subiquity/models/filesystem.py#L2265-L2266

  What that means is:

  * /storage/v2/reformat_disk?ptable=None (where None is the default)
    -> if the disk had zero partition, keep the current partition table type
    -> if the disk had partitions, create a partition table of the default type (i.e., GPT)

  * /storage/v2/reformat_disk?ptable="msdos"
    -> if the disk had zero partition, create a partition table of the specified type (i.e., msdos here)
    -> if the disk had partitions, create a partition table of the default type (i.e., GPT)

To manage notifications about this bug go to:
https://bugs.launchpad.net/subiquity/+bug/2097091/+subscriptions




More information about the foundations-bugs mailing list