View previous topic :: View next topic |
Author |
Message |
jan205 n00b
Joined: 21 Oct 2010 Posts: 1
|
Posted: Thu Oct 21, 2010 11:25 am Post subject: btrfs and auto snapshots |
|
|
Hi all,
i am trying to create automatic snapshots at boot time. I wrote a little script to create the snapshots but I am stuck at the point how I have to include this in the boot process.
The best possible solution for me would be to create the snapshots right after all file systems are mounted and before other processes are started. Another option is to create the snapshots on shutdown right before the file systems are unmounted.
My goal is to boot into these snapshots on system errors. So if there are better solutions available please let me know.
Many thanks in advance for any ideas. |
|
Back to top |
|
|
dermund Apprentice
Joined: 28 Aug 2007 Posts: 205 Location: Sprawl
|
Posted: Mon Nov 08, 2010 7:32 pm Post subject: |
|
|
Hello jan205 and welcome to the gentoo-forums,
Quote: | The best possible solution for me would be to create the snapshots right after all file systems are mounted and before other processes are started. |
That seems like a good idea.
The cleanest way would be imho to create a new init-script that generating the current snapshot and let rc execute it at the right moment in the boot process. That would be before the "localmount" service in the initial runlevel "boot". (you probably know "rc-update show")
Do you know how to handle init-scripts? Anyway here is the part of the "Gentoo handbook" that covers "creating init-scripts"?
The script don't have to be overcomplicated - just look at the "depend()" and "before" in the guide.
If you're on baselayout-2 the initial runlevel is sysinit. Your script should go there, then.
You could also mod existing init-scripts - but I think that's ugly.
How many snapshots do you want to keep at a time? If you're turning to your snapshots at grub-time, you should at least have two.
Otherwise you have just overwritten the snapshot that was sane, if you're realizing that your system is now insane after boot
Or do you see a way btrfs could turn that situation to good again? |
|
Back to top |
|
|
|