This is a discussion on chroot and mount -t proc within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> I have been using chroot recently to do some compiling in a different environment and distro. Sometimes, I forget ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have been using chroot recently to do some compiling in a different environment and distro. Sometimes, I forget to do mount -t proc none /mnt/chroot/proc before doing the chroot. Most everything works OK when compiling. Only failings I have seen are the failure of certain programs to locate the correct kernel source when compiling and mkinitrd reports /proc not found. My question is: Exactly what is the reason for mounting a local copy of /proc prior to chrooting? Some FAQ show proc being mounted AFTER chrooting: # mount /dev/hda## /mnt/chroot # chroot /mnt/chroot # mount -t proc none /proc as opposed to: # mount /dev/hda## /mnt/chroot # mount -t proc none /mnt/chroot/proc # chroot /mnt/chroot Are these two identical? Any clarification or links to clear FAQ are appreciated! -- Peter |
| |||
| Peter wrote: > I have been using chroot recently to do some compiling in a different > environment and distro. Sometimes, I forget to do mount -t proc > none /mnt/chroot/proc before doing the chroot. > > Most everything works OK when compiling. Only failings I have seen are > the failure of certain programs to locate the correct kernel source when > compiling and mkinitrd reports /proc not found. > > My question is: Exactly what is the reason for mounting a local copy > of /proc prior to chrooting? Some FAQ show proc being mounted AFTER > chrooting: > > # mount /dev/hda## /mnt/chroot > # chroot /mnt/chroot > # mount -t proc none /proc > > as opposed to: > > # mount /dev/hda## /mnt/chroot > # mount -t proc none /mnt/chroot/proc > # chroot /mnt/chroot > > Are these two identical? Any clarification or links to clear FAQ are > appreciated! I won't try to explain weather or not the two ways might work identical, but since the proc filesystem is a kernel interface, I would never chroot without first having mounted the proc fs belonging to the kernel I'm chroot'ing to. Everytime I do it the Right Way, it works fine for me. Usually, I do this when installing Gentoo from a USB disk image, booting off the cd. Sometimes, a new netcard (i.e. Broadcom or Intel Gbit on a Dell) is not supported, so I compile the driver. I'll later emerge the Gentoo driver. -- Kind regards, Mogens V. |
| |||
| On Sat, 2006-05-06 at 13:24 +0200, Mogens V. wrote: snip... > I won't try to explain weather or not the two ways might work identical, > but since the proc filesystem is a kernel interface, I would never > chroot without first having mounted the proc fs belonging to the kernel > I'm chroot'ing to. > Everytime I do it the Right Way, it works fine for me. > > Usually, I do this when installing Gentoo from a USB disk image, booting > off the cd. > Sometimes, a new netcard (i.e. Broadcom or Intel Gbit on a Dell) is not > supported, so I compile the driver. I'll later emerge the Gentoo driver. > So, you're saying mount -t proc none /mnt/chroot/proc chroot /mnt/chroot is the "right" way? When I do it this way, the errors I noted are absent, which _is_ good! Thx -- Peter |
| ||||
| Peter wrote: > On Sat, 2006-05-06 at 13:24 +0200, Mogens V. wrote: > >>I won't try to explain weather or not the two ways might work identical, >>but since the proc filesystem is a kernel interface, I would never >>chroot without first having mounted the proc fs belonging to the kernel >>I'm chroot'ing to. > > So, you're saying > mount -t proc none /mnt/chroot/proc > chroot /mnt/chroot > > is the "right" way? Yup -- Kind regards, Mogens V. |