From 32b7fb38af85cc2442dba2e5af4aae752fd149ff Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 7 Jun 2021 09:07:26 +0200 Subject: [PATCH] add chroot mount script --- chroot-off.sh | 10 ++++++++++ chroot-on.sh | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 chroot-off.sh create mode 100755 chroot-on.sh diff --git a/chroot-off.sh b/chroot-off.sh new file mode 100755 index 0000000..8995f10 --- /dev/null +++ b/chroot-off.sh @@ -0,0 +1,10 @@ + +dir=/mnt/custom + +umount $dir/sys +umount $dir/proc +umount $dir/dev +umount $dir/var +umount $dir/home +umount $dir + diff --git a/chroot-on.sh b/chroot-on.sh new file mode 100755 index 0000000..e594409 --- /dev/null +++ b/chroot-on.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +dir=/mnt/custom + +ROOT=/dev/sdb2 +VAR=/dev/sdb3 +HOME=/dev/sdb6 + +mount $ROOT $dir +mount --bind /sys $dir/sys +mount --bind /proc $dir/proc +mount --bind /dev $dir/dev +mount --bind /run $dir/run +mount $VAR $dir/var +mount $HOME $dir/home + +chroot $dir -- 2.39.5