]> git.parisson.com Git - clone-me.git/commitdiff
add chroot mount script
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 7 Jun 2021 07:07:26 +0000 (09:07 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 7 Jun 2021 07:07:26 +0000 (09:07 +0200)
chroot-off.sh [new file with mode: 0755]
chroot-on.sh [new file with mode: 0755]

diff --git a/chroot-off.sh b/chroot-off.sh
new file mode 100755 (executable)
index 0000000..8995f10
--- /dev/null
@@ -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 (executable)
index 0000000..e594409
--- /dev/null
@@ -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