Skip to content
Snippets Groups Projects
Verified Commit 297b09ee authored by anarcat's avatar anarcat
Browse files

get rid of install-disks script in favor of setup-storage

The thing just works. It does everything we need except maybe picking
arbitrary labels for RAID arrays (and that might even be possible to
work around).

By using a configuration file and setup-storage, we bring ourselves
closer to standardizing and automating the installer.

setup-storage also has the advantage of being idempotent, mostly: I
was able to run and rerun it multiple times from the rescue shell. The
only thing I had to do was to close LUKS devices, if I remember
correctly. But it was much easier to test than a shell script.

Finally, it provides nice features like dumping the fstab, crypttab
and mdadm.conf for us to use. We don't use those just yet.

It also provides a shell script that can be sourced to get various
targets, which we use.
parent 4b8f36ee
No related branches found
No related tags found
No related merge requests found
......@@ -71,20 +71,40 @@ which we'll use below.
* LVM, with separate volume groups for different medium (SSD vs
HDD)
This can be done with one of the `tor-install-format-disks` in the
`tsa-misc` repository, which should be carefully checked and
configured before running.
We are experimenting with FAI's [setup-storage](https://manpages.debian.org/setup-storage) to partition
disks instead of rolling our own scripts. You first need to
checkout the installer's configuration:
To get the scripts onto the host, you can clone them using
`git clone https://git.torproject.org/admin/tsa-misc`.
apt install git
git clone https://git.torproject.org/admin/tsa-misc
cd tsa-misc/installer
git show-ref master
Check that the master hash matches what you expect
`(cd tsa-misc && git show-ref master)`.
Check that the above hashes match a trusted copy.
Use the following to setup a Ganeti node, for example:
apt install fai-setup-storage
setup-storage -f "disk_config/gnt-fsn" -X
TODO: convert the other existing `tor-install-format-disks-4HDDs`
script into a `setup-storage` configuration.
And finally mount the filesystems:
. /tmp/fai/disk_var.sh
mkdir /target
mount "$ROOT_PARTITION" /target
mkdir /target/boot
mount "$BOOT_PARTITION" /target/boot
4. Install the system. This can be done with `grml-debootstrap` which
will also configure grub, a root password and so on. This should
get you started, assuming the formatted root disk is mounted on
`/target`:
`/target` and that the boot device is defined by `$BOOT_DEVICE`
(populated above by FAI):
# make target/run stay clean
mkdir -p /target/run && mount -t tmpfs tgt-run /target/run
......@@ -92,7 +112,6 @@ which we'll use below.
mkdir /target/run/udev && mount -o bind /run/udev /target/run/udev
ROOTPASSWORD=\$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 30) \
echo -n "boot disk device: " && read bootdisk &&
apt-get install -y grml-debootstrap && \
sed -e 's/postfix//;
s/vlan//;
......@@ -109,7 +128,7 @@ which we'll use below.
$adbus
$acryptsetup-initramfs
' /etc/debootstrap/packages > /root/grml-packages &&
grml-debootstrap --grub "$bootdisk" --target /target \
grml-debootstrap --grub "$BOOT_DEVICE" --target /target \
--hostname `hostname` --release buster \
--mirror https://mirror.hetzner.de/debian/packages/ \
--packages /root/grml-packages \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment