LinuxCommandLibrary

boot

Boot the system

TLDR

Start a REPL session either with the project or standalone

$ boot repl
copy

Build a single uberjar
$ boot jar
copy

Generate scaffolding for a new project based on a template
$ boot --dependencies boot/new new --template [template_name] --name [project_name]
copy

Build for development (if using the boot/new template)
$ boot dev
copy

Build for production (if using the boot/new template)
$ boot prod
copy

Display help for a specific task
$ boot [task] --help
copy

SYNOPSIS

The act of booting a Linux system from a running state is typically initiated by system restart commands.
To trigger a system boot (restart):
reboot [OPTIONS]
shutdown -r [OPTIONS] [TIME] [MESSAGE]

PARAMETERS

reboot specific options (commonly used to initiate a system restart):
    Parameters for the reboot command.

-f, --force
    Force an immediate reboot, bypassing graceful shutdown and not writing to wtmp.

-p, --poweroff
    Power off the system instead of rebooting (behaves like poweroff command).

shutdown -r specific options (commonly used to schedule a system reboot):
    Parameters for the shutdown -r command to initiate a reboot.

TIME
    When to perform the reboot. Can be 'now', '+M' (M minutes from now), or 'hh:mm'.

MESSAGE
    A custom message to send to all logged-in users before the reboot.

-c
    Cancel a pending shutdown/reboot.

DESCRIPTION

The term 'boot' in Linux refers to the comprehensive process of starting up a computer and loading the operating system. Unlike many other Linux functionalities, 'boot' is not a standalone executable command (e.g., /usr/bin/boot) that you would execute directly with parameters. Instead, it's a complex sequence of operations involving firmware, a bootloader, the kernel, and the init system. The typical boot sequence begins with the system's firmware (BIOS or UEFI) performing POST (Power-On Self-Test) and then locating and executing the bootloader (commonly GRUB, LILO, or systemd-boot) from a storage device. The bootloader is responsible for loading the Linux kernel and an initial ramdisk (initramfs or initrd) into memory. Finally, the kernel takes control and launches the init system (like systemd, Upstart, or SysVinit), which then brings up the rest of the system services and presents the user with a login prompt or graphical environment. Commands like reboot(8) or shutdown(8) are used to initiate a restart, which includes the entire boot process.

CAVEATS

The term 'boot' represents a complex system startup process, not a single executable command on a Linux system.
Initiating a system boot from a running system (i.e., a restart) typically requires root privileges.
Successful booting depends on various underlying components: a correctly configured bootloader (e.g., GRUB), a compatible kernel, and a functional initial RAM filesystem (initramfs).
Issues during the boot sequence can render a system unbootable, often requiring rescue mode or live media for repair.
The exact steps and tools involved can vary significantly between systems using traditional BIOS/MBR and newer UEFI/GPT setups, as well as different bootloaders and init systems.

THE BOOTLOADER

The bootloader (e.g., GRUB, LILO, systemd-boot) is firmware-agnostic software that loads the Linux kernel and initial ramdisk into memory. It often provides a menu to select different operating systems or kernel versions, allowing for multi-boot setups.

INITIAL RAM FILESYSTEM (INITRAMFS)

An initramfs (or initrd) is a compressed CPIO archive containing a minimal root filesystem. It's loaded into memory by the bootloader and provides essential modules and utilities (like filesystem drivers, RAID/LVM support) needed to mount the actual root filesystem before the main system fully initializes.

THE INIT SYSTEM

After the kernel is loaded and the root filesystem is mounted, the kernel executes the init system (e.g., systemd, SysVinit). The init system is the first user-space process and is responsible for starting all other system services, managing daemons, mounting filesystems, and bringing the system to a usable state, eventually presenting a login prompt or graphical environment.

HISTORY

The Linux boot process has evolved significantly over time. Early Linux systems primarily relied on BIOS for firmware and bootloaders like LILO or early versions of GRUB to load the kernel, which then directly initialized the system using SysVinit scripts. The introduction of initramfs (initial RAM filesystem) allowed for more flexible and modular kernel loading, supporting various hardware and file systems. The shift from BIOS/MBR to UEFI/GPT introduced new boot mechanisms, including secure boot and different boot entry management. Concurrently, init systems evolved from SysVinit to Upstart and most recently to systemd, fundamentally changing how services are managed during startup. These advancements have made the boot process more robust and versatile, but also more complex and layered.

SEE ALSO

reboot(8), shutdown(8), init(8), systemd(1), grub-install(8), bootctl(1), fstab(5)

Copied to clipboard