LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-13-2013, 08:28 PM   #1
Grimace78
LQ Newbie
 
Registered: Nov 2012
Location: Texas
Distribution: Ubuntu 13.10, Arch Linux, LFS (7.4) project started
Posts: 13

Rep: Reputation: Disabled
Missing directories and bad permissions for $LFS


Could someone explain what could be going on here? I'm still kind of new to linux, but have made a bit of headway. The first 3 or 4 times this happened I just assumed I did something to mess it up, but I've been over the directions in detail at least three times (as well as restarting the project). I've read about HDD issues that could cause this, but I don't believe that to be the case at this time. I am planning to run some tools in dos tonight to doublecheck integrity regardless.
Quote:
donald@slowpoke:~$ echo $LFS

donald@slowpoke:~$ sudo bash
[sudo] password for donald:
bash: /usr/share/bash-completion/bash_completion: line 624: syntax error in conditional expression: unexpected token `('
bash: /usr/share/bash-completion/bash_completion: line 624: syntax error near `^(\'
bash: /usr/share/bash-completion/bash_completion: line 624: ` if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then'
root@slowpoke:~# chown -v lfs $LFS/tools
chown: cannot dereference ‘/tools’: No such file or directory
failed to change ownership of ‘/tools’ from 32555 to lfs
root@slowpoke:~# mkdir -v $LFS/tools
mkdir: cannot create directory ‘/tools’: File exists
root@slowpoke:~# cd /mnt/lfs
root@slowpoke:/mnt/lfs# ls
sources
root@slowpoke:/mnt/lfs# mkdir -v $LFS/tools
mkdir: cannot create directory ‘/tools’: File exists
root@slowpoke:/mnt/lfs# ln -sv $LFS/tools /
ln: failed to create symbolic link ‘/tools’: File exists
root@slowpoke:/mnt/lfs# chown -v lfs $LFS/tools
chown: cannot dereference ‘/tools’: No such file or directory
failed to change ownership of ‘/tools’ from 32551 to lfs
root@slowpoke:/mnt/lfs# echo $LFS

root@slowpoke:/mnt/lfs# export echo $LFS
root@slowpoke:/mnt/lfs# export LFS=/mnt/lfs
root@slowpoke:/mnt/lfs# echo $LFS
/mnt/lfs
root@slowpoke:/mnt/lfs# ls
sources
root@slowpoke:/mnt/lfs#
Any insight would be apprecitated.
 
Old 11-13-2013, 09:06 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Okay let's start at the beginning:

Question 1: What distribution are using using as a base to build LFS off from?

This question might solve everything now and yet to come for you if answered correctly. Most distributions aren't out of the box LFS friendly, even if you have the appropriate packages.

Question 2: Judging from how you've progressed up till this point, and you should be posting the chapter you get stuck on BTW, it seems you may have exited as the LFS user and attempted to regain access as root.

Good tip: Often at times sudo is not friendly with building LFS, and you should be logged in as root. If you can't login as root, or entering command "su" does not grant you access to the superuser/root account through the shell, we can help you fix this.
 
Old 11-13-2013, 10:08 PM   #3
Grimace78
LQ Newbie
 
Registered: Nov 2012
Location: Texas
Distribution: Ubuntu 13.10, Arch Linux, LFS (7.4) project started
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Okay let's start at the beginning:

Question 1: What distribution are using using as a base to build LFS off from?

This question might solve everything now and yet to come for you if answered correctly. Most distributions aren't out of the box LFS friendly, even if you have the appropriate packages.

Question 2: Judging from how you've progressed up till this point, and you should be posting the chapter you get stuck on BTW, it seems you may have exited as the LFS user and attempted to regain access as root.

Good tip: Often at times sudo is not friendly with building LFS, and you should be logged in as root. If you can't login as root, or entering command "su" does not grant you access to the superuser/root account through the shell, we can help you fix this.
I am using Ubuntu 13.10 64bit. As far as progress in the book, I'm @ 5.4. Binutils-2.23.2 - Pass 1.

You're right about exiting the LFS user back into root too. I was getting permission denied when trying to create directories on the lfs partition as $LFS and didn't know what else to try.

It was early enough in the project that I just dismounted the lfs partition, re-formatted the partition, then started over after installing bash 3.2 which I thought might have something to do with the permissions problem. Things were starting to get a lot smoother project wise until the directories disappeared.

Edit: I'll be sure not to use sudo anymore. I have just been avoiding it because it has caused me problems with permissions in the past.

Last edited by Grimace78; 11-13-2013 at 10:13 PM.
 
Old 11-13-2013, 10:43 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Best of luck on the build. Just a suggestion/recommendation, but I would recommend building and installing the software listed in LFS Chapter 9.3 as well as completing Section 2 - Chapter 3 of the BLFS book.

If you want a good tip, install them in this order (list may include dependencies):

dhcp-client or dhcpcd
GPM
sudo (you'll need it for installing some packages in X and KDE)
openssl
openssh
wget
lynx (build with --with-ssl)
Certificate Authority Certificates
LVM2
parted

This will give you a well rounded base system that expands the usefulness of LFS into a proper useful OS that's still minimal, yet well rounded and functional.

From there, you have BLFS and you can virtually start anywhere, though I do recommend installing X-Windows as some dependencies in some files will ask for libraries found in X-Windows.

Just a suggestion, but try to avoid PAM unless you absolutely need it.

Lastly, since this is your first LFS possibly, always build recommended dependencies even if not required. They will help with problem solving if you run into any.

Last edited by ReaperX7; 11-13-2013 at 10:48 PM.
 
Old 11-13-2013, 11:05 PM   #5
Grimace78
LQ Newbie
 
Registered: Nov 2012
Location: Texas
Distribution: Ubuntu 13.10, Arch Linux, LFS (7.4) project started
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Best of luck on the build. Just a suggestion/recommendation, but I would recommend building and installing the software listed in LFS Chapter 9.3 as well as completing Section 2 - Chapter 3 of the BLFS book.

If you want a good tip, install them in this order (list may include dependencies):

dhcp-client or dhcpcd
GPM
sudo (you'll need it for installing some packages in X and KDE)
openssl
openssh
wget
lynx (build with --with-ssl)
Certificate Authority Certificates
LVM2
parted

This will give you a well rounded base system that expands the usefulness of LFS into a proper useful OS that's still minimal, yet well rounded and functional.

From there, you have BLFS and you can virtually start anywhere, though I do recommend installing X-Windows as some dependencies in some files will ask for libraries found in X-Windows.

Just a suggestion, but try to avoid PAM unless you absolutely need it.

Lastly, since this is your first LFS possibly, always build recommended dependencies even if not required. They will help with problem solving if you run into any.
Thank you for all the information, and yes it is my first LFS build. My long term goal other than really learning about linux is to have a custom operating system (and I'm still going to go back and install slackware at some point just because...), so I will definitely being looking into what you suggested.

I am curious though if you had some suggestions on how to fix the problems that I posted up (other than not repeating the same mistakes).
 
Old 11-13-2013, 11:17 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
go back to the start of the book, read it

pay special attention to chapter 4
 
Old 11-13-2013, 11:24 PM   #7
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Quote:
Originally Posted by Grimace78 View Post
Thank you for all the information, and yes it is my first LFS build. My long term goal other than really learning about linux is to have a custom operating system (and I'm still going to go back and install slackware at some point just because...), so I will definitely being looking into what you suggested.

I am curious though if you had some suggestions on how to fix the problems that I posted up (other than not repeating the same mistakes).
Sometimes it all depends on how you shift through which user account you're on as to how permissions behave. Usually root will have full permissions, but creating directories and files as root can have problems, which is why they suggest you create /sources and /tools as the LFS user in the host system rather than root. This way they get built as a user account, but a user account with admin level permissions, basically a power user.

I've ran into issues also when I built using SalixOS with permissions. It just happens sometimes even though they're unintended. If you get through the initial prelim system without stopping, usually you'll never have to worry about permissions as afterwards most work will be done as root rather than the lfs user.

The best point, take your time and read each chapter carefully before proceeding as you'll often see extra hints such as optional build flags you may want (such being with openssl support in lynx is mentioned in an afterword rather than the main because it's optional), and then download, unpack, build, and install.

Trust me, you'll have a good experience with LFS. And when you need help, just ask. There are more than enough friendly people here at LQ with a vast wealth of knowledge who are willing to help you out, step by step...

...and the majority of us won't be like that guy above rudely thumping a book.

Last edited by ReaperX7; 11-13-2013 at 11:31 PM.
 
Old 11-13-2013, 11:44 PM   #8
Grimace78
LQ Newbie
 
Registered: Nov 2012
Location: Texas
Distribution: Ubuntu 13.10, Arch Linux, LFS (7.4) project started
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Sometimes it all depends on how you shift through which user account you're on as to how permissions behave. Usually root will have full permissions, but creating directories and files as root can have problems, which is why they suggest you create /sources and /tools as the LFS user in the host system rather than root. This way they get built as a user account, but a user account with admin level permissions, basically a power user.

I've ran into issues also when I built using SalixOS with permissions. It just happens sometimes even though they're unintended. If you get through the initial prelim system without stopping, usually you'll never have to worry about permissions as afterwards most work will be done as root rather than the lfs user.

The best point, take your time and read each chapter carefully before proceeding as you'll often see extra hints such as optional build flags you may want (such being with openssl support in lynx is mentioned in an afterword rather than the main because it's optional), and then download, unpack, build, and install.

Trust me, you'll have a good experience with LFS. And when you need help, just ask. There are more than enough friendly people here at LQ with a vast wealth of knowledge who are willing to help you out, step by step...

...and the majority of us won't be like that guy above rudely thumping a book.
Allright. I'll reread it and comment back on my status as soon as I am back on track. Thanks again for the information.
 
Old 11-30-2013, 09:41 AM   #9
Grimace78
LQ Newbie
 
Registered: Nov 2012
Location: Texas
Distribution: Ubuntu 13.10, Arch Linux, LFS (7.4) project started
Posts: 13

Original Poster
Rep: Reputation: Disabled
Does anyone think it would be a bad thing to try a switch to Arch Linux first and then come back to LFS? I've been extra "special" lately, and was thinking that it might be a more gradual learning curve...

Last edited by Grimace78; 11-30-2013 at 09:43 AM.
 
Old 11-30-2013, 01:11 PM   #10
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

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

Does anyone think it would be a bad thing to try a switch to Arch Linux first and then come back to LFS?
I was using Arch when I first started using LFS.

Quote:
Originally Posted by Grimace78

I am curious though if you had some suggestions on how to fix the problems that I posted up (other than not repeating the same mistakes).
All those commands in post #1 that attempted to create, link, or list $LFS/tools failed because $LFS was not set. The /mnt/lfs/tools directory does not exist. There may be a directory or link named /tools in your Ubuntu root directory, but there is no directory named /tools in /mnt/lfs.

I recommend, as Ubuntu root, with the partition mounted...

1. Create /mnt/lfs/tools (section 4.2).
2. If an empty directory named /tools was accidentally created in the Ubuntu root directory, then delete it.
3. Create the link in the Ubuntu root directory to /mnt/lfs/tools (section 4.2).

Then, if you created the lfs user (section 4.3), granted it access to /tools and /sources (section 4.3), and created its .bash_profile and .bashrc files (section 4.4)...

1. Somehow log in as the lfs user and/or start a new shell as lfs (I forgot which for Ubuntu).
2. Check that $LFS echoes "/mnt/lfs".
3. Begin again Binutils-2.23.2 - Pass 1.

Stay in that shell as the lfs user to the end of chapter 5. If you stop and log out while still working in chapter 5, you only have to start a new shell as the lfs user to resume work.

Later, in chapters 6-9, stopping and resuming is slightly more complicated because you will be working in chroot then. But the steps for that are in the book for when that time comes.

Last edited by stoat; 11-30-2013 at 04:58 PM.
 
  


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
Contents of www directory missing after reboot - bad, very bad. LiamM Ubuntu 3 07-02-2012 09:28 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
Mount: wrong fs type, bad option, bad superblock missing codepage or other error twaddlac Linux - Virtualization and Cloud 3 09-29-2010 09:24 AM
Mount: wrong fs type, bad option, bad superblock missing codepage or other error twaddlac Red Hat 4 09-28-2010 04:45 AM
Permisions on $LFS Directories unable to create folders cuco76 Linux From Scratch 9 02-02-2007 09:04 PM

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

All times are GMT -5. The time now is 12:19 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