Difference between revisions of "Talk:Install/Chroot"

From Funtoo
Jump to navigation Jump to search
(Created page with "== Chrooting from working system? == From 'Chroot into Funtoo' funtoo suggest invoking: * cd /mnt/funtoo * mount -t proc none proc * mount --rbind /sys sys * mount --rbind /...")
 
(suggest alternate chroot command to make the install more universally usable.)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Debian compatible chroot ==
running the command which chroot within the env command to produce exact paths to chroot from whatever live environment you're in regardless of chroot being in $PATH or not is probably a good idea. 
{{console|body=
###i## env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l
}}
== Chrooting from working system? ==
== Chrooting from working system? ==


Line 9: Line 15:
Which if invoked from 4.18.18-gentoo-r1 results in:
Which if invoked from 4.18.18-gentoo-r1 results in:


dreamon / # emerge
dreamon / # emerge<br>
Failed to validate a sane '/dev'.
Failed to validate a sane '/dev'.<br>
bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.
bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.<br>


and `mount`:
and `mount`:
ON CHROOT
mount: failed to read mtab: No such file or directory


ON SYSTEM
ON CHROOT
/dev/sda6 on / type btrfs (rw,relatime,ssd,noacl,space_cache,subvolid=5,subvol=/)
mount: failed to read mtab: No such file or directory
devtmpfs on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
ON SYSTEM
tmpfs on /run type tmpfs (rw,nodev,relatime,size=1640628k,mode=755)
/dev/sda6 on / type btrfs (rw,relatime,ssd,noacl,space_cache,subvolid=5,subvol=/)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nodev,relatime,size=1640628k,mode=755)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
openrc on /sys/fs/cgroup/openrc type cgroup  
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
/dev/sdb1 on /home type xfs (rw,relatime,attr2,inode64,noquota)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/sda2 on /boot type ext2 (rw,relatime,errors=continue,user_xattr)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
none on /run/user/1000 type tmpfs (rw,relatime,mode=700,uid=1000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /mnt/funtoo/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
debugfs on /mnt/funtoo/sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /home type xfs (rw,relatime,attr2,inode64,noquota)
selinuxfs on /mnt/funtoo/sys/fs/selinux type selinuxfs (rw,relatime)
/dev/sda2 on /boot type ext2 (rw,relatime,errors=continue,user_xattr)
cgroup_root on /mnt/funtoo/sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
none on /run/user/1000 type tmpfs (rw,relatime,mode=700,uid=1000)
openrc on /mnt/funtoo/sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
sysfs on /mnt/funtoo/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /mnt/funtoo/sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
debugfs on /mnt/funtoo/sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
cpuset on /mnt/funtoo/sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
selinuxfs on /mnt/funtoo/sys/fs/selinux type selinuxfs (rw,relatime)
cpu on /mnt/funtoo/sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup_root on /mnt/funtoo/sys/fs/cgroup type tmpfs  
cpuacct on /mnt/funtoo/sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
(rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
freezer on /mnt/funtoo/sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
openrc on /mnt/funtoo/sys/fs/cgroup/openrc type cgroup  
/dev/sdb1 on /mnt/funtoo/home type xfs (rw,relatime,attr2,inode64,noquota)
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
devtmpfs on /mnt/funtoo/dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
none on /mnt/funtoo/sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
mqueue on /mnt/funtoo/dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
cpuset on /mnt/funtoo/sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
devpts on /mnt/funtoo/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cpu on /mnt/funtoo/sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
shm on /mnt/funtoo/dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
cpuacct on /mnt/funtoo/sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /mnt/funtoo/sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
/dev/sdb1 on /mnt/funtoo/home type xfs (rw,relatime,attr2,inode64,noquota)
devtmpfs on /mnt/funtoo/dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
mqueue on /mnt/funtoo/dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /mnt/funtoo/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /mnt/funtoo/dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)


Was fixed by invoking chroot based on https://wiki.gentoo.org/wiki/Chroot#Configuration
both (mount+emerge err) was fixed by invoking chroot based on https://wiki.gentoo.org/wiki/Chroot#Configuration


Probably should be included in the handbook?
Probably should be included in the funtoo handbook?
 
EDIT: Command used for chroot was "sudo chroot /mnt/funtoo /bin/bash"


-[[User:Kreyren|Kreyren]] ([[User talk:Kreyren|talk]]) 07:45, January 28, 2019 (UTC)
-[[User:Kreyren|Kreyren]] ([[User talk:Kreyren|talk]]) 07:45, January 28, 2019 (UTC)
Same issue, and can be resolved via changing 'mount --rbind /sys sys' to 'mount --rbind /sys /mnt/funtoo/sys'.
Same method apply with '/dev' directory.
-[[User:Jeon|Jeon]] ([[User talk:Jeon|talk]]) April 15, 2021 (UTC)

Latest revision as of 14:07, April 15, 2021

Debian compatible chroot

running the command which chroot within the env command to produce exact paths to chroot from whatever live environment you're in regardless of chroot being in $PATH or not is probably a good idea.

root # env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l

Chrooting from working system?

From 'Chroot into Funtoo' funtoo suggest invoking:

  • cd /mnt/funtoo
  • mount -t proc none proc
  • mount --rbind /sys sys
  • mount --rbind /dev dev

Which if invoked from 4.18.18-gentoo-r1 results in:

dreamon / # emerge
Failed to validate a sane '/dev'.
bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.

and `mount`:

ON CHROOT 
mount: failed to read mtab: No such file or directory

ON SYSTEM
/dev/sda6 on / type btrfs (rw,relatime,ssd,noacl,space_cache,subvolid=5,subvol=/)
devtmpfs on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nodev,relatime,size=1640628k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /sys/fs/cgroup/openrc type cgroup 
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /home type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda2 on /boot type ext2 (rw,relatime,errors=continue,user_xattr)
none on /run/user/1000 type tmpfs (rw,relatime,mode=700,uid=1000)
sysfs on /mnt/funtoo/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /mnt/funtoo/sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
selinuxfs on /mnt/funtoo/sys/fs/selinux type selinuxfs (rw,relatime)
cgroup_root on /mnt/funtoo/sys/fs/cgroup type tmpfs 
(rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /mnt/funtoo/sys/fs/cgroup/openrc type cgroup 
(rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
none on /mnt/funtoo/sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cpuset on /mnt/funtoo/sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /mnt/funtoo/sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /mnt/funtoo/sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /mnt/funtoo/sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
/dev/sdb1 on /mnt/funtoo/home type xfs (rw,relatime,attr2,inode64,noquota)
devtmpfs on /mnt/funtoo/dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2050263,mode=755)
mqueue on /mnt/funtoo/dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /mnt/funtoo/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /mnt/funtoo/dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)

both (mount+emerge err) was fixed by invoking chroot based on https://wiki.gentoo.org/wiki/Chroot#Configuration

Probably should be included in the funtoo handbook?

EDIT: Command used for chroot was "sudo chroot /mnt/funtoo /bin/bash"

-Kreyren (talk) 07:45, January 28, 2019 (UTC)


Same issue, and can be resolved via changing 'mount --rbind /sys sys' to 'mount --rbind /sys /mnt/funtoo/sys'. Same method apply with '/dev' directory.

-Jeon (talk) April 15, 2021 (UTC)