Toastie 1 year ago
parent
commit
c425e528f5
1 changed files with 21 additions and 0 deletions
  1. 21 0
      prepare_luks.sh

+ 21 - 0
prepare_luks.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Overwrite default variables from config file
+[ -f ./config.sh ] && source config.sh
+
+
+# Check if partition exists
+disk2=$disk"p3"
+if [ -b $disk2 ]
+then
+  echo $disk2 does not exist!
+  exit
+fi
+
+
+mkdir -p /srv/data
+
+cryptsetup luksFormat $disk2
+cryptsetup luksOpen $disk2 data
+mkfs.ext4 /dev/mapper/data
+mount /dev/mapper/data /srv/data