Conversation
A single setting decides whether a Dev Drive is usable at all: FDVDenyWriteAccess under HKLM\SYSTEM\CurrentControlSet\Policies\Microsoft \FVE. While it is 1, Windows mounts every unencrypted fixed data drive read-only, so declining BitLocker leaves a drive nothing can be written to. Until now that was invisible until the write check stopped the run, with the partition already made. It is read before the BitLocker question and whatever the answer, unlike the four other machine facts, which are read only once BitLocker has been chosen. The question then carries it, the plan repeats it as a consequence of skipping, and the write check, if it still comes to that, names the setting instead of listing suspects. The other half of the report: on such a machine Windows opens its own prompt to encrypt the new drive while this run is already encrypting it. Answering it produces "BitLocker encryption already enabled". The run now says to leave it alone, and says so on an unreadable setting too, since a failed read is not evidence the setting is off. Closes #65 Closes #3 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 88.2K · Output: 17.6K · Cached: 397.6K |
Did the real-world test for you - compiled creation plan: ===============================================================================
DEV DRIVE CREATION PLAN
===============================================================================
* Create a 50 GB Dynamic virtual hard disk at C:\Users\[REDACTED]\Documents\DevDriveTest.vhdx
* Initialize the new virtual disk with a GPT partition table
* Format the attached virtual disk as a Dev Drive using ReFS
* Register the virtual disk to be mounted on every Windows startup
* Name the Dev Drive DevDriveTest.vhdx
* Mark Dev Drive as trusted for Windows Defender performance
* Skip BitLocker encryption
- This machine denies write access to fixed drives that BitLocker does not protect (FDVDenyWriteAccess is 1).
- So this Dev Drive will mount read-only, and nothing can be written to it.
- The run will stop at the write check once the drive exists. Enable BitLocker, or change that setting first.
* Skip deduplication and compression setup
===============================================================================Results:
Suggestions:
|
|
Thank you — it settles an open question and found a defect in the same output. The question it settlesWhether So the warning you saw in the plan was right, and it was right to appear before anything was created. That is now recorded as measured rather than assumed. Your run is also the first end-to-end confirmation of that whole path on somebody else's machine: warned in the plan, stopped at the write check, named the The defect you foundLook at what the script told you: The first line says it failed. The next says it worked. You should not have to decide which half of our message to believe — that is our job, and we got it wrong. What happened is that the script trusted the error code and ignored the answer it had just read back. There is a rule in this repository against exactly that, and it was written the other way round: never call something a success on an error code alone. Calling it a failure on one is the same mistake facing the other way. Filed as #105. The fix is to say what happened — Your drive is fine. It is trusted, Defender is running in performance mode on it, and Why
|
|
Always glad to help you help me! 🥳
I could swear I just typed
How can they possibly think this is sufficient to make a reasonable decision? 🙈
I'd have come up with an advanced parameter for overriding that choice, i.e., purposely not adding another question while still providing a choice - however…
… resulted in this (manually translated): Logical bytes per sector: 512
Physical bytes per sector for indivisibility: 4096
Physical bytes per sector for performance: 4096
Eff. phys. bytes/sector for indivisibility in file system: 4096
Device alignment: Aligned (0x000)
Partition alignment on device: Aligned (0x000)
No deduction for searches
Shortening is supported
Not DAX-capable
Not provided with slim storage allocation… which makes me think the laptop was setup with 512e on a 4 kB NVMe storage drive.
I still think: most development files do exceed 4 kB of actual disk usage, hence having all "bytes per sector" values set to 4096 bytes would increase performance - but: I'll leave it entirely up to your final decision. 😎
"Never say never".. 😉
Yes, that indeed confused me the most. 😅 |
|
Your measurement settles it, and your suggestion is filed. That is 512e — the ordinary case, and the pairing the default already matches. Nothing on your machine needed changing. Your idea, reshaped: #113. Not a hidden switch, though — a question asked only in virtual disk mode, showing your disk's own figure beside it, so the answer is informed rather than guessed. And the two values are not written into our script: they are read out of what Windows itself will accept, so the question grows by itself if that ever changes. One thing has to be measured before it ships: whether a Dev Drive can be formatted at all inside a 4-KB-logical
Both are true and they are about different disks. 4 KB logical is faster on a disk that is itself 4 KB native, and slower on everything else — which is nearly everything. The page never says which sentence applies to you, and that is a fair complaint.
That argument is right, but it lands on a different knob: the cluster size, which is what the format dialog's "allocation unit size" sets. ReFS offers 4 KB and 64 KB there. It is a separate question from the sector size and is not part of #113. #82Closed, not planned. The stray output stays as it is. |
Did the test real quick - result (manually translated): format E: /FS:ReFS /A:4096 /DevDrv /Q /V:DevDriveTest
The file system type is REFS.
Enter the current volume label for drive E: DevDriveTest
ATTENTION: ALL DATA ON THE
HARD DISK DRIVE E: WILL BE LOST!
Execute format (Y/N)? y
Format with quick format 50.0 GB
The BitLocker encryption and the encrypted data of the volume were removed.
You can reactivate BitLocker after format completed.
Creating file system structure.
Format finished.
50.0 GB space total.
50.0 GB are available.NOTE: Upon creation of the
While I do get the message & understand the technical stuff behind it. I did think |
|
Forgot 1 question: how to completely revert anything the |
Right mouse button on the drive, "Eject", delete the .vhdx, and forget about it. |
For BTW: Due to restricted rights & the way that darn |
|
|
Closes #65, and closes #3, which it turns from a mystery into a line in the plan.
The fact behind it
"Deny write access to fixed drives not protected by BitLocker". While it is
1, Windows mounts every unencrypted fixed data drive read-only. @Eagle3386's run proved it end to end: the volume refused writes while unencrypted and accepted them once encryption completed.That path, not
HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\BitLocker, which was empty on his machine. The effective location is the one to read, whatever delivered the setting.What the run does with it now
The other half of the report
On such a machine Windows opens its own prompt to encrypt the new volume while this run is already encrypting it. He answered it, got
BitLocker encryption already enabled, deleted the partition and started over; on the second run he left it alone and it closed by itself. The BitLocker notes now say so before encryption starts - and say it on an unreadable setting too, because a read that failed is not evidence the setting is off.Verification
dev_drive.ps1was not executed, deliberately. Parse OK, PSScriptAnalyzer recursive with no findings, Pester 560 passed / 0 failed (532 before this branch). On this machine the setting reads asAllow, so none of the new lines appear here.Reviewed
Reviewed independently before this was opened. Applied:
Resolve-WriteAccessPolicyAdvice -BitLockerChosenwas never passed by either call site, so a tested, green branch could not run in production. Replaced by-Skipping, which both call sites now use to tell the two moments apart.Test-Pathwithout-ErrorAction Stop: a key that exists but cannot be read answered$false, which the function then reported as "not set" - the exact confusion its docstring promises to avoid.[int]cast throw, and the docstring claimed only a failed read answersUnknown. The type is checked now, and a string value and aDWORD 2each have a test.Deny, so a machine whose setting could not be read got no warning at all - which is precisely the situation that cost the reporter a partition. Gated on "not known to be off" instead.Allowbranch acquitted the setting too confidently on the strength of one key; it now says it does not look like the cause rather than that it cannot be.Denybranch dropped the partition read-only check that a comment three lines above promises is offered in every branch, and told the user to run the script again - wrong, because the Dev Drive already exists by then and a rerun would repeat its creation. It namesEnable-BitLockeron the existing volume instead.Mock Test-Pathinside anItwas still active duringAfterEach, making cleanup print a red error over a key that test never created; and an assertion on a parameter'sParameterAttributewas vacuous - it passes for any parameter of any function. The suite also leftHKCU:\Software\DevDriveTestsbehind; it now removes the whole branch, verified.Not resolved, and worth saying: whether
FDVDenyWriteAccessapplies to a volume inside a.vhdxthe same way it does to a physical partition could not be established without a test machine. The plan note is passed in that mode too. If it does not apply there, the line is harmlessly early rather than wrong - it says the drive is read-only until encryption finishes, which resolves either way.