Skip to content

[WIP] Fix USB format synchronization - #155

Open
BreezeDelegate wants to merge 2 commits into
linuxmint:masterfrom
BreezeDelegate:fix/exfat-format-sync
Open

BreezeDelegate wants to merge 2 commits into
linuxmint:masterfrom
BreezeDelegate:fix/exfat-format-sync

Conversation

@BreezeDelegate

Copy link
Copy Markdown
Contributor

Fixes #153.

Formatting now stops on failed commands instead of reporting success, and refreshes the partition table before wipefs/mkfs so the new geometry is visible first.

Tested with failure-injection and an exFAT loop device (fsck.exfat -n, blkid).

@clefebvre

Copy link
Copy Markdown
Member

Can you drop the udevadm settle line and keep only partprobe?

  • partprobe is what makes the kernel re-read the new table, and it's now checked, so a failure there still stops the format. That seems to be the part that matters for USB Stick Formatter 1.6.6 creates invalid exFAT filesystems on multiple drives #153.
  • --exit-if-exists=<partition> stops waiting as soon as the node exists, and the kernel creates /dev/sdX1 as soon as the partition is added. As I read it, the wait often returns immediately and doesn't wait for udev to finish anything.
  • Since execute() now uses check_call, udevadm settle returns non-zero if the udev queue isn't empty within 10s. On a busy system that would abort a format that would have worked.

Could you check that #153 is still fixed with only partprobe added, and let us know if it isn't? If the wait turns out to be needed, a plain udevadm settle --timeout=10 that doesn't abort on failure would be better than a fatal one.

@clefebvre clefebvre changed the title Fix USB format synchronization [WIP] Fix USB format synchronization Nov 12, 2026
@BreezeDelegate

Copy link
Copy Markdown
Contributor Author

Removed the udevadm settle call, leaving partprobe before wipefs and mkfs.exfat. I checked the command order and failure handling with tests: formatting stops if partprobe or mkfs.exfat fails.

I couldn't rerun the USB test on this host, so I haven't verified #153 on a device with this revision.

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.

USB Stick Formatter 1.6.6 creates invalid exFAT filesystems on multiple drives

2 participants