Make Raw Image Remount Deterministic - #3002
Open
jaredhagel2 wants to merge 1 commit into
Open
Conversation
jaredhagel2
force-pushed
the
fix/raw-image-remount
branch
from
June 22, 2026 20:55
4bb567d to
4325555
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
This keeps the change narrow while making the remount target deterministic.
Validation