Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chroot from existing Linux system
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
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Tue May 29, 2007 8:29 pm    Post subject: Chroot from existing Linux system Reply with quote

Hi all, I have 2007 base system installed but want to do my installs from a live system (pcLinux) so that I can do more than look at a scrolling screen for 2 days. Is there a way to work through a terminal from pclinux?

Thanks
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
thorpe
l33t
l33t


Joined: 09 May 2005
Posts: 618
Location: Sydney, Australia.

PostPosted: Tue May 29, 2007 10:23 pm    Post subject: Reply with quote

Quote:
Is there a way to work through a terminal from pclinux?


Of course, just follow the handbook. This guide also helps as there is a slightly different method used to chroot..
_________________
Research before taking any advice from me. I'm still coming to grips with this myself.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Wed May 30, 2007 1:43 am    Post subject: Reply with quote

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=6

A direct link to chrooting from the handbook. A good idea might be to make a shell script to automate the process to save yourself time. I've done this because I am having to emerge stuff in chroot since Gentoo on my system currently can't connect to the internet.

Best of luck!
Back to top
View user's profile Send private message
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Wed May 30, 2007 6:20 am    Post subject: re: Chroot from existing Linux system Reply with quote

Here's the procedure that I used:

mount -t proc none /mnt/gentoo/proc
ok
cd /mnt/gentoo
ok
chroot /mnt/gentoo /bin/bash
ok
env-update
ok
source /etc/profile
Permission Denied

TIA
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Wed May 30, 2007 7:06 am    Post subject: Reply with quote

So I'm assuming you were root before these commands were entered?

Try this:

log in as root, probably 'sudo su'

Then

Code:

mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"


Do that exactly and what do you get?
Back to top
View user's profile Send private message
thorpe
l33t
l33t


Joined: 09 May 2005
Posts: 618
Location: Sydney, Australia.

PostPosted: Wed May 30, 2007 3:50 pm    Post subject: Reply with quote

Dont just simply use...

Code:
chroot /mnt/gentoo /bin/bash


either. You need to make sure the environment is clean.

Code:
env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash

_________________
Research before taking any advice from me. I'm still coming to grips with this myself.
Back to top
View user's profile Send private message
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Wed May 30, 2007 6:29 pm    Post subject: Reply with quote

GivePeace, Thank you that seemed to do the trick.
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Wed May 30, 2007 7:43 pm    Post subject: Reply with quote

Just a tip that I've been told. Might want to add [SOLVED] to the first post's subject just so people know you don't need any more help on this topic. :)
Back to top
View user's profile Send private message
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Thu May 31, 2007 1:28 pm    Post subject: Reply with quote

I'm still having a problem. When I try to compile a program it picks up the environment of the host computer, ie: the qt libraries on the gentoo partition are located at /usr/qt/3. On the PcLinux partition they are located at /usr/lib /qt. The result is the compiling program not being able to find the qt libraries and ends with an error. This happens whether or not I issue the env-update command or not. Is there any way to resolve this? Here are the commands that I use when entering the genntoo partition:

mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"

TIA
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
thorpe
l33t
l33t


Joined: 09 May 2005
Posts: 618
Location: Sydney, Australia.

PostPosted: Thu May 31, 2007 1:53 pm    Post subject: Reply with quote

Did you read my last reply?
_________________
Research before taking any advice from me. I'm still coming to grips with this myself.
Back to top
View user's profile Send private message
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Thu May 31, 2007 3:04 pm    Post subject: Reply with quote

thorpe, when I issue the following commands I get an error:

mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash

env: chroot: No such file or directory

TIA
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
ronvenema
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 160
Location: Dewey, Az

PostPosted: Thu May 31, 2007 3:19 pm    Post subject: Reply with quote

thorpe, figured it out you have to break it up into 2 commands:
chroot /mnt/gentoo /bin/bash
env -i HOME=$HOME TERM=$TERM

This then gives me the correct environment speciifally the correct location for the qt libraries. So the complete command setup would be:

mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env -i HOME=$HOME TERM=$TERM
source /etc/profile
export PS1="(chroot) $PS1"

I'm continuing the build of kde-meta and so far no errors.

TIA
_________________
Frustration leads to knowledge.
Back to top
View user's profile Send private message
thorpe
l33t
l33t


Joined: 09 May 2005
Posts: 618
Location: Sydney, Australia.

PostPosted: Thu May 31, 2007 3:43 pm    Post subject: Reply with quote

Quote:
thorpe, when I issue the following commands I get an error


You shouldn't. That line of code is taken directly from the alterntate install guide I linked to in my first reply. Its the same command I use everytime I install Gentoo as I always install from a working Linux.
_________________
Research before taking any advice from me. I'm still coming to grips with this myself.
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