LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.2 Chapter 6.4 Chroot Environment Error (http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-2-chapter-6-4-chroot-environment-error-4175441300/)

raza.ajmi 12-13-2012 08:15 AM

LFS 7.2 Chapter 6.4 Chroot Environment Error
 
raza@raza-Inspiron-1564:~$ 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 change root directory to : No such file or directory

druuna 12-13-2012 08:20 AM

Quote:

Originally Posted by raza.ajmi
raza@raza-Inspiron-1564:~$ chroot "$LFS" /tools/bin/env -i \
.
.

From the LFS 7.2 book, chapter 6.4 :
Quote:

It is time to enter the chroot environment to begin building and installing the final LFS system. As user root, run the following command to enter the realm that is, at the moment, populated with only the temporary tools:

raza.ajmi 12-13-2012 08:54 AM

ok thanks
can you tell me the proper way to switch root user in Ubuntu ??

Keith Hedger 12-13-2012 09:00 AM

In ubuntu the root account is disabled by default so you have to use 'sudo' ie
Code:

sudo chroot "$LFS" /tools/bin/env -i \
.
.


druuna 12-13-2012 09:10 AM

I'm not 100% sure if sudo is the way to go. The root environment might not be fully set.

You can enable full root access in the following way:
Code:

sudo passwd root
Now root has a password and you can do the following to get full root access:
Code:

su -

raza.ajmi 12-13-2012 09:10 AM

i used the sudo but the error is same :(

druuna 12-13-2012 09:12 AM

Quote:

Originally Posted by raza.ajmi (Post 4848514)
i used the sudo but the error is same :(

See post #5

You might also want to have a look at this (as reference!!) : LFS 7.1 on Ubuntu 12.04

raza.ajmi 12-13-2012 09:18 AM

thanks druuna i got the access to root but problem is still problem :(

root@raza-Inspiron-1564:~# sudo 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 change root directory to : No such file or directory

now

druuna 12-13-2012 09:23 AM

Quote:

Originally Posted by raza.ajmi (Post 4848520)
thanks druuna i got the access to root but problem is still problem :(

root@raza-Inspiron-1564:~# sudo 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 change root directory to : No such file or directory

now

Do not use sudo, use su - to become root and then follow the book to the letter.

raza.ajmi 12-13-2012 09:27 AM

i tried without sudo but same situation :(

druuna 12-13-2012 09:51 AM

What is the output of the following command (as root)
Code:

echo $LFS
I'm guessing it is empty, and it should print /mnt/lfs (or whatever you decided to use). This was told right here (the moment you started using root to execute commands): 5.34. Changing Ownership
Quote:

Also, double check that $LFS is set in root's environment.
Please read the book more carefully.

raza.ajmi 12-14-2012 01:34 AM

this is shit how can i forget this :@
thank you very much for help :)


All times are GMT -5. The time now is 06:37 PM.