LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   mount command not working in chroot. and now chroot not working (http://www.linuxquestions.org/questions/linux-from-scratch-13/mount-command-not-working-in-chroot-and-now-chroot-not-working-462870/)

mohit.jain 07-11-2006 02:20 AM

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

mohit.jain 07-11-2006 05:29 AM

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

Daws 07-11-2006 02:48 PM

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

mohit.jain 07-14-2006 01:48 AM

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

Daws 07-14-2006 03:50 AM

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)

mohit.jain 07-14-2006 03:57 AM

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 !!


All times are GMT -5. The time now is 10:15 AM.