View previous topic :: View next topic |
Author |
Message |
artworcs Tux's lil' helper
Joined: 12 Jun 2005 Posts: 126
|
Posted: Wed Dec 21, 2011 11:51 am Post subject: Clean up system with emerge --root |
|
|
I have a very old ~x86 install(2004) that's seen a few drive switches, 1 computer switch and a reiser4 crash(lost half of /, had fun fixing it )
I just got an SSD drive and instead of the usual copy i was thinking of emerging the system from scratch into a different directory.
Basically what I want to do is something like:
Code: |
emerge -e --root=/mnt/new_root world
|
followed by manual copy of the config files in /etc.
Does anyone have any experience with something like this? Any tips to watch out for? |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
artworcs Tux's lil' helper
Joined: 12 Jun 2005 Posts: 126
|
Posted: Wed Dec 21, 2011 1:48 pm Post subject: |
|
|
I think I didn't make myself clear, I've been updating constantly. I've never been more then a few weeks out of sync.
There is no way I'm reinstalling. I'll sooner migrate to another distro then start from scratch.
For the moment, things are going well: Jobs: 253 of 531 complete. |
|
Back to top |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Wed Dec 21, 2011 2:10 pm Post subject: |
|
|
I was just wondering what the up- or downside of your method opposed to a standard stage3 install with a copied over world file is.
IMO, if you are running stable, the stage3 install would have been faster, while on a unstable (~x86) the time would be the same.
V. _________________ read the portage output!
If my answer is too concise, ask for an explanation. |
|
Back to top |
|
|
artworcs Tux's lil' helper
Joined: 12 Jun 2005 Posts: 126
|
Posted: Wed Dec 21, 2011 2:31 pm Post subject: |
|
|
I like to experiment and this is something I still haven't done. But really I feel that my system is full of cruft with some many years of updating and I want to get rid of that. After portage is done I plan on reusing /etc and most of /var.
The only reason I made this post is in case I missed something and there's more to a system then just the packages. I really hope someone doesn't come and say something like: you first need to download xyz and extract it in / or the asdf metadata will be corrupt and you can't regenerate it. |
|
Back to top |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Wed Dec 21, 2011 2:42 pm Post subject: |
|
|
Well, I am not an expert on the subject, but I was recently messing with gentoo/fbsd on amd64, which also uses the --root approach. the first thing, that they installed, was baselayout, then the entire rest. also at a later stage when building the catalyst stage, it was always baselayout first (IIRC then portage) and the rest (i.e system).
but there were some additional quirks with build useflags.
Please post you results. I always like the know other ways on how to do things...
V. _________________ read the portage output!
If my answer is too concise, ask for an explanation. |
|
Back to top |
|
|
artworcs Tux's lil' helper
Joined: 12 Jun 2005 Posts: 126
|
Posted: Wed Dec 21, 2011 9:33 pm Post subject: |
|
|
Small update. For some reason, it seems that Code: | emerge -e --root world | is not taking the hosts packages and install them into root, it only takes a random selection... I knew there was something wrong with just 500 or so packages.
But, I have copied /etc/portage and my world file to the new partition and we're up to 1.5k packages. Yeah! |
|
Back to top |
|
|
yoshi314 l33t
Joined: 30 Dec 2004 Posts: 850 Location: PL
|
Posted: Fri Dec 30, 2011 1:26 pm Post subject: |
|
|
artworcs wrote: | Small update. For some reason, it seems that Code: | emerge -e --root world | is not taking the hosts packages and install them into root, it only takes a random selection... I knew there was something wrong with just 500 or so packages.
But, I have copied /etc/portage and my world file to the new partition and we're up to 1.5k packages. Yeah! |
emerge --root basically installs only runtime deps into target directory. or at least it used to, last time i did this.
packages build against the host system, but only necessary runtime dependencies end up installed into --root dir.
this feature is useful for making small installations with gentoo, and was mentioned a couple of times in some guides. _________________ ~amd64
shrink your /usr/portage with squashfs+aufs |
|
Back to top |
|
|
artworcs Tux's lil' helper
Joined: 12 Jun 2005 Posts: 126
|
Posted: Fri Dec 30, 2011 1:51 pm Post subject: |
|
|
UPDATE:
I finally managed to find some free time to continue with my little project. I managed to get a bootable system after I solved some missing device node problems. I did all my testing in qemu with the text interface, so I can't test X, but everything else seems to be working.
The steps required are:
- emerge --root -e world
- copy over the portage configuration files(make.conf, package.*, world)
- chroot && emerge -uD world (at this point you should have all the packages)
- it is important to use build as use flag for baselayout at some point(probably at the beginning, I only did it half way)
- make sure you have CONFIG_DEVTMPFS in your kernel or use mknod for /dev/console
For all the other config files in /etc I did a big diff and only copied what I wanted.
My big surprise came when I examined the difference in /etc. I was expecting to have accumulated a significant amount of garbage, but that is not so. I had very few files that were unaccounted for, portage really does do an excellent job of cleaning up. Since then I also compared /usr and there is again almost no difference.
Taking into account that this box was continuously updated from 2004, i am very surprised to find it as clean as a new install.
NOTE: Clearly I am not talking about /var here.
TL;DR: it works, but totally unnecessary. |
|
Back to top |
|
|
Dr.Willy Guru
Joined: 15 Jul 2007 Posts: 547 Location: NRW, Germany
|
Posted: Fri Dec 30, 2011 5:33 pm Post subject: |
|
|
artworcs wrote: | TL;DR: it works, but totally unnecessary. |
Portage tracks all files that were installed by an ebuild. Just list all files installed by portage and compare them to the actual disk contents. |
|
Back to top |
|
|
dol-sen Retired Dev
Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
Posted: Sat Dec 31, 2011 3:15 am Post subject: |
|
|
I just recently created a new emaint module to clean out stale/old entries in var/lib/portage/config. config is used by portage so as to not keep multiple copies of configs to update, etc.. It will clean out entries of files that no longer exist on your system as well as entries that do not match the md5sums of the files they point to.
It is not yet merged into portage. It is part of a more modular rewrite I did to the emaint code. If you want to test it. It can run from the git checkout without needing to be installed. You can get it here. Code: | emaint -c cleanconfig
emaint -f cleanconfig | The more testing it gets, the better You can back up the file before running to be sure. On my system which is only a couple years old. It cleaned out about 60 entries in total. On anther person's install that has been going for many years like yours, it cleaned out around 150 entries (before I added the mismatch cleaning). _________________ Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch... |
|
Back to top |
|
|
|