Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which directories of a Gentoo system to back up?
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
ayqazi
Apprentice
Apprentice


Joined: 10 Apr 2005
Posts: 164

PostPosted: Sat Feb 25, 2006 5:33 pm    Post subject: Which directories of a Gentoo system to back up? Reply with quote

Hi,

I want to back up my Gentoo system. I need to know which directories I can leave out, since they will be regenerated at boot if I have to restore a backup.

I'm NOT backing up my /home directory, since that's on a separate partition, and I can simply log on as root, mount -o ro,remount /home and then back it up.

So, not counting home, here's the directories I'm not going to back up, and I'd like your comments on it:
/var/log : regenerated when syslog-ng starts?
/tmp: obvious reasons
/var/tmp: obvious reasons

/usr/portage/distfiles: don't need this, do I?

I'm thinking of /usr/portage/distfiles - shouldn't it be somewhere else by default? like /var/portage/distfiles? /usr could be mounted read-only, after all.

Thanks
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Feb 25, 2006 6:06 pm    Post subject: Re: Which directories of a Gentoo system to back up? Reply with quote

ayqazi wrote:
I want to back up my Gentoo system. I need to know which directories I can leave out, since they will be regenerated at boot if I have to restore a backup.


You can (and probably should) leave out /dev, /sys, /proc.

I would keep /var/log, as already logged information can not be regenerated. If you do not need old logs, rather than just not backing them up, you could just as well delete them. If you can't delete them, you need them, so back them up. Weird logic, huh. Anyway, you never know when you need the logs. I had some issue recently and solved it using the logfiles, because they pointed me to an error I made weeks earlier without me noticing before. They don't take up that much space when compressed, so... it doesn't hurt.

ayqazi wrote:
/tmp: obvious reasons
/var/tmp: obvious reasons


Yeah, no need to keep these. Any program that stores stuff in a tmp directory and expects the stuff to be there after reboot, I would consider such behaviour a bug.

ayqazi wrote:
/usr/portage/distfiles: don't need this, do I?

I'm thinking of /usr/portage/distfiles - shouldn't it be somewhere else by default?


No need to backup as long as you have internet access to download the stuff again. The location of distfiles can already be configured in make.conf (I think). /usr is not read-only by default, so I don't really see a problem here.
Back to top
View user's profile Send private message
Ferdinando
Veteran
Veteran


Joined: 25 Nov 2003
Posts: 1027
Location: Gaeta (LT) - Italy

PostPosted: Sat Feb 25, 2006 6:11 pm    Post subject: Re: Which directories of a Gentoo system to back up? Reply with quote

ayqazi wrote:
I'm thinking of /usr/portage/distfiles - shouldn't it be somewhere else by default? like /var/portage/distfiles? /usr could be mounted read-only, after all.

Well, I keep my distfiles in /var/tmp/distfiles just because it seems right to me, but if you mount /usr read-only you can't sync anymore and so your portage is frozen. Anyway you could still mount /usr/portage/distfiles as rw, and even in tmpfs so they get lost at every reboot (I don't like keeping large distfiles for too long in my system, since I can always download them again).
BTW, I wouldn't leave /var/log/ out of the backup, you could have to restore it because of an attack which among other things destroyed your /var/log/messages not to leave traces behind; it would be useful to have a look at the latest valid logs to analyze what happened.

Bye
_________________
La risposta, non la devi cercare fuori, la devi cercare dentro di te: e però è SBAGLIATA!
-- Corrado Guzzanti, "Pippo Chennedy Show", 1997
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Feb 25, 2006 6:12 pm    Post subject: Reply with quote

PS: If you're *really really really* low on backup space, you could also leave out all system binaries and programs that were generated by Portage, and keep just the dynamic data (Portage database, other stuff in /var, and whatever else you have). For a full restauration of the system, you'd then have to re-emerge all programs you had installed before (emerge -e world, you can get a working emerge by doing a basic Gentoo Stage installation). This way the procedure will take some time though.
Back to top
View user's profile Send private message
ayqazi
Apprentice
Apprentice


Joined: 10 Apr 2005
Posts: 164

PostPosted: Sat Feb 25, 2006 8:44 pm    Post subject: Reply with quote

Point taken on /var/log, but backing them up while the system is running seems a bit too.... sorry, I've been using Linux for 10 years or so, and I'm still nervous about touching in-use files. ME BAD, ME BAD *slap*

As for the last point about just dynamic data - I'm not going through that installation process again! :-)

And point taken about not being able to update portage if /usr is readonly - which makes me wonder, wouldn't /var/portage have been a better location for the portage tree? And /usr/local/var/portage the overlay? /var being where dynamic system data is kept by standard? Doesn't matter really, just nitpicking....

Thanks - will start 'tar --multi-volume'ing onto iso images that then go onto DVDs ASAP, and will include /var/log :-)
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Feb 25, 2006 9:29 pm    Post subject: Reply with quote

Well, it's a question of style, and can not be really answered.

Is the Portage tree dynamic data? Actually, it's pretty static - it only changes when you want to update your system, and when you do that, other packages will change too (as they get replaced by a new version), so in a sense, everything is dynamic and everything isn't. From another point of view, it is static as well, because it's man-made, not randomly generated by some logging facility or random acts of user. From a practical point of view, the main reason not to put it in var is that var contains mostly very important data (like the Portage database, user mails, etc), and I prefer it to be small and light so I can back it up fast and frequently. I don't need another 500MB of Portage in there, thanks.

As far as I know, pretty much all paths and stuff can be set in make.conf, so you're free to change whatever you do not like.
Back to top
View user's profile Send private message
opopanax
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 244

PostPosted: Sat Feb 25, 2006 9:58 pm    Post subject: Reply with quote

frostschutz wrote:

Is the Portage tree dynamic data? Actually, it's pretty static - it only changes when you want to update your system, and when you do that, other packages will change too (as they get replaced by a new version), so in a sense, everything is dynamic and everything isn't. From another point of view, it is static as well, because it's man-made, not randomly generated by some logging facility or random acts of user.


So, what you're saying is, the Heisenberg Uncertainty Principle can be applied to Gentoo as well? :-)
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