3 ms·
The bit about disk drive lying about syncing writes is a persistent myth. There have probably been some HDDs at some point which had notable bugs in their flush
by magila 7y ago
The bit about disk drive lying about syncing writes is a persistent myth. There have probably been some HDDs at some point which had notable bugs in their flush command, but in general drives do actually write data to disk before reporting complete status for a flush.
I spent several years working for a major HDD manufacturer and their firmware QA process included a test rig which would repeatedly pull power to the drive while sending write and flush commands. The drive would then be powered up and the data on the drive examined to verify that all data which should have been flushed actually made it to disk.
I think this myth persists mostly because it can be surprising difficult to coax an OS into sending a flush command for much the same reason disk drives get accused of lying about it: performance.
These days the most reliably solution is to reconfigure the drive with write caching disabled. This way the drive will ensure every write hits the disk before reporting completion to the host. Write caching remains enabled by default on SATA drives mostly for historical reasons. Back before command queuing was commonly supported write caching gave a large speedup. These days everything supports NCQ so disabling write caching only has a small performance impact.
- xenadu02 7y agoThis is absolutely not a myth. There have been drives that behaved this way, including from "name brand" manufacturers. Maybe those were firmware bugs, maybe they stopped doing it, but it is not something made up. Of course there have also been controller bugs, file system bugs, and so on over the years. A decade ago the behavior of most file systems was quite poor in the face of underlying hardware failures but a lot of work has gone into improving the situation. SSDs are slowing improving too. Most of them have claimed to go into read-only mode when enough blocks wear out but in reality most of them would crash, fail to respond, or just lose data. It turns out manufacturers tend to be a bit loose in their claims until independent third-parties put their claims to the test. More recent models seem to be a bit better behaved in failure states.