A Gentoo chroot is the handoff point between a live environment and the installed root filesystem. If /proc, /sys, /dev, /run, or DNS resolution are missing, Portage and bootloader commands can fail inside a shell that otherwise looks like the target system.
The examples assume the Gentoo root filesystem is available at /mnt/gentoo. The host kernel still runs the process, while chroot changes the path view for the shell and its child processes. Bind mounts expose the kernel interfaces, device nodes, and runtime files that Gentoo tools expect during installation or repair work.
Use the sequence when resuming an interrupted install, repairing a bootloader, or entering a stage3 root from another Linux environment. Run the host-side commands as root or with sudo, load /etc/profile after entry, and keep the prompt marker until leaving the chroot so commands are not mistaken for host-side changes.
Related: How to build a Gentoo chroot environment
Related: How to install GRUB on Gentoo
$ sudo mkdir -p /mnt/gentoo
$ sudo mount /dev/nvme0n1p3 /mnt/gentoo
Replace /dev/nvme0n1p3 with the real Gentoo root partition. Skip this step when the target root is already mounted at /mnt/gentoo.
$ sudo cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
–dereference copies the target of a symbolic link, which avoids leaving /mnt/gentoo/etc/resolv.conf pointing at a host path that does not exist inside the chroot.
$ sudo mount --types proc /proc /mnt/gentoo/proc
$ sudo mount --rbind /sys /mnt/gentoo/sys
$ sudo mount --make-rslave /mnt/gentoo/sys
The recursive slave setting keeps later mount changes from propagating back into the host mount tree while still exposing submounts needed inside the chroot.
$ sudo mount --rbind /dev /mnt/gentoo/dev
$ sudo mount --make-rslave /mnt/gentoo/dev
$ sudo mount --bind /run /mnt/gentoo/run
$ sudo mount --make-slave /mnt/gentoo/run
$ sudo chroot /mnt/gentoo /bin/bash
# source /etc/profile
# export PS1="(chroot) ${PS1}"
# cat /etc/gentoo-release Gentoo Base System release 2.18
# pwd /
# ls /proc/self/mounts /proc/self/mounts
# exit
$ sudo umount -R /mnt/gentoo
Do not unmount /mnt/gentoo while another shell, package build, editor, or service still has files open inside the chroot.