Results 1 to 2 of 2

Thread: Drive Write Behind Caching And Journaling

  1. #1
    Join Date
    Jul 2005
    Location
    At the edge of the foothills west of Denver, Colorado, USA.
    Posts
    5,440

    Default Drive Write Behind Caching And Journaling

    Paperflyer,

    In the UPS thread in the Hardware forum, paperflyer wrote ...

    Quote Originally Posted by Paperflyer View Post
    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/showth...ng#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.
    Last edited by xxmikexx; 05-23-2008 at 07:43 AM.
    Digital abstract art copyright 2010 Mike McCarthy, all rights reserved.

  2. #2
    Join Date
    Jul 2007
    Location
    Oldenburg, Niedersachsen, Germany.
    Posts
    87

    Default

    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?
    Last edited by Paperflyer; 05-24-2008 at 12:21 PM.
    Greetings from northern Germany,
    Bastian

Similar Threads

  1. Tileproxy Caching
    By tigisfat in forum FSX
    Replies: 7
    Last Post: 06-19-2008, 03:33 PM
  2. Runnig FS2004 on second hard drive, drive D
    By dandivine in forum PC Hardware, Video And Audio Help
    Replies: 3
    Last Post: 09-04-2006, 01:04 PM
  3. i decided ill keep this spywared drive and protect myself on a new hard drive?
    By flightsimmer747 in forum PC Hardware, Video And Audio Help
    Replies: 3
    Last Post: 02-18-2005, 06:30 PM
  4. Caching Vs Direct
    By caspernzl in forum FS2004
    Replies: 3
    Last Post: 10-03-2004, 12:53 PM
  5. Caching Scenery
    By leffepojken in forum FS2002
    Replies: 4
    Last Post: 02-25-2003, 08:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •