1

Is it possible to programmatically trigger the Windows's Hibernate without actually Hibernating, just to take snapshot of the OS at regular intervals? So that the system can return to the previously saved state in case of any failure.

This is much like System Restore, which backups system files; but the idea is to backup the complete OS's active state.

  • This probably belongs on superuser – Gary Mar 06 '11 at 20:08
  • 1
    This isn't a suitable question for Programmers. However, if you could edit it to provide more details it would be easier to migrate it to one of our sister sites where it would find a better home. – ChrisF Mar 06 '11 at 20:24
  • 1
    @Gary It's about programmatically doing it, so it's probably more suitable for Stack Overflow. – Maxpm Mar 06 '11 at 22:57
  • @maxpm Yep. For some reason I missed the crux of the question. – Gary Mar 06 '11 at 23:45

3 Answers3

2

I don't believe something like that exists, but even if it did, I don't imagine you'd want to use it.

When you hibernate, the kernel freezes all user-mode processes while it takes a snapshot of memory. This can take 10-15 seconds depending on how much memory you have (and therefore how much it has to copy to disk). You don't normally notice this because Windows blanks the screen, but you've probably noticed that the "power" light stays on for a while longer after you hit the "hibernate" button.

So I can't imagine a use-case where freezing everything for 10-15 seconds is really desirable...

Dean Harding
  • 19,871
  • 3
  • 51
  • 70
2

No, I have never heard of anything like this. Also, there's (at least) one reason this would be quite tricky to pull off: If you want to save the entire state of the system, you also need to save the state of the harddisk, i.e. take a snapshot of all active partitions (since a file there might presently be open). If done naively, that would be prohibitively expensive. There are ways around this (e.g. FS support for snapshots), but it would be non-trivial.

Note that exactly what you want is already possible in most virtualization software programs; they usually support "snapshots".

sleske
  • 10,095
  • 3
  • 29
  • 44
0

VirtualBox has API to create snapshots, and does this quite fast. But 10-15 sec. delays are inevitable.

Dmitry Negoda
  • 513
  • 2
  • 8