Skip to content

Make Raw Image Remount Deterministic - #3002

Open
jaredhagel2 wants to merge 1 commit into
pbatard:masterfrom
jaredhagel2:fix/raw-image-remount
Open

Make Raw Image Remount Deterministic#3002
jaredhagel2 wants to merge 1 commit into
pbatard:masterfrom
jaredhagel2:fix/raw-image-remount

Conversation

@jaredhagel2

@jaredhagel2 jaredhagel2 commented Jun 22, 2026

Copy link
Copy Markdown

Summary

This changes the raw-image post-write remount path so Rufus consistently remounts the primary partition instead of whichever volume Windows happens to expose first.

It also makes raw-image writes reuse the earliest previously assigned drive letter for the target disk, which avoids stealing the secondary partition's mountpoint in the common multi-partition D:/E: case.

Problem

When writing a multi-partition raw image, the post-write mount state depended on the target disk's prior drive-letter state.

In the failure case, Rufus would reuse the last removed drive letter and then try to remount the primary partition onto a letter that already belonged to the secondary partition. The remount flow also looked up the volume with partition offset 0, which is ambiguous and can resolve to whichever matching volume Windows exposes first.

In the end, this caused our 2 partition USB drive to only show up as D: within Windows Explorer after imaging with Rufus, which then required the user to manually correct by assigning the letter E to the second partition using the Windows 'Disk Management' tool.

Fix

  • Use the refreshed main-partition offset when waiting for and resolving the remounted logical volume.
  • In raw-image mode only, reuse the first removed drive letter instead of the last removed drive letter.

This keeps the change narrow while making the remount target deterministic.

Validation

  • Verified on the CFast raw-image workflow that the recurring mount-letter collision no longer reproduces.

@jaredhagel2
jaredhagel2 force-pushed the fix/raw-image-remount branch from 4bb567d to 4325555 Compare June 22, 2026 20:55
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.

1 participant