Repository navigation
fix: install SQL Server on another volume when C: has large sectors - #349
Merged
Merged
Conversation
SQL Server can't start from a volume whose physical sector size is over 4 KB, and the C: drive of some GitHub-hosted windows-2022 runners reports 8 KB. On those runners, setup failed with 0x851A0019 or 0x851A001A. Before setup, read the sector size of the Program Files volume with fsutil. If it is over 4 KB, and the volume of the runner's temporary directory reports 4 KB or less, pass /INSTANCEDIR and /INSTALLSQLDATADIR for that volume and log a warning. Both switches are needed, because the instance directory holds the resource database. If install-arguments sets either switch, keep the user's directories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a runaction variant that sets /INSTANCEDIR and /INSTALLSQLDATADIR through install-arguments, and check that the instance reports a data path in that directory. This runs the setup switches that the action uses on runners with large sectors on every push, and checks that the user's directories win. Print the data path in every job. When a job fails, also upload the error logs from the instance directories on the D: drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhensby
marked this pull request as ready for review
November 21, 2026 09:57
|
🎉 This PR is included in version 4.1.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
SQL Server can't start from a volume whose physical sector size is over 4 KB. The C: drive of some GitHub-hosted
windows-2022runners reports 8 KB, so setup fails there with 0x851A0019 or 0x851A001A. This caused every intermittentrunactionfailure since October. A failure on a push to master also skips the release for that push.This PR makes the action install the instance on the runner's temporary volume (D: on GitHub-hosted runners) when the default volume has large sectors.
What changes
fsutil fsinfo sectorinfo. It uses the larger ofPhysicalBytesPerSectorForAtomicityandPhysicalBytesPerSectorForPerformance, as Microsoft's troubleshooting page says.RUNNER_TEMPreports 4096 or less, the action adds/INSTANCEDIR="D:\Microsoft SQL Server"and/INSTALLSQLDATADIR="D:\Microsoft SQL Server"and logs a warning. Both switches are needed: the data directory holds the system databases, and the instance directory holds the resource database.install-argumentssets/INSTANCEDIRor/INSTALLSQLDATADIR, the action keeps the user's directories.Runners whose C: reports 4 KB or less see no change.
Microsoft's own fix is the
ForcedPhysicalSectorSizeInBytesregistry value, but it needs a reboot, so a job can't use it. Trace flag 1800 doesn't help, and setup has no switch for sector size.Evidence
runactionjobs logged their hardware. All 14 jobs whose C: reported 8192 failed, on SQL Server 2016, 2017, 2019 and 2025. None of the 1,426 jobs at 4096 failed. All 14 were onwindows-2022(13Standard_D4ds_v7, 1Standard_D4ads_v6).install-arguments(run 1, run 2). On runners whose C: reported 8192:/INSTALLSQLDATADIRalone: 0 of 4 passed. The resource database (Binn\mssqlsystemresource.ldf) stayed on C: and failed with misaligned log IOs.windows-2022andwindows-2025).install-arguments(run 3), 6 of 6 runners whose C: reported 8192 installed inD:\Microsoft SQL Serverand passed the same checks (2016, 2017 and 2025). Each of those jobs logged the warning once. 10 of 10 normal runners kept the default directories and logged no warning.custom-dirsvariant. No job in that run got an affected runner.CI
custom-dirsvariant sets both switches throughinstall-arguments, and checks that the instance reports its data path there. This tests the switches and the opt-out on every push, not only when a job gets an affected runner.Checks
npm run lint,npm run typecheckandnpm test(255 tests) pass.npm run buildleaves no changes.ProgramFiles, and dropping the arguments from the setup command.🤖 Generated with Claude Code