xxmikexx
05-23-2008, 07:40 AM
Paperflyer,
In the UPS thread in the Hardware forum, paperflyer wrote ...
That's what journaling is for, isn't it? Every major filesystem (except FAT) is capable of that.
On a journaled filesystem, write caching does not impose any additional risks of data-loss when your computer crashes, but improves performance.
Here's my reply ...
Paperflyer,
The whole subject of journaling was discussed beginning with my loki's post #6 in the following thread in the PC Software Tech forum ... http://www.flightsim.com/vbfs/showthread.php?p=1172520&highlight=journalling#post1172520.
But in answer to your question, no, write-behind drive-level caching simply makes matters worse when it comes to anything that might cause a drive to lose power.
Paperflyer
05-23-2008, 10:37 AM
So, reading through your thread I conclude that we agree that
- write caching is a hardware feature
- journaling is a software feature
- every hard drive supports write caching
- every major filesystem supports journaling
Of course, write caching and journaling are completely not related to each other.
Write caching is a technique to minimize hard disk seek time by ordering pending write/read-operations so that the write-heads have to move as little as possible. For example, if one file is fragmented to the beginning and the end of the disk and another file is in the middle, it is more efficient to firstly read the first chunk of the first file, then the second file, then the second chunk of the first file. Without write caching, one would first read the whole first file, then the second file, which would take about 150% of the time.
Journaling is a technique that memorizes all pending read/write-operations and checks if they were completed successfully. For example, it memorizes that a file should be updated. The hard drive then starts to search for free memory, write the new file to that memory and then frees the old memory. If this process got interrupted while writing the new file, the journaled file system will discard the half-written new copy and continue working with the old one. If it got interrupted while freeing the old file, the file system will note that it was not freed and continue to do so when the computer is restarted.
So write caching is a performance hack and journaling makes sure that the file system always makes sense.
Of course, write caching can be a security risk, in that single read/write-operations take generally more time and so the risk of a power loss in that time is greater. But this is something that journaling easily fixes in that it absolutely assures that a failed read/write-operation does not make the file system inconsistent.
If the power loss occures during a write, neither write caching nor journaling will rescue the not-written data. However, without journaling, there is that half-written new file that the file system is not able to deal with. With journaling, it knows that it is a broken chunk of data and will discard it, thus avoiding errors.
Anyway, I did not experience a power loss in years. Are they more frequent in the US?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.