LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-15-2010, 01:37 PM   #1
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Stuck at creating the LFS user


At section 4.3 of the manual I've already run into a problem:
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs

chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs

I then tried
ls $LFS
and got my home directory. I never quite understood
ln -sv $LFS/tools /
and it looks like the computer is in the same boat.

Where should I go from here? The answer "stick to Fedora" is the first to occur to me
 
Old 03-15-2010, 02:00 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
I have no experience with LFS, so bear that in mind.

The symlink
ln -sv $LFS/tools /
is linking $LFS/tools to the root directory /

Then you are chowning $LFS/tools
which is chowning the entire root and presumably the symlink too.

What is $LFS
echo $LFS
 
Old 03-15-2010, 02:43 PM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

you probably missed this command in chapter 4.1.
Code:
export LFS=/mnt/lfs
Assumed, that you followed the instructions and mounted your LFS partition as the book suggests. Keep in mind, that if you reboot your computer or just open another terminal you will have to issue that command again.
 
1 members found this post helpful.
Old 03-15-2010, 04:09 PM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Original Poster
Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
crts: I didn't miss anything, and I put the command in .bashrc to avoid the problem you suggest.

smoker: I thought the command looked odd, but the book says
"The above command is correct. The ln command has a few syntactic variations, so be sure to check info coreutils ln and ln(1) before reporting what you may think is an error."
so I took it on trust. May I politely suggest that you do not answer posts where you admittedly have no experience, especially when that takes the post out of the unanswered threads category. No harm was done in this case, but it can be very annoying.
 
Old 03-15-2010, 04:28 PM   #5
charlie_lab
Member
 
Registered: Nov 2006
Posts: 255

Rep: Reputation: 30
Oke,

What happens when you do :

echo $LFS

Roelof
 
Old 03-15-2010, 06:13 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by DavidMcCann View Post
... so I took it on trust.
... and you can. I build my LFS with that same syntax for that command.
Now let's do some sanity checks first because your problem sounds really strange.
So first please post the output of
Code:
echo $LFS
mount
ls -l /
ls -l /mnt
ls -l /mnt/lfs
Now when you did
Code:
ls $LFS
was your current directory also your home directory?

Quote:
I never quite understood
ln -sv $LFS/tools /
Ok, this is a tricky one and I am not referring to the syntax. What it actually does, is to create a symlink in your / directory, which looks like
Code:
/tools -> /mnt/lfs/tools
When you build your toolchain you will configure your packages with target prefix /tools. So everything will link against /tools. Later, when you build your real LFS you will chroot into /mnt/lfs. This will be your new / directory. Would we have configured with prefix /mnt/lfs/tools then the toolchain would not work in the chrooted environment. All programs would expect their binaries and shared objects etc. to be in /mnt/lfs/tools which became just /tools in the chrooted environment.
Hope I explained it in an understandable manner.

P.S.: Please post also your hostsystem and the version of the LFS book

Last edited by crts; 03-15-2010 at 06:35 PM.
 
Old 03-15-2010, 06:50 PM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Quote:
Originally Posted by DavidMcCann View Post
smoker: I thought the command looked odd, but the book says
"The above command is correct. The ln command has a few syntactic variations, so be sure to check info coreutils ln and ln(1) before reporting what you may think is an error."
so I took it on trust. May I politely suggest that you do not answer posts where you admittedly have no experience, especially when that takes the post out of the unanswered threads category. No harm was done in this case, but it can be very annoying.
May I suggest you read the error messages.
 
Old 03-16-2010, 02:04 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Quote:
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs

chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs
The bold parts should point to $LFS/tools and $LFS/sources (if LFS is /mnt/lfs, it should for example point to /mnt/lfs/tools). For both the $LFS part is missing.

You did not (correctly) set the LFS variable.

Hope this helps.
 
1 members found this post helpful.
Old 11-05-2012, 06:01 AM   #9
prashantdawar
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Wink [solved] Stuck at creating lfsuser

Quote:
Originally Posted by DavidMcCann View Post
At section 4.3 of the manual I've already run into a problem:
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs

chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs

I then tried
ls $LFS
and got my home directory. I never quite understood
ln -sv $LFS/tools /
and it looks like the computer is in the same boat.

Where should I go from here? The answer "stick to Fedora" is the first to occur to me
Quote:
Originally Posted by crts View Post
... and you can. I build my LFS with that same syntax for that command.
Now let's do some sanity checks first because your problem sounds really strange.
So first please post the output of
Code:
echo $LFS
mount
ls -l /
ls -l /mnt
ls -l /mnt/lfs
Now when you did
Code:
ls $LFS
was your current directory also your home directory?


Ok, this is a tricky one and I am not referring to the syntax. What it actually does, is to create a symlink in your / directory, which looks like
Code:
/tools -> /mnt/lfs/tools
When you build your toolchain you will configure your packages with target prefix /tools. So everything will link against /tools. Later, when you build your real LFS you will chroot into /mnt/lfs. This will be your new / directory. Would we have configured with prefix /mnt/lfs/tools then the toolchain would not work in the chrooted environment. All programs would expect their binaries and shared objects etc. to be in /mnt/lfs/tools which became just /tools in the chrooted environment.
Hope I explained it in an understandable manner.

P.S.: Please post also your hostsystem and the version of the LFS book
Quote:
Originally Posted by druuna View Post
Hi,


The bold parts should point to $LFS/tools and $LFS/sources (if LFS is /mnt/lfs, it should for example point to /mnt/lfs/tools). For both the $LFS part is missing.

You did not (correctly) set the LFS variable.

Hope this helps.
Simply remove the earlier created symlink and then do this
Code:
root@dell-OptiPlex-780:/home/dell# rm -rf /tools
root@dell-OptiPlex-780:/home/dell# cd /mnt/lfs/tools
root@dell-OptiPlex-780:/mnt/lfs# chown -v lfs tools
changed ownership of `tools' from dell to lfs
root@dell-OptiPlex-780:/mnt/lfs# ln -sv $LFS/tools /
`/tools' -> `/tools'
Hey click the yes button buddy>>>

Last edited by prashantdawar; 11-05-2012 at 06:12 AM.
 
Old 11-05-2012, 09:05 AM   #10
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by prashantdawar

Hey click the yes button buddy>>>
Oops. I clicked the Report button. Sorry.
 
  


Reply



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
LFS newbie stuck in Linux API headers step 5.5 LFS book 6.3 Vxplus Linux From Scratch 2 11-10-2008 08:13 PM
Another LFS newb is stuck: Linux API headers won't install smoochie Linux From Scratch 19 06-13-2008 11:26 AM
cannot login as user 'lfs' [su - lfs] mayasedai Linux From Scratch 2 07-26-2005 06:10 AM
Stuck on chapter 5 when building Tcl-8.4.6 For LFS-5.1 deMilo Linux From Scratch 2 06-20-2004 03:31 AM
LFS 5.0 stuck @ gettext-0.12.1 - missing aclocal-1.7 quantumechanix Linux From Scratch 1 11-26-2003 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration