5

I wonder is it possible to capture the state of the machine without actually hibernating? The goal would be to make a "backup state", so if the system crashes, one could boot directly to a session with all the windows opened, all the tabs in the browser restored etc.

I think it might not be doable -- saving a snapshot of the memory, then changing the data on the hard drive, and then again restoring the snapshot would result in broken file descriptors etc. For example, a process opened a file before the snapshot was taken, and when the snapshot was restored, the file is no longer existing.

But maybe there is an ingenious way of solving that?

5
  • 1
    Good question. For this I use VirtualBox :) Oct 8, 2012 at 19:46
  • 1
    I use vbox for Windows, but maybe I should reverse the situation. I am having a lot of problems with my Lenovo and 12.04 (freezes, crashes, system not waking up etc., pretty randomly).
    – January
    Oct 9, 2012 at 5:17
  • @EvandroSilva Do you do all your work in VirtualBox? Isn't Ubuntu installed under VirtualBox much slower that one installed directly on the machine? Oct 16, 2018 at 6:06
  • @AlwaysLearning these days, I use dual boot Oct 18, 2018 at 14:03
  • @EvandroSilva How does dual boot help you save the state of machine in Ubuntu? Oct 19, 2018 at 3:36

1 Answer 1

1

If you're willing to keep all of the mounted block filesystems completely untouched (that is, mounted only in read-only mode, as an ext4 journal will be modified even without any changes for example), and unmount others (eg NFS) before freezing, then yes.

You can use the kernel parameters noresume and resume= to specify whether you want to reboot into your frozen state or not.

The sequence would be:

  • To snapshot, suspend to disk, boot your system without resuming (noresume) or another system altogether (like a livecd), copy the swap partition elsewhere, then reboot with the correct resume= and use your system.

  • To go back to the frozen state, boot again with noresume or from another system, copy the swap partition back, then reboot with the correct resume= again.

I wouldn't recommend this though. Virtualization offers a much safer and tested way to achieve your results with fewer caveats.

1
  • By virtualization, you mean something like VirtualBox, right? But isn't Ubuntu installed under VirtualBox much slower that one installed directly on the machine? Oct 16, 2018 at 6:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .