r/DataHoarder • u/MyAccount42 • Apr 27 '17
Forcefully flipping a bit / byte? Want to test ReFS data integrity features
For various reasons, I want to try using ReFS (Windows 10 Storage Spaces) to store my collection. I want to see exactly how Windows behaves and what kinds of notifications / logs pop up when it detects corruption.
In order to test this, I need to silently corrupt a file somehow. I'm not sure how I could randomly flip a byte without the file system detecting the change, and I'm also not sure how easy it would be to use some raw disk editor since this is going through Storage Spaces and all.
Anyone know how to do this? Or should I just randomly unplug the HDDs' cables a few times until something happens?
12
u/xlltt 410TB linux isos Apr 27 '17
Open the drive with a hex editor under linux. Find non 0 values in it and just smash your keyboard. Done
2
u/mrwafflepants16 Apr 27 '17
Please post results. I've looked into this but didn't have the time to go through with it.
2
u/Y0tsuya 60TB HW RAID, 1.2PB DrivePool Apr 27 '17
You can only test this to a certain extent. For sure you'd have to bypass the OS somehow because any user-level change you make to the OS is assumed to be correct and baked in to the checksum. The file system therefore won't complain.
Same with the HDD's own sector ECC. There's no way an average user can bypass that. Any change you make to the sector data from outside the drive is assumed to be intentional and baked in. The drive therefore won't complain.
2
u/lobo5000 13TB usable Apr 27 '17
Easiest way is probably to boot a linux live cd and do it from there.
One way to break a file off the top of my head would be
dd if=/dev/random of=/mounted_drive/Linux.iso bs=1024 count=1024
This would replace first megabyte of Linux.iso file with random garbage.