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. ...@@ -71,20 +71,40 @@ which we'll use below.
* LVM, with separate volume groups for different medium (SSD vs * LVM, with separate volume groups for different medium (SSD vs
HDD) HDD)
This can be done with one of the `tor-install-format-disks` in the We are experimenting with FAI's [setup-storage](https://manpages.debian.org/setup-storage) to partition
`tsa-misc` repository, which should be carefully checked and disks instead of rolling our own scripts. You first need to
configured before running. checkout the installer's configuration:
To get the scripts onto the host, you can clone them using apt install git
`git clone https://git.torproject.org/admin/tsa-misc`. 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 Check that the above hashes match a trusted copy.
`(cd tsa-misc && git show-ref master)`.
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 4. Install the system. This can be done with `grml-debootstrap` which
will also configure grub, a root password and so on. This should will also configure grub, a root password and so on. This should
get you started, assuming the formatted root disk is mounted on 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 # make target/run stay clean
mkdir -p /target/run && mount -t tmpfs tgt-run /target/run mkdir -p /target/run && mount -t tmpfs tgt-run /target/run
...@@ -92,7 +112,6 @@ which we'll use below. ...@@ -92,7 +112,6 @@ which we'll use below.
mkdir /target/run/udev && mount -o bind /run/udev /target/run/udev mkdir /target/run/udev && mount -o bind /run/udev /target/run/udev
ROOTPASSWORD=\$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 30) \ 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 && \ apt-get install -y grml-debootstrap && \
sed -e 's/postfix//; sed -e 's/postfix//;
s/vlan//; s/vlan//;
...@@ -109,7 +128,7 @@ which we'll use below. ...@@ -109,7 +128,7 @@ which we'll use below.
$adbus $adbus
$acryptsetup-initramfs $acryptsetup-initramfs
' /etc/debootstrap/packages > /root/grml-packages && ' /etc/debootstrap/packages > /root/grml-packages &&
grml-debootstrap --grub "$bootdisk" --target /target \ grml-debootstrap --grub "$BOOT_DEVICE" --target /target \
--hostname `hostname` --release buster \ --hostname `hostname` --release buster \
--mirror https://mirror.hetzner.de/debian/packages/ \ --mirror https://mirror.hetzner.de/debian/packages/ \
--packages /root/grml-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