LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-11-2006, 02:20 AM   #1
mohit.jain
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Rep: Reputation: 0
mount command not working in chroot. and now chroot not working


[/CODE]
Code:
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
worked very well..
and with smiling i moved on to the next command

Code:
mount -nvt tmpfs none /dev
error : /tools/bin/mount :No such file or directory

and i am stuck ..from two days
just to inform tried searching various topics in this forum but nothing worked out !

me using LFS book version 6.1.1
and LFS live cd.

However searchinng again.. I tried to recompile the bash package thats bash-3.0 ..
but as it moves on..i tried to enter the chroot environment
and now..its stuck..me not able to enter chroot now
with the error as

Code:
/tools/bin/env:/tools/bin/bash: No such file or directory
Any help appreciated
 
Old 07-11-2006, 05:29 AM   #2
mohit.jain
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Original Poster
Rep: Reputation: 0
landed up in chroot by making some changes in installation of bash package again.. the changes in the
./configure as told in some other post..
now still me stick at the same problem of some commands of bash not working
like FILE,, Mount etc etc
what to do????
any help appreciated as fast as possible

worth note : as i enter chroot environment
me getting a remark as

Code:
bash:initialize_job_control: setpgid: operation not permitted
is that the real cause of problem??
plzzz help
 
Old 07-11-2006, 02:48 PM   #3
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 447

Rep: Reputation: 39
Erm... not really sure what's going on. Your posts weren't amazingly clear.

Quote:
error : /tools/bin/mount :No such file or directory
Well if its not there then it suggests that this command:

Code:
cp mount/{,u}mount text-utils/more /tools/bin
was not run when it should have been. See: http://www.linuxfromscratch.org/lfs/...til-linux.html

As for your bash problem I have little idea, my guess is the bash rebuild didnt go so well...


Quote:
any help appreciated as fast as possible
Sorry to be the one to say this but it looks as though you have rushed through the book. Not a good idea especially if this is your first time.

The chances are that all kinds of mistakes have been made leading to all kinds of errors, and ultimately a frakked up build. You need some serious patience to make LFS work. (The average person doing LFS for the first time goes through 4 tries to make it work).

I do have one tip though: the development version of LFS has a rather nice way of setting up the temporary environment, alot less typing and it should work fine for 6.1.1

http://www.linuxfromscratch.org/lfs/...06/kernfs.html
 
Old 07-14-2006, 01:48 AM   #4
mohit.jain
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Original Poster
Rep: Reputation: 0
unable to enter chroot environment

Thanks for the advise sir..i realized may be I was running too fast ..so now I have restarted the whole process patiently and cautiously reading the document as good as I can !!

While I was doing the process at chapter 6 (after I installed the package as prescribed before)

Code:
mkdir -pv $LFS/{proc,sys}
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vft tmpfs tmpfs $LFS/dev
mount -vft tmpfs tmpfs $LFS/dev/shm
mount -vft devpts -o gid=4,mode=620 devpts $LFS/dev/pts
I checked these mounts by using mount command

Than I moved to next step of entering chroot environment

Code:
chroot "$LFS" /tools/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h
the error which I got was

chroot :cannot run command ‘/tools/bin/env’: No such file or directory


I checked the /mnt/lfs/tools/bin/env directory and did find env file presence there..

I also checked $LFS variable which is echoed as /mnt/lfs
I also continued to check $PATH variable which is echoed as

/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin


and yeah I didn’t work as lfs user.. and I went on working as normal root user from the start ..thus skipping the portion of useradd of lfs on page 24 and 25 and 26

any help is appreciated.. I tried to be as clear as I can !! t
thanks beforehand
 
Old 07-14-2006, 03:50 AM   #5
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 447

Rep: Reputation: 39
Thank you, much clearer.

Quote:
chroot :cannot run command ‘/tools/bin/env’: No such file or directory
At the moment I can only guess that /mnt/lfs/tools is not linked to /

Code:
ln -sv $LFS/tools /
should fix it temporarily, but you may have some other issues to deal with. See below.

---
When building the toolchain $PATH should be:

Code:
/tools/bin:/bin:/usr/bin
not
Code:
/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin
This way the newly compiled programs are used as soon as they are available.

Quote:
I didn’t work as lfs user.. and I went on working as normal root user from the start ..thus skipping the portion of useradd of lfs on page 24 and 25 and 26
Ah....this may cause some serious problems down the line. A key part of setting up the lfs user is making a clean build environment in order to minimise the influence of the host system.

The point: you really really should create an lfs user as the book suggests. If you want to use an existing account (or even worse the root account) you must still go through the procedure on pages 25,26 for that user.

Officially I recommend starting all over, this time following book to the letter, but if your patience is wearing thin, you could just continue and see what happens, the effect of a tainted toolchain varies from host to host. You never know you could end up with a (partially) working system.

Sorry to be the bearer of bad news (again)

Last edited by Daws; 07-14-2006 at 03:51 AM.
 
Old 07-14-2006, 03:57 AM   #6
mohit.jain
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Original Poster
Rep: Reputation: 0
um..thanks sir.. and indeed dont be sorry !! i appreciate and really thankful for ur concern..
and indeed getting a feeling that u r again right !!
Planning to start again with the LFS user thing..because thats where i am seeing the trouble only !! else me confident about doing other stuff well till now
thanks again !!
 
  


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
Working on Apache Chroot zhizaki Linux - Security 9 11-29-2005 05:53 AM
etc of the host changes while working in chroot env sharmashikha Linux From Scratch 3 06-15-2005 12:20 PM
Now Bash isnt working within the chroot enviroment matthewa Linux From Scratch 2 06-02-2005 06:37 PM
chroot not working for vsftp anymore noisybastard Linux - Newbie 5 11-26-2003 10:31 PM
chroot not working. dkc_ace Linux - General 9 08-13-2003 12:56 PM

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

All times are GMT -5. The time now is 11:50 AM.

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