Skip to content

Instantly share code, notes, and snippets.

@gsauthof
Created March 21, 2020 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsauthof/7c0b65ffe4da38b83c8c61d79b71c6d7 to your computer and use it in GitHub Desktop.
Save gsauthof/7c0b65ffe4da38b83c8c61d79b71c6d7 to your computer and use it in GitHub Desktop.
Chroot Example
# assuming /mnt/root/{root,home} are mounts of anothers system root+home filesystems
cd /mnt/root/root
mount --bind /proc proc
mount --bind /sys sys
mount --bind /dev dev
cp /etc/resolv.conf etc/
cd /mnt/root
mount --bind home root/home
chroot root /usr/bin/zsh
# leave via Ctrl+D (EOT), exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment