chroot problem again

David daveNOSSPPAMMandanj at
Fri Jan 28 07:38:19 PST 2005

Hi- hope someone can help me with a problem in the chroot step of

Logged in as root
bash-2.05b# export LFS=/lfs   #My LFS partition is mounted at /lfs, not
bash-2.05b# echo $LFS

bash-2.05b# 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
chroot: cannot execute /tools/bin/env: No such file or directory

The FAQ describes a similar problem, and says that in LFS>= 5.x the
usual cause is the dynamic linker embedded inside the executable is
pointing at /lib/ However mine seems to pass this test:
bash-2.05b# readelf -l /tools/bin/env | grep interpreter
      [Requesting program interpreter: /tools/lib/]

Running /tools/bin/env from bash-prompt gives the same output as running
the host system /usr/bin/env

Recent same question in this newsgroup suggests:
1. "bash not built or prefix not given". bash is present in
bash-2.05b# ldd /tools/bin/bash =>  (0xffffe000) => /tools/lib/ (0xb7fa7000) => /tools/lib/ (0xb7fa2000) => /tools/lib/ (0xb7e8c000)
        /tools/lib/ => /tools/lib/
bash-2.05b# locate linux-gate
(Where is this Shouldn't it be under /tools somewhere?
However every reference I see looks the same as mine so I assume this is
not the problem.)

I thought I was onto something when I saw the group of
/tools/bin/bash and /tools/bin/env was root, but changing that to
lfs:lfs didn't help either.

Everything has been fine up to this point *except* for the first pass of
binutils. This errored out in different places during make,mostly with
"Unknown pseudo-op" errors, one segfault, getting a bit further each
Had already re-installed binutils on host system (as root) because of
unknown pseudo-op error in gcc bootstrap stage.
Ran memtest86 (because above was said to suggest hardware problem) - 0
errors in 10 passes over 9 hours.

Eventually binutils make completed without any errors, and since then
all other packages in chapter 5 (including second pass of binutils) have
compiled without a single hitch, and I can't reproduce the error. All
recommended sanity checks gave correct output.

Initially packages were downloaded as tarball from LFS website using
windows - dl with windows has given problems before so I tried
downloading all under linux with wget using my own script, mostly with
local ( sources, generally reliable. No variations
from recommended packages.

I have re-installed binutils (for luck) and coreutils (because it
contains env which is giving the error) from the lfs user environment a
la chapter 5, with no problems and no benefit. Also re-installed bash.

Have checked and double-checked:
lfs user environment during chapter 5 installs
root user environment including mounted filesystems, declaring $LFS for
chroot step
AFAIK all other recommendations followed religiously. No optimizations.
Host distro - Vector linux 4.0 (small slackware based distro). Uses
gcc-3.2.2, glibc-2.3.1, (comes shipped with kernel 2.4.21).
Running kernel 2.6.10 compiled with minimal modules. Have not installed

System - Athlon Duron K6, 512M

bash-2.05b# mount
/dev/hda3 on / type ext3 (rw,errors=remount-ro)
/dev/hdb3 on /lfs type reiserfs (rw)
/dev/hdb1 on /lfs/boot type ext2 (rw)
/dev/hdb5 on /lfs/usr type reiserfs (rw)
/dev/hdb6 on /lfs/var type reiserfs (rw)
/dev/hdb7 on /lfs/tmp type reiserfs (rw)
/dev/hdb8 on /lfs/home type reiserfs (rw)
/dev/hda6 on /win/d type ntfs (ro)
proc on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=666)
proc on /lfs/proc type proc (rw)
/dev/hdb9 on /vfat2 type vfat (rw,noexec,nosuid,nodev,umask=000)
sysfs on /lfs/sys type sysfs (rw)
ramfs on /lfs/dev type ramfs (rw)
tmpfs on /lfs/dev/shm type tmpfs (rw)
devpts on /lfs/dev/pts type devpts (rw,gid=4,mode=620)

The $LFS/tools and sources directories are subdirectories of /lfs/usr
(because the /lfs partition is too small) and symlinked from /lfs.

Can this be a problem? (There has been no other indication that it is)
Any other suggestions gratefully received.


dave   |    Chronic linux dabbler

and    |    but minimal computer

anj    |    know-how

More information about the lfs-support mailing list