data consistency

I have a disk filter which intercepts the writes to to several small drives d (with NTFS volumes on it) and instead writes them to a much larger drive D. I have an in-memory table that records the sectors of d to sectors of D mapping. Later at some time data from D are written to appropriate d. I need to make this mapping table changes persistant so that in case of sudden power failure I’m able to get the correct data back for each small drive D. Any suggestions on how often or at what time I should be writing these changes? Thank you very much.

If you intend to tolerate power fail then you have to write your table
out with every write operation. You could use the vss facilities to
checkpoint volume state and write out your sector map table as part of
that operation, however volumes and disks do not map one to one so
that gets complicated. Also if you are tolerating power fail you
probably have to tolerate D or d disk failures too, so at a minimum
you have to replicate D and your sector map table.

On Tuesday, May 4, 2010, wrote:
> I have a disk filter which intercepts the writes to to several small drives d (with NTFS volumes on it) and instead writes them to a much larger drive D. I have an in-memory table that records the sectors of d to sectors of D mapping. Later at some time data from D are written to appropriate d. I need to make this mapping table changes persistant so that in case of sudden power failure I’m able to get the correct data back for each small drive D. Any suggestions on how often or at what time I should be writing these changes? Thank you very much.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Thank you Mr. Roddy. Writing the map table at every write becomes expensive and hence the reason to post on the forum :slight_smile: This probably becomes filesystem question - I noticed that requests to a $log file is done with WRITE_THROUGH flag - is $log file used by NTFS to record transactions and used for recovery? If yes will it be enough for NTFS if I write my map table before completing a write request with WRITE_THROUGH flag? Thank you.

If you are redirecting at the disk level you have no visibility to
filesystem writes nor anyway to correlate them with specific disk writes. I
suppose you could implement a fiilesystem filter driver that communicates
some state to your disk IO redirector. I have no idea how consistent NTFS is
or is not based on logfile writes - ask over in ntfsd.

The volume snapshot facility within VDS provide a mechanism to establish
volume level consistency and you could coordinate that with your disk level
redirector, however as I said that is rather complicated and not entirely
well documented. That approach would allow you to roll back to the last
snapshot point on catastrophic failure, assuming that you also can tolerate
the other failures I mentioned, without having to guess if NTFS is in a
happy place.

Mark Roddy

On Tue, May 4, 2010 at 12:26 PM, wrote:

> Thank you Mr. Roddy. Writing the map table at every write becomes expensive
> and hence the reason to post on the forum :slight_smile: This probably becomes
> filesystem question - I noticed that requests to a $log file is done with
> WRITE_THROUGH flag - is $log file used by NTFS to record transactions and
> used for recovery? If yes will it be enough for NTFS if I write my map table
> before completing a write request with WRITE_THROUGH flag? Thank you.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

ok. Thanks.