stuck on chroot

Bill Maltby LFS Related lfsbill at wlmlx1.wlmcs.com
Fri Mar 8 03:10:40 PST 2002


Be aware that the first parameter to chroot is the _target_ directory
which will act as the new "root" of the directory structure for all
commands _until_ the chroot envirnment is exited. This means that
if you have _successfully_ chroot'd, when you "cd /", it will _not_
appear to have gone to the $LFS directory when you do a pwd. A better
test may be "ls /" and see if it _looks_ like $LFS rather than your
normal host distro;s root.

Of course, there could have been an error that caused the new root
directory to be _not_ properly established. 1) If the directory
doesn't exist, 2) You don't have permissions (unlikely if you are
following book), 3) You typed soemthing wrong, 4) You typed everything
right, but soemthing else is wrong.

Let's take number 4 first. If you type export, do you see something
like "LFS=/mnt/hdc2" as example? If not, and if your originally
typed something like "chroot $LFS ...", that is probably your problem.

Taking number 3, if you didn't type like we just showed above, did
you type something like "chroot /mnt/hdc2 ..." for example? If so,
was it correct? Of course you could have typed something like"cd
/mnt/hdc2;chroot `pwd` ..." just as well.

Let's take number 1. Was the partition mounted? Were you running as
root? That's about all I can think of.

Review the book's instructions _closely_. Be alert for extra/missing
characters (epicially spaces which seem to be most pernicious). Try
typeing _exactly_ what is shown, changing _only_ what is appropriate
for your mount point. Better, export LFS (export LFS=/mnt/hdc2" or
some such) and then _type_it_exactly_like_the_book_shows.

Make sure you have a way of telling if it worked or not. If you lack
general knowledge, then stick a little special file on that partition's
root before you do the chroot. Then an "ls /" should display that file
if the chroot worked. Of course, make _sure_ it's _not_ in the normal
root or you have gained only confusion.

Sorry to be so long winded, but I have seen several queries re: chroot
over a short period of time. My hope is that this will give ppl some
avenues of exploration w/o having to break away from the good stuff
to utlimately learn that they have a typo (and who doesn't?   ;)  )

Bill Maltby
billm at wlmcs.com

On Fri, 8 Mar 2002, Lewi wrote:

> I'm new to lfs, when I went to chroot section, the result seems not correct on like the lfs manual wrote
> 
> I'm using redhat 7.1, I read lfs manual version 3.2-RC1
> on my lfs partition when I enter chroot command as root,
> then when I 
> cd /
> doesn't changes to lfs partitions
> 
> what should I do?
> 
> thank you for any help
> 
> -- 
> ichtus
> ------
> Lewi Supranata .K
> ICQ: 50643061
> 
> 

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list