Skip to content

Instantly share code, notes, and snippets.

@Forty-Bot
Last active October 13, 2019 18:23
Show Gist options
  • Select an option

  • Save Forty-Bot/7b608f3a17933f007d7ea8fd8d780a1b to your computer and use it in GitHub Desktop.

Select an option

Save Forty-Bot/7b608f3a17933f007d7ea8fd8d780a1b to your computer and use it in GitHub Desktop.
mount -t tmpfs upper /mnt
mkdir /mnt/{upper,work,newroot}
mount -t overlay overlay -o lowerdir=/,upperdir=/mnt/upper,workdir=/mnt/work /mnt/newroot
cd /mnt/newroot
pivot_root . mnt
# exec chroot . bash
# bash: /mnt/chroot: No such file or directory
# exec /mnt/bin/chroot . bash
# /mnt/bin/chroot: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
# exec /mnt/bin/busybox chroot . bash
# chroot: can't execute 'bash': No such file or directory
# exec /mnt/bin/bysubox chroot . /mnt/bin/busybox sh
# works but dynamic executables are broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment