commit 7fdf28e4c6fc87febb4f7ebdd0fda4dc52c53163 Author: root Date: Mon Apr 2 17:33:50 2018 +0200 init diff --git a/debootstrap.sh b/debootstrap.sh new file mode 100755 index 0000000..5a6a847 --- /dev/null +++ b/debootstrap.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + + +apt-get -y install mdadm btrfs-tools + +"./parted/${1}.sh" + +cryptsetup luksFormat /dev/md0 +cryptsetup open --type luks /dev/md0 md0-unlocked + +mkfs.btrfs /dev/mapper/md0-unlocked + +mkdir /mnt/md0-unlocked +mount /dev/mapper/md0-unlocked /mnt/md0-unlocked + +debootstrap --variant=minbase --arch=amd64 stretch /mnt/md0-unlocked https://deb.debian.org/debian/ + +mount -t proc none /mnt/md0-unlocked/proc +mount -t sysfs none /mnt/md0-unlocked/sys +mount -o bind /dev /mnt/md0-unlocked/dev diff --git a/parted/ovh.sh b/parted/ovh.sh new file mode 100755 index 0000000..e02eb13 --- /dev/null +++ b/parted/ovh.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + + +parted /dev/sda mklabel msdos Yes +parted /dev/sda mkpart primary 1 440GiB +parted /dev/sdb mklabel msdos Yes +parted /dev/sdb mkpart primary 1 440GiB + +mdadm -C /dev/md0 --force -l1 -n2 /dev/sda1 /dev/sdb1 <<< yes