====== Setup: ======
ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no root@37.187.172.225
apt install cryptsetup mdadm vim lvm2 debootstrap
gdisk /dev/sda
o
Y
n
ENTER
ENTER
16M
ef02
n
ENTER
ENTER
100M
fd00
n
ENTER
ENTER
ENTER
fd00
b
backup.gpt
w
Y
gdisk /dev/sdb
r
l
backup.gpt
w
Y
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
YES
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
YES
mkfs.ext4 /dev/md0
cryptsetup -s 512 -c aes-xts-plain64 luksFormat /dev/md1
YES
$Passwort
cryptsetup luksDump /dev/md1 | grep UUID
cryptsetup luksOpen /dev/md1 md1_crypt
pvcreate /dev/mapper/md1_crypt
vgcreate elliotVG /dev/mapper/md1_crypt
lvcreate -L 32g -n swap elliotVG
lvcreate -L 50g -n root elliotVG
mkfs.ext4 -L root /dev/mapper/elliotVG-root
mount /dev/mapper/elliotVG-root /mnt
mkdir /mnt/boot
mount /dev/md0 /mnt/boot
# Install
debootstrap --arch amd64 stretch /mnt http://ftp2.de.debian.org/debian
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t tmpfs none /mnt/tmp
mount -o bind /sys /mnt/sys
XTERM=xterm-color LANG=C.UTF-8 chroot /mnt /bin/bash
cd /root/; touch elliot
passwd
apt install locales
dpkg-reconfigure locales
dpkg-reconfigure tzdata
echo 'md1_crypt UUID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee none luks' > /etc/crypttab
vim /etc/dropbear-initramfs/authorized_keys
vim /etc/fstab
LABEL=root / ext4 errors=remount-ro,relatime 0 1
/dev/md0 /boot ext4 rw,nosuid,nodev 0 2
LABEL=swap none swap sw 0 0
ln -sf /proc/mounts /etc/mtab
grep DRIVER /sys/class/net/eth0/device/uevent
nach /etc/initramfs-tools/modules schreiben
apt install makedev linux-image-amd64 ssh grub-pc pciutils psmisc cryptsetup dropbear busybox mdadm vim lvm2 kbd console-setup
/etc/default/grub
GRUB_CMDLINE_LINUX="ip=37.187.172.225::37.187.172.254:255.255.255.0::eth0:none"
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0"
update-initramfs -uv
zcat /boot/initrd.img-4.* | cpio -t conf/conf.d/cryptroot etc/lvm/lvm.conf etc/dropbear/\* root/.ssh/authorized_keys sbin/dropbear
grub-install /dev/sda
grub-install /dev/sdb
update-grub