Jump to content
Forums in Read-Only Mode - Please use Reddit ×
  • 0

Reinstall to secondary partition


uudruid74

Question

How can I reinstall my whole system, with new USE/CFLAGS, to a new partition/root?  Basically, I want one set of USE/CFLAGS on one partition and another on the second, but all the packages the same and without going through a lot of manual configuration.  Basically, I want to keep an optimized "just my hardware" install, and have a second one thats generic (or least any x86-64).

 

I'm thinking that I should be able to untar the stage3 to the new partition, bind /usr/portage to the new root, chroot in and run emerge with whatever flags required to tell it to rebuild EVERYTHING (anyone know what flags that would be offhand?).  I'll be adding the flag to generate binary packages as well so I can reinstall to other machines quickly, giving me sane starting point for other installs.

 

Questions:

  1. Where is the package database stored, since I have to make sure this is seen by the new root?  Likely, I need to copy this, not bind it, because ...
  2. Since the system stores what USE flags things were compiled with, I need to be sure this is separate between the two systems.  Anyone have advice on to make sure this is done "correctly"?
  3. Suggested emerge flags for this?
  4. Other comments and suggestions are welcome!

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Thanks for the info, but I don't want a tar of an existing system as a huge tarball.  Although I suppose that I could simply copy the entire system, then re-emerge it all with the new flags to force the rebuild.  That may be the better way to do it.

 

Would you happen to know the full list of emerge flags for "rebuild my whole system, every last package, because I change USE flags and CFLAGS?" command line would be.  I'm thinking once I get it to my liking I'll build a set of binaries and then find some duct-tape and bailing wire to graft an installer and a liveCD/DVD into the mix.

Link to comment
Share on other sites

  • 0

Thanks for the info, but I don't want a tar of an existing system as a huge tarball.  Although I suppose that I could simply copy the entire system, then re-emerge it all with the new flags to force the rebuild.  That may be the better way to do it.

 

Would you happen to know the full list of emerge flags for "rebuild my whole system, every last package, because I change USE flags and CFLAGS?" command line would be.  I'm thinking once I get it to my liking I'll build a set of binaries and then find some duct-tape and bailing wire to graft an installer and a liveCD/DVD into the mix.

I would do it in two steps, base system, and then @world

 

emerge -avNe --with-bdeps=y @system

emerge -avNe --with-bdeps=y @world

-N for new USE flags, -e for empty tree:

"-emptytree (-e)

Reinstalls target atoms and their entire deep dependency tree,

as though no packages are currently installed. You should run

this with --pretend first to make sure the result is what you

expect.

"

WARNING: You might bump into some bugs when doing a full rebuild, or compilation might strangely stop, the only time I have done this, it took 4 'emerge --resume' to get it done.(But I have limited ram and not much cores, I blame it on that)

 

PD: you can migrate your current system to another partition like you would take a VM and run it bare-metal, just make sure the boot process is correct.(fstab and bootloader configuration mainly)

Link to comment
Share on other sites

×
×
  • Create New...