LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 12-29-2010, 06:47 PM   #1
computerfreak97
Member
 
Registered: Dec 2010
Posts: 45

Rep: Reputation: 0
Failing to chroot in ch. 6.60


In chapter 6.60 of the book, when it says to chroot, I get an error of "chroot: cannot change root directory to : No such file of directory. I ran echo "$LFS" and it returned black (a newline). Since LFS wasn't reset since the previous chroot, that makes sense, but when I try to do chroot /mnt/lfs (what $LFS should be) it still errors with the same error, except the /mnt/lfs is before the colon.
 
Old 12-29-2010, 07:00 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

please copy+paste the exact input/output. What do the following commands return
ls -ld /mnt
ls -ld /mnt/lfs
find / -type d -name 'tools' -exec ls -ld '{}' \;
 
Old 12-29-2010, 07:06 PM   #3
computerfreak97
Member
 
Registered: Dec 2010
Posts: 45

Original Poster
Rep: Reputation: 0
I cant copy and paste the results but heres what it is:
ls -ld /mnt
Code:
drwxr-xr-x 2 root root 4096 Dec 28 04:47 /mnt
ls -ld /mnt/lfs
Code:
ls: cannot access /mnt/lfs: No such file or directory
find / -type d -name 'tools' -exec ls -ld '{}' \;
There are alot, but I think the important one is:
Code:
drwxr-xr-x 11 root root 4096 Dec 28 04:28 /tools
All of the other ones are in sources (and one in vim). I'm assuming that this means that I need to chroot to /, is that correct?

Last edited by computerfreak97; 12-29-2010 at 07:25 PM.
 
Old 12-29-2010, 07:28 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Code:
drwxr-xr-x 11 root root 4096 Dec 28 04:28 /tools
All of the other ones are in sources (and one in vim). I'm assuming that this means that I need to chroot to /, is that correct?
No, I think you are still chrooted! Either that or you did not build on a separate partiton.
Type 'exit' and post what happens. You should not get completely logged out.
 
Old 12-29-2010, 07:29 PM   #5
computerfreak97
Member
 
Registered: Dec 2010
Posts: 45

Original Poster
Rep: Reputation: 0
now it printed logout and gave me a prompt:
Code:
root [ ~ ]#
its in red which I believe means that it is out of the other bash login. Now should I try running the chroot?

Last edited by computerfreak97; 12-29-2010 at 07:31 PM.
 
Old 12-29-2010, 07:33 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Yes, now issue again the commands from my previous post
ls -ld /mnt
ls -ld /mnt/lfs

You should now be in the liveCD environment. Try chrooting again.
 
Old 12-29-2010, 07:35 PM   #7
computerfreak97
Member
 
Registered: Dec 2010
Posts: 45

Original Poster
Rep: Reputation: 0
ls -ld /mnt
Code:
drwxr-xr-x 3 root root 4096 Dec 27 22:36 /mnt
ls -ld /mnt/lfs
Code:
drwxr-xr-x 22 root root 4096 Dec 28 04:50 /mnt/lfs
Thanks for the quick responses.

EDIT: The chroot works now. Thanks for your help.

Last edited by computerfreak97; 12-29-2010 at 07:43 PM.
 
Old 12-29-2010, 07:50 PM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
You're welcome.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot in shell scripts: Ensuring that subsequent commands execute within the chroot Kenny_Strawn Programming 2 05-21-2012 12:25 PM
failing at chroot 101 rbees Linux - General 10 10-02-2009 04:40 PM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
GCC in chroot failing to build, unable to find headers falt004 Linux From Scratch 4 08-03-2007 10:00 AM
eth1 failing on boot, IEEE firewire card driver failing, help jackuss_169 Linux - Laptop and Netbook 5 03-05-2005 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration