+
+
+# Replacing a raid 10 disk
+
+# i expect better results with newer kernel and btrfs progs than the default stretch
+fai-server buster
+
+pxe-server -S HOST fai
+
+# btrfs replace or delete. prefer replace. to setup partitions on replacement drive:
+scp fai-wrapper HOST:
+ssh root@HOST
+. fai-wrapper
+export SPECIAL_DISK=/dev/REPLACEMENT_DEV
+/var/lib/fai/config/hooks/partition.DEFAULT
+
+
+ssh root@HOST
+for x in /target/* /target; do umount $x; done
+cat >p
+PASSWORD HERE(ctrl-d ctrl-d)
+cd /dev/disk/by-id/
+for d in ata*part1; do cryptsetup luksOpen -d /root/p $d crypt_dev_$d; done
+x=(/dev/mapper/*part1); mount -o subvol=root_trisquelflidas $x /mnt
+# btrfs fi show /mnt
+# btrfs replace start -f /dev/mapper/OLD_DEV /dev/mapper/NEW_DEV /mnt
+# btrfs replace status /mnt
+# nohup btrfs dev delete /dev/sde1 /mnt
+mount -o subvol=boot_trisquelflidas /dev/sda3 /mnt/boot
+# also replace or delete disk for boot
+for x in dev proc sys; do mount -o bind /$x /mnt/$x; done
+chroot /mnt /bin/bash
+# replace disk in fstab
+# replace disk in /etc/crypttab
+update-grub
+update-initramfs -u
+mount /a
+/a/exe/keyscript-on
+exit
+reboot
+
+
+# Expected output in fai logs
+
+For flidas, when installing systemd, this error happens, and it's
+a superflous upstream bug based on reading the post install script:
+
+addgroup: The group `systemd-journal' already exists as a system group. Exiting.
+Operation failed: No such file or directory
+
+
+# linode notes
+
+* create 2 disks, installer (3000 mb, raw), boot (remaining, raw)
+* create 2 profiles w direct boot, no helpers:
+ * installer (sda=boot, sdb=installer, boot dev=sdb)
+ * boot (sda=boot)
+* Boot into rescue mode, ssh in with lish,
+ curl url_to_some_fai_cd_created_image | dd of=/dev/sda
+ poweroff
+* boot into installer.
+* Lish shows console, at the end of install, it gives prompt because
+ logs failed to save remotely, check the logs, then reboot into boot
+ profile if all is well. If that doesn't happen, turn off lassie in
+ settings.
+
+
+# ubuntu notes
+
+For someone who really needed ubuntu on host tp, otherwise they would
+end up on a non-gnu os, and I didn't want to figure out how to get all
+the default software installed, I did the following:
+
+# On remote host:
+# install etiona
+cd /b/fai
+# set 51-multi-boot to set classes outside of fai-wrapper conditional, including NOWIPE
+. fai-wrapper
+./fai/config/hooks/partition.DEFAULT
+
+# on local host
+# install ubuntu 20.04 using virt-install
+s virt-install --os-variant=ubuntu16.04 --cdrom ubuntu-20.04-desktop-amd64.iso --disk path=u2004.qcow2 -r 2048 --vcpus 1 -n u2004
+sudo qemu-img create -o preallocation=metadata -f qcow2 u2004.qcow2 15G
+modprobe nbd
+qemu-nbd --connect=/dev/nbd0 u2004.qcow2 -f qcow2
+s mount /dev/nbd0p5 /mnt/1
+s rsync -avhSAXP --numeric-ids /mnt/1/ root@tp:/mnt/root/root_ubuntubionic
+
+# on remote host:
+# mount boot and root to /mnt/1
+sudo -i
+cd /mnt/1
+cp /tmp/fai/crypttab etc
+cp /tmp/fstab etc
+chrbind
+chroot .
+# install programs from /a/bin/fai/fai/config/package_config/STANDARD:
+apt install openssh-client openssh-server cryptsetup keyutils btrfs-progs console-setup kbd pciutils usbutils unattended-upgrades initramfs-tools-core dropbear-initramfs
+exit
+# install authorized keys in dropbear and .ssh folder
+chroot .
+grub-install --no-floppy $(grub-probe -tdrive -d /dev/sda3)
+update-grub
+grub-bios-setup -d /boot/grub/i386-pc -s /dev/sda
+exit
+umount proc
+umount dev
+umount sys
+reboot
+
+
+# TODO
+Change arch to archlike and to support arch and parabola
+
+
+# License
+
+The license for the project is GPLv2 or later, mostly because fai is and
+I periodically merge the upstream example config, which contains small
+scripts. Also, there is a modified encrypt.upstream, which is from the
+cryptsetup package in arch, which is under the same license.