Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
btrfs and auto snapshots
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jan205
n00b
n00b


Joined: 21 Oct 2010
Posts: 1

PostPosted: Thu Oct 21, 2010 11:25 am    Post subject: btrfs and auto snapshots Reply with quote

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
View user's profile Send private message
dermund
Apprentice
Apprentice


Joined: 28 Aug 2007
Posts: 205
Location: Sprawl

PostPosted: Mon Nov 08, 2010 7:32 pm    Post subject: Reply with quote

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 :D
Or do you see a way btrfs could turn that situation to good again?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum