From 7f0dde3687b1129403072ff4f8726178a080e2f8 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 2 Sep 2024 17:20:13 -0500 Subject: [PATCH] add new script: mount_raid_array --- builds/utils/mount_raid_array | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 builds/utils/mount_raid_array diff --git a/builds/utils/mount_raid_array b/builds/utils/mount_raid_array new file mode 100755 index 0000000..3e2ef1b --- /dev/null +++ b/builds/utils/mount_raid_array @@ -0,0 +1,20 @@ +#!/bin/sh + +hostname=$(hostname) + +if [ "$hostname" != "copernicus" ]; then + echo "this script should be run only on copernicus" + exit 1 +fi + +if [ "$1" = "umount" ]; then + sudo umount ~/mount + sudo mdadm --stop /dev/md0 + + echo "done" + exit 0 +fi + +sudo mdadm --assemble --run /dev/md0 /dev/sdb2 /dev/sdc2 +mkdir -p ~/mount +sudo mount /dev/md0 ~/mount