ReFS integrity is not on by default
I really don’t like the trend of filesystem authors to only care about filesystem integrity by default. How about having seat belt for your data integrity by default and let people turn it off if they want to compromise correctness for performance?
What I didn’t know is that ReFS integrity is not on by default. Only metadata integrity.
It’s also not visible or changeable in the UI (which is why I assumed they’d done the right thing), which is strange to me, this being Windows. No, you have to drop down into Microsoft’s crappy CLI.
How to check if it’s turned on.
Check files in one directory
PS E:\> Get-Item '*' | Get-FileIntegrity
FileName Enabled Enforced
-------- ------- --------
E:\SomeDirectory False True
E:\SomeOtherDirectory False True
E:\SomeFile.txt False True
[...]
Fuck you, Microsoft.
Check recursively
Of course Get-Item
doesn’t do recursion. Why would it? That would
make sense.
PS E:\> Get-Children -Recurse 'E:\SomeDirectory' | Get-FileIntegrity
FileName Enabled Enforced
-------- ------- --------
E:\SomeDirectory\foo.txt False True
[...]
How to enable it
Both commands are needed. The first command sets the new default for the root directory, and the second adds checksums to all existing files and directories.
PS E:\> Continue reading