I have a linux guest with two disks for / and /home. /home is a write-through disk to keep data safe of snapshot restoring.

The problem is that the live snapshot corrupts /home data when restoring it. Probably this is caused by linux cache, because if I add some changes to /home and then I restart the machine, the changes are still there. I have tried to mount /home with the option sync, but this didn't solve the problem.

These are the steps to reproduce it:

  1. Start a guest linux with a write-through disk mounted as /home
  2. When you are logged in to your account, take a live snapshot
  3. Create a file in /home, e.g. $ echo 1 > ~/test.txt
  4. Close the machine and restore the new created snapshot.
  5. Start again the machine.
  6. $ ls -l ~/
  7. The file test.txt has disappeared...
  8. If you remount /home you will find it but corrupted. A $ ls -l ~/ will show you something like
    -????????? ? ? ? ? ? test.txt

Is there any way to solve this problem?

Thank you.


You'd need to use filesystem for /home that is freezable and thereby snapshot friendly. XFS has a very reliable freeze/unfreeze mechanism. So if you format your /home partition with xfs, you could use the following procedure.

$ xfs-freeze -f /home
<do the snapshotting>
$ xfs-freeze -u /home

I haven't tried this with virtualbox but we do something very similar on our production database instances for taking snapshots of our mysql db.

  • Sorry by being too late. This helped me. Thank you, kashyap.
    – Fenrir
    Oct 17 '13 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.