Lock Windows Disk for Backup (EC2 Snapshots)

An option for you is to leverage Shadow Copy in Windows. The Shadow Copy process itself drains any write-buffers before committing its own snapshot. Schedule it to take a snapshot a minute or two before the EC2 snapshot. That way when the EC2 snapshot fires you have a recent, consistent copy already in the system.


I can't answer about how to lock the disk so Windows doesn't write or force the flush so this will be a half answer, but there is one relevant piece of information your question doesn't note:

The ec2-snapshot process is instantaneous. You don't have to wait for it to finish! Once you start it, you can start using your disk again and the snapshot will still get the data at the point of the snapshot, not the current state. This happens because once you tag it for snapshotting, all NEW data written to the disk is queued in a kind of overlay disk and the data at the time of you asking for a snapshot is preserved.

That should make it easier for your other problem. All you need to do is flush to the disk to get everything consistent, then pause for a couple seconds while you make sure the snapshot API returned a success code so you know the process kicked in, then you can go back to your writing.