bash: /tools/bin/su: No such file or directory

Scott Loewen scott at sierralima.com
Sun Oct 30 20:58:31 PST 2005



Chris Staub wrote:

> Scott Loewen wrote:
>
>> I am working on LFS 6.1 and have completed it through section 6.8. I 
>> am using the LFS LiveCD. I am also working through the more control 
>> and package management stuff. When I tried to switch to the 
>> linux-libc-headers user to install it, I received the following error:
>>
>> bash: /tools/bin/su: No such file or directory
>>
>> I have also tried it manually:
>> root:/# su linux-libc-headers
>> bash: /tools/bin/su: No such file or directory
>>
>> The file exists:
>> root:/# ls -l /tools/bin/su
>> -rwxrwxrwx  1 root root 20800 Oct 29 22:14 /tools/bin/su
>>
>> I cannot get su to work in the chroot environment. It works fine 
>> through a different console. So the file exists, su is "found" 
>> because /tools/bin is in $PATH, but it won't execute. I have tried 
>> searching in Google on this but I'm not familiar enough with the 
>> problem to be able to narrow down the search results. I figure I must 
>> have done (not done) something that would cause this, but I have no 
>> idea where to start. I have rebooted the system and redone chapter 6 
>> up through 6.8, but there was no change. Any help would be much 
>> appreciated.
>>
>> Thanks,
>> Scott
>>
>
> You probably have su linked to host libraries. Try running "ldd 
> /tools/bin/su" and paste the result here.

Your comment tripped a memory. The more control and pkg mgmt calls for 
copying su from the coreutils directory to /tools/bin. I didn't know to 
do this until I had deleted the coreutils build directory, so I just 
copied su from /bin/su in the non-chroot environment. After I saw your 
comment I rebuilt coreutils and copied the new su to /tools/bin. 
Everything worked fine after I copied /tools/lib to /lib. Below are the 
results of ldd on the new su:
Results from ldd /tools/bin/su:
             linux-gate.so.1 =>  (0xffffe000)
             libcrypt.so.1 => /lib/libcrypt.so.1  (0xb7fbb00)
             libc.so.6 => /lib/libc.so.6  (0xb7ed1000)
             /lib/ld-linux.so.2  (0xb7fee000)

Is it just me or should there be a /tools in front of these paths? I 
included --prefix=/tools when I ran configure.

Scott




More information about the lfs-support mailing list