Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Easy way to copy all Gentoo configuration files?
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
Gooberpatrol66
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2014
Posts: 143

PostPosted: Wed Aug 03, 2016 2:13 am    Post subject: Easy way to copy all Gentoo configuration files? Reply with quote

Is it possible to copy a complete Gentoo configuration and build a new system with it?

So make.conf, worldfile, networking configuration, fstab, etc. except automated because I don't know the complete set of files necessary for a functioning system.

I've heard of stage4s but I'm not sure if that's what I want and I can't find any scripts to make them more recent than 2005.

It would be even better if there was a way to sync configuration files but allow system-specific changes to be made.
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Aug 03, 2016 7:42 am    Post subject: Reply with quote

That old script you refer to is probably at the link below, it should work fine.
All it does really is tar up all of your root partition.
If your are moving to different hardware I would suggest the following.

1: Ensure your current system is up to date.
2: Use the below script to stage4 the existing installation.
3: Boot your new system with live cd, setup and mount partitions as necessary.
--EDIT 3.5 Extract stage4 to new system.
4: Build a new kernel with the necessary options for the new hardware, Genkernel should sort this automatically once you remember to import the config it generates via live cd prior to building.
5: Obviously the Arch needs to be the same eg. x86, c86_64.

https://forums.gentoo.org/viewtopic-t-312817.html
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Wed Aug 03, 2016 7:48 am    Post subject: Reply with quote

Well, not to sound completely patronizing, but rsync is a good way to clone a system.

And rsnapshot is a good backup tool.
_________________
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
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Aug 03, 2016 8:39 pm    Post subject: Reply with quote

Has anyone mentioned that its a really bad idea to clone static IP addresses and the ssh host key?.
There are other bits and pieces that need careful thought too.
_________________
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
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Aug 03, 2016 8:50 pm    Post subject: Reply with quote

Indeed Neddy
The hostname should be changed to avoid dns resolution issues if you have a local dns server.
You should also clear the udev rules for the net otherwise your naming will be messed up if using persistent names
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Wed Aug 03, 2016 9:23 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Has anyone mentioned that its a really bad idea to clone static IP addresses and the ssh host key?.
There are other bits and pieces that need careful thought too.


Depends on whether or not, you are replacing the original machine. I just built a new machine two weeks ago, keeping only the DVD drive and the hard drive. I was able to keep the binaries because I was moving "up" from K8 to AMD 15h. I prepared the kernel ahead of time, using Generic x84 instead of my usual "use native" setting. After booting I rebuilt the kernel again, "emerge -1 gcc glibc" followed by "emerge -e world". the last stage took 13 hours for about 1000 packages. I probably should have included python in that first emerge.

Had to boot with sysrecuecd anyway because the new mobo had a Realtek network chip and I had to emerge net-misc/r8168 to get it to work. Retired the old ancient mobo. Next, need to replace the ten year old first generation SATA hard drive probably with ssd.

Same host name, same ip address. New mobo, memory, & CPU.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Aug 04, 2016 4:24 pm    Post subject: Reply with quote

Tony0945,

That works. My main use of cloning like this is to spawn another KVM from a clone_master that's little more than a stage3, with a kernel, boot loader, cron and logger.
I need to update my clone_master as its several years old now.
_________________
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
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Thu Aug 04, 2016 11:16 pm    Post subject: Reply with quote

NeddySeagoon wrote:
My main use of cloning like this is to spawn another KVM from a clone_master that's little more than a stage3, with a kernel, boot loader, cron and logger.
I need to update my clone_master as its several years old now.


If you clone to make an addition (real or virtual) machine, of course, your warning is well taken.
Back to top
View user's profile Send private message
phraktyl
n00b
n00b


Joined: 30 Nov 2016
Posts: 1
Location: Long Beach, CA

PostPosted: Wed Nov 30, 2016 6:02 pm    Post subject: Moving to a New Arch? Reply with quote

Quote:
5: Obviously the Arch needs to be the same eg. x86, c86_64.


I'm in a situation where I need to move from x86 to x86_64.

I've had a Gentoo Linude running for over a decade now. The issue started when Linode started migrating from Xen to KVM, which only supports x86_64. I'm also out on some of the newer Linode features and upgrades because I'm on a 32 bit architecture. I've read the posts about not doing an in place upgrade, as well as the posts that say "here's how I did it, but it's not recommended." Seems safer to start with a clean system.

I can create a new Linode and do a base x86_64 install, and connectivity between the two is fast. What's the best way after that to clone the configuration and data of a running system to the 64 bit machine? Major applications include PostgreSQL, Lighttpd, Postfix, and Dovecot.
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