Hello,
I have a question about Hard Disk Sentinel Professional (which I didn't use yet), more precisely about the “refresh” feature: “Read+write+read test (refresh data area)”.
I am aware that when writing data to an hard disk, the data is temporarily held into a cache (even after the write is completed). If there is then a read operation of the same data, then the data is read from that cache (to make things quicker). The problem with this is when the user wants to (immediately) verify the integrity of the written data: the read operation will be performed from the data inside the cache, not from the actual hard disk surface, thus a write error will not be detected.
I think that there is more than one cache working when writing to hard disk: the cache on the actual hard disk (disk buffer), a cache from Windows (page cache), and perhaps even more.
How does Hard Disk Sentinel handle this when doing a refresh of an hard disk? Will the read-after-write operation read the actual sector on the hard disk surface, or will it read the sector data from cache? Should Hard Disk Sentinel detect a write error? Did you (or your customers) actually experience detection of a write error when doing an hard disk refresh?
I know there is an option in Windows to disable write caching on a device, but I'm not sure which cache gets disabled (disk buffer or page cache), and if it will actually solve the problem (since there would be still other caches working). But perhaps with Hard Disk Sentinel there is no problem in any case, when doing an hard disk refresh?
I suppose that if Hard Disk Sentinel unmounts the volume while doing the refresh operation, then the Windows page cache should be disabled for that volume.
Regarding the disk buffer, I read on Wikipedia that “the data in the disk buffer is rarely reused” and thus isn't really a cache (https://en.wikipedia.org/wiki/Disk_buffer), but that “rarely” makes me doubtful.
And I'm not sure if there are other caches at work.
I'm not sure if all what I have written is correct. Please let me know if there is something which I didn't understand.
I hope that there is no issue with caches, and that Hard Disk Sentinel will be able to detect a write error if it (rarely) happens during hard disk refresh.
Thanks.
Cache while doing hard disk refresh?
- hdsentinel
- Site Admin
- Posts: 3128
- Joined: 2008.07.27. 17:00
- Location: Hungary
- Contact:
Re: Cache while doing hard disk refresh?
Yes, generally during "normal" reads and writes, the data can be cached.
Exactly as you wrote, there may be different level of caches possible: Windows may cache in internal (system) memory and also the device may have its own cache. For example, modern hard disks may usually have 8-64 MB caches.
Also yes, as you feel, there can be other caches too, for example if you use a special RAID controller, it may have higher amount of caches (usually 128 MB - 1 GB).
Yes, Hard Disk Sentinel disables the cache in all possible ways, exactly to prevent using the cache, as it is important to read/write the actual sectors, instead of the cache. For this, it uses direct communication method for the testing which disables caching of reads/writes.
Also Hard Disk Sentinel uses larger buffers during the tests which should not fit in the cache. So even if the drive would "want" to cache (regardless of the above mentioned disable) the cache can't hold enough data and the sector is surely accessed.
So I can confirm yes, of course the test is designed exactly to detect possible write errors, more precisely errors when the sectors can be written, can be read back - but the information stored is not correct / corrupted.
Also I can say that there is an other function in Hard Disk Sentinel Pro: the Write + Read test.
This is different, as it performs a COMPLETE overwrite with special pattern (which is zero bytes by default, but different pattern can be selected) and the perform a COMPLETE read back. Also the test can be configured to process sectors in random order or start from the end of the drive and advance to the beginning.
This test can be also effectively used to detect write errors and problematic sectors which can't hold data. Ideal to detect "fake" pendrives, memory cards which sold with high capacity - but low price, as this test can reveal which sectors present virtually - but can't be really used to store information.
Just this test is destructive, overwrites the complete surface area - so useful only on new / empty drives and/or devices need to be cleared.
Yes, I can confirm that for write type tests (including the refresh test) require unmount of the volume, so can only be started on secondary drives (not on the hard disk drive which contains Windows itself, the swapfile and/or other files/folders currently in use by any running application).
Exactly as you wrote, there may be different level of caches possible: Windows may cache in internal (system) memory and also the device may have its own cache. For example, modern hard disks may usually have 8-64 MB caches.
Also yes, as you feel, there can be other caches too, for example if you use a special RAID controller, it may have higher amount of caches (usually 128 MB - 1 GB).
Yes, Hard Disk Sentinel disables the cache in all possible ways, exactly to prevent using the cache, as it is important to read/write the actual sectors, instead of the cache. For this, it uses direct communication method for the testing which disables caching of reads/writes.
Also Hard Disk Sentinel uses larger buffers during the tests which should not fit in the cache. So even if the drive would "want" to cache (regardless of the above mentioned disable) the cache can't hold enough data and the sector is surely accessed.
So I can confirm yes, of course the test is designed exactly to detect possible write errors, more precisely errors when the sectors can be written, can be read back - but the information stored is not correct / corrupted.
Also I can say that there is an other function in Hard Disk Sentinel Pro: the Write + Read test.
This is different, as it performs a COMPLETE overwrite with special pattern (which is zero bytes by default, but different pattern can be selected) and the perform a COMPLETE read back. Also the test can be configured to process sectors in random order or start from the end of the drive and advance to the beginning.
This test can be also effectively used to detect write errors and problematic sectors which can't hold data. Ideal to detect "fake" pendrives, memory cards which sold with high capacity - but low price, as this test can reveal which sectors present virtually - but can't be really used to store information.
Just this test is destructive, overwrites the complete surface area - so useful only on new / empty drives and/or devices need to be cleared.
Yes, I can confirm that for write type tests (including the refresh test) require unmount of the volume, so can only be started on secondary drives (not on the hard disk drive which contains Windows itself, the swapfile and/or other files/folders currently in use by any running application).