Skip to content

fix(core/disk): skip unmountable partitions when listing backup targets#3237

Merged
dr-bonez merged 2 commits into
masterfrom
fix/skip-unmountable-backup-partitions
May 21, 2026
Merged

fix(core/disk): skip unmountable partitions when listing backup targets#3237
dr-bonez merged 2 commits into
masterfrom
fix/skip-unmountable-backup-partitions

Conversation

@MattDHill
Copy link
Copy Markdown
Member

Summary

  • Tiny non-data partitions on a backup disk (GPT header, ESP, etc.) were appearing as "Available for backup, 0 GB" rows alongside the real data partition on the same physical disk. The backup-target list flattens each disk into one row per partition, with no filter for whether the partition is actually usable.
  • part_info now returns Option<PartitionInfo>, returning None when the read-only mount probe fails; list() filters those out.
  • The OS-disk LVM-PV path in list() is restructured to compute capacity directly via get_capacity rather than going through part_info — raw PVs can't mount anyway, and we only needed logicalname + capacity on that branch. This keeps the existing behavior for the embassy data disk.
  • i18n key disk.util.could-not-collect-usage-info is renamed/reworded to disk.util.skipping-unmountable-partition to reflect the new "skip" semantic, across all 5 locales.

🤖 Generated with Claude Code

The backup-target list flattens disks into one row per partition, so
small non-data partitions on a backup disk (GPT header, ESP, etc.)
were surfacing as "Available for backup, 0 GB" alongside the real
data partition.

part_info now returns Option<PartitionInfo>, returning None when the
read-only mount probe fails; list() filters those out. The OS-disk
LVM-PV path is restructured to call get_capacity directly, since raw
PVs can't mount and we only needed logicalname + capacity there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MattDHill MattDHill requested a review from dr-bonez May 15, 2026 03:50
@dr-bonez
Copy link
Copy Markdown
Member

Just because we know the capacity of an LVM PV doesn't mean it has a mountable filesystem on it

Address review feedback: the previous patch required all partitions
on an external disk to mount before being added to disk.partitions,
which dropped LVM physical volumes (no mountable filesystem on a raw
PV). That broke setup/recovery flows like os_install scanning for
EMBASSY_/STARTOS_ GUIDs in disk.partitions.

Pull the LVM-PV logic from both branches of list() into a single
lvm_pv_part_info helper that builds a PartitionInfo from capacity +
guid + probed LV filesystem without going through the mount probe.
The non-PV path still requires mount and skips on failure, which is
what filters the tiny header/ESP partitions that started this thread.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MattDHill
Copy link
Copy Markdown
Member Author

Good catch. The previous patch required every partition in the external-disk branch to mount before being added to disk.partitions, which dropped raw LVM PVs (no mountable filesystem on them) — breaking the os_install/setup scan for EMBASSY_/STARTOS_ GUIDs.

Pushed 02c4154ec: pulled the LVM-PV logic from both branches of list() into one lvm_pv_part_info helper that builds a PartitionInfo from capacity + guid + probed LV filesystem without going through the mount probe. The non-PV path still requires mount, which is what filters the tiny header/ESP partitions on the user's Samsung drive.

@dr-bonez dr-bonez merged commit fb09b7a into master May 21, 2026
26 checks passed
@dr-bonez dr-bonez deleted the fix/skip-unmountable-backup-partitions branch May 21, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants