various fixes
[automated-distro-installer] / README
diff --git a/README b/README
index 3e6123b51c2ef09566d1c740010769115b7c0bad..f77aa11235945efd4c4c26610eaf1f2eee41c17e 100644 (file)
--- a/README
+++ b/README
@@ -81,6 +81,53 @@ fai-wrapper # use fai classes outside of fai. sourced, not called.
 faiserver-disable # Disable the fai nfs server exports
 fresize # resize swap or boot partitions in a host
 
+# Replacing a raid 10 disk
+
+pxe-server -S HOST fai
+ssh root@HOST
+cat >p
+PASSWORD HERE(ctrl-d ctrl-d)
+for d in /dev/disk/by-id/ata*part1; do cryptsetup luksOpen --key-file p $d crypt_dev_${d##*/}; done
+# btrfs replace disk # i forget the actual command
+x=(/dev/mapper/*part1); mount -o subvol=root_trisquelflidas $x /mnt
+mount -o subvol=boot_trisquelflidas /dev/sda3 /mnt/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
+
+
+# dirinstall
+
+host=kw
+distro=flidas
+t=/tmp/d
+# be root:
+sudo sed -i 's/^LOGUSER=/#LOGUSER=/' /etc/fai/fai.conf
+# required after a failed run
+umount /var/lib/fai/config ||:
+fai-redep faiserver $distro
+rm -rf $t ; mkdir $t; fai -N -u $host dirinstall $t
+
+# cleanup:
+sudo sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf
+s umount -R $t/proc
+
+
+# Turning a dirinstall into a basefile. taken from mk-basefile
+
+chroot $t apt-get clean
+rm -f $t/etc/hostname $t/etc/resolv.conf \
+      $t/var/lib/apt/lists/*_* $t/usr/bin/qemu-*-static \
+      $t/etc/udev/rules.d/70-persistent-net.rules
+> $t/etc/machine-id
+tar --one-file-system -C $t -cf - . | gzip > /a/bin/fai-basefiles/basefiles/FLIDAS64X.tar.gz
 
 License stuff:
 The license for the project is GPLv2 or later, mostly because fai is and