Skip to content

Instantly share code, notes, and snippets.

@coalwater
Created November 14, 2018 12:54
Show Gist options
  • Save coalwater/2e5c5fbe69edf3defcbd3cae09573547 to your computer and use it in GitHub Desktop.
Save coalwater/2e5c5fbe69edf3defcbd3cae09573547 to your computer and use it in GitHub Desktop.
Mounting another linux system on your already running system
# run as root or add sudo
mount /dev/sdX /mnt
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount -t proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /tmp /mnt/tmp
chroot /mnt /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment