Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to backup distfiles for reinstall ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
k0OA1
n00b
n00b


Joined: 15 Jul 2014
Posts: 13

PostPosted: Sun Aug 10, 2014 9:24 pm    Post subject: How to backup distfiles for reinstall ? Reply with quote

Hi

I have to reinstall Gentoo because I made some changes and I'm puzzling over how to reverse what I did.

I have a directory of portage distfiles I want to use on the new system to avoid re-downloading and I read here that I can just copy them into the new directory and run 'emerge -u world'.

For the new install I'd like to try the Hardened version, and if I do, will 'emerge --ask hardened-sources' work to restore distfiles from the previous install ? or is there a better way to do this ? or any advice for instructions ??

I would prefer not to reinstall everything restored to the distfiles directory, instead be able to do a fresh install and have any required sources ready to go. Is this possible ?


Thanks for reading, and for any help,


Al
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sun Aug 10, 2014 9:39 pm    Post subject: Reply with quote

k0OA1,

Save /usr/portage/distfiles to a USB drive. While you are at it, save /home too.
You can usefully save /etc as a reference for your new install but not to reuse it.

hardened-sources is only part a hardened system. You need a hardened toolchain too.
Its all provided by the hardened stage3.

I'm not sure if hardened-sources is the gentoo-sources plus a patch or a whole new kernel.
Most of /usr/portage/distfiles is common to every platform that Gentoo runs on, so much of it will be reused.

To run emerge -u world on the new install you also need to move your existing world file over.
Its at /var/lib/portage/world
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun Aug 10, 2014 9:45 pm    Post subject: Reply with quote

Quote:
I have to reinstall Gentoo because I made some changes and I'm puzzling over how to reverse what I did.
I think we all did that at least once. Your in good company.
Quote:
I have a directory of portage distfiles I want to use on the new system to avoid re-downloading and I read here that I can just copy them into the new directory and run 'emerge -u world'.
This is more or less correct. What /usr/portage/distfiles does is store the source code. Portage really doesn't care how it gets there as long as it has the correct name, correct hash, and correct permissions. There is no need to do anything special after copying it. If portage can't find the file there it will download the sources from the web.

What you are talking about is perfectly fine. I would copy the distfiles after you emerge-websync. You shouldn't have to do anything special at all after that. If you copied the source you won't have to download it.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sun Aug 10, 2014 10:24 pm    Post subject: Reply with quote

When last I looked, the hardened-sources ebuild fetched of the vanilla sources tarball, the genpatches tarball that converts vanilla sources into gentoo sources, and the hardened sources tarball that contains a patch to apply the grsecurity changes.
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Mon Aug 11, 2014 12:42 pm    Post subject: Reply with quote

You can quite easily copy /usr/portage/distfiles over as mentioned above as this is still nice and simple :)

Note however that this WILL NOT copy your portage configuration across, only the source files. This means you will save a crap-ton of time not having to re-download all of them but you will STILL have to manually emerge needed packages.

You can, as Neddy says, copy the world file over, but if I was you I'd use that as a guide for manually emerging things. I can almost guarantee you that if you just copy the world file over and tell it to rebuild from that, you'll have an awesome tangle of blockers and failures and other fun to deal with.

If your dead system was relatively young and clean, you can risk it, but if it is quite old and/or has a lot of stuff installed, then don't - There is a high probability it will require more time to untangle everything than if you had just done it by hand!

Also, install demerge and use it to snapshot things as you go; It is a fantastic tool for undoing botched emerges (e.g. when testing out different DEs that install 900 bazillion packages, and then deciding you don't like that DE - It is so much safer to undo that using demerge than using --depclean, and so much faster than carefully removing it by hand!)



Out of curiosity, what did you do that broke the system so badly that you feel you need to rebuild it from scratch?!
Back to top
View user's profile Send private message
k0OA1
n00b
n00b


Joined: 15 Jul 2014
Posts: 13

PostPosted: Tue Aug 12, 2014 12:09 am    Post subject: Reply with quote

Thanks everyone, I'm back up and running !!

I restored the distfiles from previous install over to the new one and Portage was able to use those packages no probs.


Cyker wrote:
Out of curiosity, what did you do that broke the system so badly that you feel you need to rebuild it from scratch?!

I reconfigured the kernel with xen support and networking tweaks. But I'd also been working on the system for a few hours so had also done a config files update amongst other things. Anyway when I restarted to use the new kernel I couldn't use the network or log in with that kernel or any other. I reinstalled a bunch of things and reverted configs but It ended up being a choice of re-emerging world with a fresh kernel and risking the same problem, or reinstalling everything on a blank slate.



cheers,

Al
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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