LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 12-13-2012, 08:15 AM   #1
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Rep: Reputation: Disabled
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
 
Old 12-13-2012, 08:20 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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:
 
1 members found this post helpful.
Old 12-13-2012, 08:54 AM   #3
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Original Poster
Rep: Reputation: Disabled
ok thanks
can you tell me the proper way to switch root user in Ubuntu ??
 
Old 12-13-2012, 09:00 AM   #4
Keith Hedger
Member
 
Registered: Jun 2010
Location: Devon,UK
Distribution: Linux From Scratch, Slackware64,
Posts: 832

Rep: Reputation: 167Reputation: 167
In ubuntu the root account is disabled by default so you have to use 'sudo' ie
Code:
sudo chroot "$LFS" /tools/bin/env -i \
.
.
 
Old 12-13-2012, 09:10 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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 -
 
1 members found this post helpful.
Old 12-13-2012, 09:10 AM   #6
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Original Poster
Rep: Reputation: Disabled
i used the sudo but the error is same
 
Old 12-13-2012, 09:12 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by raza.ajmi View Post
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
 
1 members found this post helpful.
Old 12-13-2012, 09:18 AM   #8
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-13-2012, 09:23 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by raza.ajmi View Post
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.
 
1 members found this post helpful.
Old 12-13-2012, 09:27 AM   #10
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Original Poster
Rep: Reputation: Disabled
i tried without sudo but same situation
 
Old 12-13-2012, 09:51 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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.
 
1 members found this post helpful.
Old 12-14-2012, 01:34 AM   #12
raza.ajmi
Member
 
Registered: Dec 2012
Location: Lahore,Pakistan
Distribution: Ubuntu 12.10
Posts: 35

Original Poster
Rep: Reputation: Disabled
this is shit how can i forget this :@
thank you very much for help

Last edited by raza.ajmi; 12-14-2012 at 01:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] LFS Chapter 6.37. Automake-1.11.3 error Andrew_Kaunchy Linux From Scratch 4 08-26-2012 12:52 AM
[SOLVED] using a chroot environment to install software in LFS jmc1987 Linux From Scratch 4 09-23-2010 12:31 PM
LFS 6 Chapter 6.3 chroot error gatblast45 Linux From Scratch 8 01-01-2008 03:12 AM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM
LFS 6 Chapter 6.8 mount error gatblast45 Linux From Scratch 20 01-04-2006 05:48 PM


All times are GMT -5. The time now is 03:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration