Skip to content

Automated OS Install

Process-ing edited this page Jan 31, 2024 · 2 revisions

Automated OS Install

Because life is treacherous, one of our servers can go down and lose its data. It is important to be able to restore functionality to the server as fast as possible to minimize downtime. One of the steps to allow this is to be able to install and set up the OS automatically without any manual intervention. It is also important for this to be an offline process, as the wifi in NIAEFEUP's room depends on the servers, making a circular dependency.

Our solution was Rocky NInux, a customized image of Rocky Linux designed to run on our servers, able to be installed automatically with everything needed and no human intervention.

How to proceed

  1. Clone the niployments repo from GitHub.
  2. Make sure you have xorriso installed in your machine.
  3. Run create_iso.sh in folder node. This will download an image for Rocky Linux (rocky.iso) and create the custom ISO image ninux.iso.
  4. Copy ninux.iso to a bootable flash drive (for example, using Gnome Disks or dd in the command line).
  5. Plug the flash drive into the server and boot it from the flash drive.
  6. Patiently wait for the OS to be automatically installed. Hopefully you won't need to touch the computer at all for this process to be concluded successfully.

Why Rocky Linux?

Rocky Linux is a free, open-source version of Red Hat Linux. We chose this over Debian Linux because Rocky allows for an offline automatic installation, while Debian requires internet connectivity to be installed. We also needed to configure some custom settings in the original Rocky ISO, and that's why we called it NInux :)

What was changed from the original Rocky ISO?

Some default configurations were set up, like the keyboard and system language. Most importantly, a default SSH key is set up, to enable remote access to the new node. We also made the OS boot in grub, as to allow booting in both BIOS and UEFI mode.

User credentials

  • username: ni
  • password: n1bl04t:)