Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How far with chroot
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
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Mon Apr 27, 2015 8:48 am    Post subject: How far with chroot Reply with quote

Hi,

I'm installing a fresh Gentoo on this box which is going to take a loooooong time, so I want to keep using the existing Gentoo until I have a fairly finished system to switch to.

Is there any reason not to do just about the whole installation process in chroot, rather than just the initial steps. For example I have a rather old 2.6.32 kernel on this installation. Could that mean that some packages built with the running kernel inside the chroot will be broken or problematic when I reboot and go live?

Also the compilation seems pretty slow. Is there a large overhead switching back and forth the chrooted thread. I'm just text editing and forum browsing, but my activity is obviously requiring task switching.

I have not done any timing but I'm used to watching compiler output stream before my eyes on this hardware and the build processes look slow. Also an overnight run ( >6h ) did not seem to get much done. I was expecting the emerge I started to be done when I woke up and it was not even half way there.

TIA, Gentree. 8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Mon Apr 27, 2015 11:28 am    Post subject: Reply with quote

You should be able to complete everything from chroot. LFS is an example of GNU/Linux compiled and installed from chroot.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Mon Apr 27, 2015 11:54 am    Post subject: Reply with quote

Some ideas to boost performance:


  • Do you have as much RAM installed as the machine can handle? If not, spend some $ max the machine with RAM.
  • Do your browsing and editing in a nice'd shell, like perhaps 'nice startx'. Do your chroot in a separate non-niced shell.
  • Install and enable ccache as one of the first packages.
  • set up or remount heavily used partitions with noatime, like put the new /var/tmp on a separate partition with noatime.



HTH
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Mon Apr 27, 2015 4:38 pm    Post subject: Reply with quote

I just finished doing a start from scracthe. Using sysrescue I built 95% in the chroot. It ran fine. I have done the stage3 in chroot and then booted it and built the rest. saw now real difference besides useing links and nano as opposed to midora and geany.
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Apr 27, 2015 4:59 pm    Post subject: Reply with quote

Gentree,

You need a configured kernel sources in the chroot that can be found by following the /usr/src/linux symlink (inside the chroot)
That will prevent packages that build against the kernel falling back to the running kernel and breaking

udev, and external kernel modules come to mind.
_________________
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
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Mon Apr 27, 2015 6:56 pm    Post subject: Reply with quote

I can second bstaletic, been there, done that :lol:
It's up to you to decide when you reboot, so yes, you can do everything inside chroot if this fashion fits you better.

russK: your idea to give emerge higher priority than stuff you're interactivelu using is really really bad. Portage taking 5 minutes more or less over a few days long build makes no difference, while pointer lagging behind mouse movements makes it unusable. Never put batch jobs over interactive session, they are ment to consume everything you don't actively use.
Ccache is useless during build as there is nothing in it's cache yet. It only helps if you're doing heavy development and want to rebuild a single thing multiple times bisecting bugs and testing new features you're adding - assuming you're lucky enough not to get glitches from version missmatches between builds.
Finally, since you suggested getting more RAM, this is actually a good point. It's also a perfect place for /var/tmp/portage if one can afford it. I often set the limit to roughly 7GB out of 8 installed. It does well enough unless it attempts to build webkit and libre-office at the same time :lol:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Apr 27, 2015 7:30 pm    Post subject: Reply with quote

szatox,

If you have the RAM to put /var/tmp/portage into tmpfs, you don't actually need to do it.
The kernel disk cache will ensure that the disk writes are never read.
_________________
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
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Tue Apr 28, 2015 12:02 pm    Post subject: Reply with quote

ISTR that Gnome had a problem building in a chroot without dbus running. I don't know if that's still true.

On a Thinkpad T61, Core 2 T7500 @ 2.2 GHz, updating the system packages and building X takes
3 hours 30 minutes and Gnome another 4 hours 30 minutes. (X under chroot, Gnome booted to
a shell prompt.)

Will
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Tue Apr 28, 2015 7:36 pm    Post subject: Reply with quote

Neddy, I am aware of disk cache, it's awesome and cheap enough to make ssd mostly pointless, however the point was to avoid writes as well (it happens in the background, doesn't it?) Maybe I'm just too used to running emerge over NFS where IO does actually hurt.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Apr 28, 2015 10:36 pm    Post subject: Reply with quote

szatox,

Yes, your method saves the writes, which as you say are done in the background.
_________________
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
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