Skip to content

Instantly share code, notes, and snippets.

@sylvchev
Created January 17, 2017 22:42
Show Gist options
  • Save sylvchev/9d1e0bf091d9e699955f8967e083a404 to your computer and use it in GitHub Desktop.
Save sylvchev/9d1e0bf091d9e699955f8967e083a404 to your computer and use it in GitHub Desktop.
chrooting in a gentoo for installation purpose (from a debian-based system)
sudo su -
mkdir /mnt/gentoo && mount /dev/sda3 /mnt/gentoo/ && mount /dev/sda2 /mnt/gentoo/boot/ && mount /dev/sda1 /mnt/gentoo/mnt/efi && cp -L /etc/resolv.conf /mnt/gentoo/etc/ && mount -t proc proc /mnt/gentoo/proc && mount --rbind /sys /mnt/gentoo/sys && mount --make-rslave /mnt/gentoo/sys && rm /dev/shm && mkdir /dev/shm && mount -t tmpfs -o nosuid,nodev,noexec shm /dev/shm && chmod 1777 /dev/shm && mount --rbind /dev /mnt/gentoo/dev && mount --make-rslave /mnt/gentoo/dev && chroot /mnt/gentoo /bin/bash
. /etc/profile
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -R /mnt/gentoo
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment