Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Install/Chroot"

From Funtoo
Jump to navigation Jump to search
(Created page with "=== Chroot into Funtoo === Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system...")
 
 
(60 intermediate revisions by 9 users not shown)
Line 1: Line 1:
=== Chroot into Funtoo ===
<translate>
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:
<includeonly>
<console>
== Chroot into Funtoo == <!--T:1-->
</includeonly><noinclude><languages/>
= Install Guide: Chroot into Funtoo =  
 
<!--T:2-->
{{InstallNavigation|num=9|prev=Download and Extract Stage3|next=Download Portage Tree}}</noinclude>
 
<!--T:14-->
To set up your Funtoo Linux system, we need to "enter into" it before we boot. If you are using the Funtoo Linux LiveCD, this can be easily done with the {{c|fchroot}} command:
 
<!--T:17-->
{{console|body=
# ##i##fchroot /mnt/funtoo
%fchroot%
}}
 
<!--T:18-->
The {{c|fchroot}} command will take care of all necessary steps to enter into your new Funtoo Linux system, as well as clean up things when you exit the fchroot by typing
{{c|exit}} or {{c|ctrl-D}}.
 
<!--T:19-->
If you are using another LiveCD or USB media to install Funtoo, you can manually chroot by using the following set of commands:
 
<!--T:8-->
{{console|body=
# ##i##cd /mnt/funtoo
# ##i##cd /mnt/funtoo
# ##i##mount -t proc none proc
# ##i##mount --rbind /proc proc
# ##i##mount --rbind /sys sys
# ##i##mount --rbind /sys sys
# ##i##mount --rbind /dev dev
# ##i##mount --rbind /dev dev
</console>
# ##i##cp /etc/resolv.conf /mnt/funtoo/etc/
 
# ##i##chroot . /bin/su --login
<noinclude>
%chroot% }}
{{Note|This is a template that is used as part of the Installation instructions, to describe the process of chrooting into the stage3. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.}}
</noinclude>
 
You'll also want to copy over <code>resolv.conf</code> in order to have proper DNS name resolution from inside the chroot:
<console>
# ##i##cp /etc/resolv.conf etc
</console>
 
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment variables from the installation media are used by your new system:


<console>
<!--T:11-->
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l
{{Note|For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use {{c|uname -r}} to check whether the system is 32 or 64-bit. You may want to append linux32 to the chroot command as a workaround, but it's generally not needed.}}
</console>
{{Important|If you receive the error "{{c|chroot: failed to run command `/bin/bash': Exec format error}}", it is most likely because you are running a 32-bit kernel and trying to execute 64-bit code. Make sure that you have selected the proper type of kernel when booting your live CD.}}


{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <code>uname -r</code> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}
<!--T:12-->
{{fancyimportant|If you receive the error "<code>chroot: failed to run command `/bin/bash': Exec format error</code>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}
Test internet name resolution from within the chroot:
{{console|body=%chroot% ##i##ping -c 5 google.com}}


It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:
<!--T:15-->
<console>
If you can't ping, make sure that {{f|/etc/resolv.conf}} specifies a valid IP address for a reachable nameserver in its {{c|nameserver}} setting.
# ##i##export PS1="(chroot) $PS1"
</console>


Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.
<!--T:13-->
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will start successfully, without any manual assistance, when your system is restarted.
</translate>
<noinclude>{{InstallNavigation|num=9|prev=Download and Extract Stage3|next=Download Portage Tree|align=right}}</noinclude>

Latest revision as of 00:59, May 26, 2023

Other languages:
English • ‎Türkçe • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎

Install Guide: Chroot into Funtoo

Install Guide, Chapter 9 < Prev Next >

To set up your Funtoo Linux system, we need to "enter into" it before we boot. If you are using the Funtoo Linux LiveCD, this can be easily done with the fchroot command:

root # fchroot /mnt/funtoo
fchroot #

The fchroot command will take care of all necessary steps to enter into your new Funtoo Linux system, as well as clean up things when you exit the fchroot by typing exit or ctrl-D.

If you are using another LiveCD or USB media to install Funtoo, you can manually chroot by using the following set of commands:

root # cd /mnt/funtoo
root # mount --rbind /proc proc
root # mount --rbind /sys sys
root # mount --rbind /dev dev
root # cp /etc/resolv.conf /mnt/funtoo/etc/
root # chroot . /bin/su --login
chroot #
   Note

For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use uname -r to check whether the system is 32 or 64-bit. You may want to append linux32 to the chroot command as a workaround, but it's generally not needed.

   Important

If you receive the error "chroot: failed to run command `/bin/bash': Exec format error", it is most likely because you are running a 32-bit kernel and trying to execute 64-bit code. Make sure that you have selected the proper type of kernel when booting your live CD.

Test internet name resolution from within the chroot:

chroot # ping -c 5 google.com

If you can't ping, make sure that /etc/resolv.conf specifies a valid IP address for a reachable nameserver in its nameserver setting.

Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will start successfully, without any manual assistance, when your system is restarted.

Install Guide, Chapter 9 < Prev Next >