prepare_luks.sh 366 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # Overwrite default variables from config file
  3. cd /installer
  4. [ -f ./config.sh ] && source config.sh
  5. # Check if partition exists
  6. disk2=$disk"p3"
  7. if ! [ -b $disk2 ]
  8. then
  9. echo $disk2 does not exist!
  10. exit
  11. fi
  12. mkdir -p /srv/data
  13. cryptsetup luksFormat $disk2
  14. cryptsetup luksOpen $disk2 data
  15. mkfs.ext4 /dev/mapper/data
  16. mount /dev/mapper/data /srv/data