LinuxQuestions.org
Review your favorite Linux distribution.
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 11-12-2006, 03:56 PM   #1
oldgeek
LQ Newbie
 
Registered: Nov 2006
Location: California
Distribution: Slackware 11
Posts: 15

Rep: Reputation: 0
LFS 6.2: made mistake when going from lfs to root setup


At the end of Book 5.32 Changing Ownership I was warned to 'check that $LFS is set in root's environment'. I did NOT check and only realized it AFTER starting the chroot building. I.E. I did all of 6.2 instrucions and then when I got to 6.4 and ran:
Quote:
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
i got error "chroot: cannot change root directory to: No such file...

I then checked enviornment: echo $LFS and got nothing.

So I did the export LFS=/mnt/lfs. Echo returns /mnt/lfs.

So then I repeated the commands in 6.2:
mkdir -pv $LFS/{dev,proc,sys}
mknod <rest of command>
mknod <rest of command>
BUT NOW the problem
mount --bind /dev $LFS/dev
gives error: can't create lock file /etc/mtab-23612: No such file or directory....etc.

I assume that my prolems are the result of entering the above BEFORE setting the $LFS enviornment FROM ROOT.

Does anyone know if I can fix this problem without having to start from "scratch"?
 
Old 11-12-2006, 04:12 PM   #2
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,

Your initial approach is correct, you also need to do this if you reboot during chapter 6. But I don't know if it is possible to remount part of the file system to a third place (mount --bind /dev $LFS/dev => create a mirror of a directory or mount point to some other location).

You could try to unmount $LFS/dev: umount $LFS/dev and then try the original command again.

It will work after a reboot, but you need to set up some other things too (see this LFS hint for pointers. Document is a bit outdated, so check it against the current documentation.).

I would try the umount option first.

Hope this helps.

Last edited by druuna; 11-12-2006 at 04:14 PM.
 
Old 11-12-2006, 05:47 PM   #3
oldgeek
LQ Newbie
 
Registered: Nov 2006
Location: California
Distribution: Slackware 11
Posts: 15

Original Poster
Rep: Reputation: 0
Tried umount $LFS/dev but just tells me can't open /etc/mtab...and /mnt/lfs/dev not mounted.

Looks like I'll have to try the reboot method described in hints section. Yep, it is outdated so while I can hope, I won't be surprised if it does'nt work out.

If I discover anything worthwhile I'll post the results.

Thanks for your help.

ron
 
Old 11-12-2006, 06:33 PM   #4
oldgeek
LQ Newbie
 
Registered: Nov 2006
Location: California
Distribution: Slackware 11
Posts: 15

Original Poster
Rep: Reputation: 0
drunna

Success with the info in the "hint" section you suggested.

The info for starting from boot to get to section 6.1 worked verbatim.

Whew!! Moving along again.

Thanks much.

ron
 
Old 11-12-2006, 09:00 PM   #5
oldgeek
LQ Newbie
 
Registered: Nov 2006
Location: California
Distribution: Slackware 11
Posts: 15

Original Poster
Rep: Reputation: 0
drunna

Spoke too soon about success.

Got to the point of installing the package, linux-header patch and discoverd that the link to /sources is broken. The source packages are there under the new 'root' /sources but not able to get there with the Book instruction to patch -Np1 -i ../linux-libc- <etc>..

So I'm going to bite the bullet and start from scratch (again!!!). I'm just not knowledgeable enough to stray from the Book path.

Frustrating but it's very good experience in any event and learning alot.

cheers, ron
 
  


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 question - lack of activity in LFS Forum nykey Slackware 4 06-05-2006 05:54 PM
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-7.0-cross-lfs-20050902-x86_64-Multilib Basel Linux From Scratch 0 09-03-2005 05:03 AM
cannot login as user 'lfs' [su - lfs] mayasedai Linux From Scratch 2 07-26-2005 06:10 AM
I made it online with lfs shanenin Linux From Scratch 3 02-11-2004 05:03 PM

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

All times are GMT -5. The time now is 03:57 AM.

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