1. Introduction

The Linux boot process is a complex step-by-step procedure that ensures each part of the operating system gets properly loaded at the right time. Depending on the components within a given installation, it can take a significant amount of time for all of them to get initialized. While waiting, a user might want to see some feedback about the startup process. Further, there might be a need for more data during analysis after the fact.

In this tutorial, we talk about system booting and ways to make it more verbose. First, we briefly refresh our knowledge about the boot log. After that, we explain a common setting that hides verbose information during startup. Next, we show two options to increase the verbosity during boot. Finally, we explore a more convenient way to go through the logs after the system has booted.

We tested the code in this tutorial on Debian 12 (Bookworm) with GNU Bash 5.2.15. It should work in most POSIX-compliant environments unless otherwise specified.

2. Boot Log

The boot log is a textual record of the activities during system startup:

[...]
Jan 10 10:00:01 xost kernel: system 00:08: [mem 0x00100000-0xf7ffffff] could not be reserved
Jan 10 10:00:01 xost kernel: system 00:08: [mem 0xfffc0000-0xffffffff] has been reserved
Jan 10 10:00:01 xost kernel: pnp: PnP ACPI: found 9 devices
Jan 10 10:00:01 xost kernel: clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
Jan 10 10:00:01 xost kernel: NET: Registered PF_INET protocol family
Jan 10 10:00:01 xost kernel: IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
Jan 10 10:00:01 xost kernel: tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
Jan 10 10:00:01 xost kernel: Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
Jan 10 10:00:01 xost kernel: TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
Jan 10 10:00:01 xost kernel: TCP bind hash table entries: 16384 (order: 7, 524288 bytes, linear)
Jan 10 10:00:01 xost kernel: TCP: Hash tables configured (established 16384 bind 16384)
Jan 10 10:00:01 xost kernel: MPTCP token hash table entries: 2048 (order: 3, 49152 bytes, linear)
Jan 10 10:00:01 xost kernel: UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
Jan 10 10:00:01 xost kernel: UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
Jan 10 10:00:01 xost kernel: NET: Registered PF_UNIX/PF_LOCAL protocol family
Jan 10 10:00:01 xost kernel: NET: Registered PF_XDP protocol family
Jan 10 10:00:01 xost kernel: pci_bus 0000:00: resource 4 [mem 0xfe0000000-0xfffffffff window]
[...]

This is a snapshot that includes memory allocation, networking, peripherals, and other initialization information. Exactly what goes into this record depends on several factors.

Further, we might see the log scroll on the screen during the boot process. However, since this diagnostic information isn’t usually important for the regular user, boot data often isn’t shown by default. Instead, we might see an image or loading animation.

3. Stop Hiding Textual Boot Data

By default, on many major Linux distribution installations, two kernel boot parameters limit and control the visual feedback of the boot process:

  • quiet: prevent any text feedback during booting
  • splash: show splash screen image

In particular, having quiet in the kernel command line means no textual information about the system startup is displayed. On the other hand, splash shows a boot image instead:

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
░░░░░░░░░████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░█████████████████████████▒░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████

Conversely, to display textual feedback instead, we omit quiet from the respective boot configuration.

For instance, let’s check the current settings in the GRUB settings file /etc/default/grub:

$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
[...]

In this case, we see the GRUB_CMDLINE_LINUX_DEFAULT option, which sets the command line parameters at boot.

So, let’s remove quiet:

$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
[...]

Of course, we probably also need to run update-grub to apply the changes:

$ update-grub

Now, we should be able to see textual information during the boot process.

4. Increase Verbosity

Naturally, when it comes to the services and custom software components of a given system, their output depends on the implementation and settings.

However, there are two main options to increase the general verbosity of boot logs. One is fairly universal, while the other can increase the boot log verbosity in Linux installations that use systemd. Importantly, these are also kernel command line parameters.

4.1. loglevel

The loglevel kernel boot parameter ensures any kernel message with a smaller log level is printed to the terminal:

+---+--------------+----------------------------------+
| N | Mnemonic     | Description                      |
+---+--------------+----------------------------------+
| 0 | KERN_EMERG   | system is unusable               |
| 1 | KERN_ALERT   | action must be taken immediately |
| 2 | KERN_CRIT    | critical conditions              |
| 3 | KERN_ERR     | error conditions                 |
| 4 | KERN_WARNING | warning conditions               |
| 5 | KERN_NOTICE  | normal but significant condition |
| 6 | KERN_INFO    | informational                    |
| 7 | KERN_DEBUG   | debug-level messages             |
+---+--------------+----------------------------------+

Thus, we can decide on the level we want by assigning a value such as loglevel=7 for complete debugging verbosity.

4.2. systemd.log_level

Similar to the loglevel setting, systemd.log_level filters which systemd system manager messages are output to the terminal. Notably, the levels are equivalent to those for the kernel:

  1. emerg
  2. alert
  3. crit
  4. err
  5. warning
  6. notice
  7. info
  8. debug

In fact, setting systemd.log_level should also set the loglevel value above.

Still, we usually do both explicitly:

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.10.0-666-amd64 root=UUID=606660e8-7a07-4fc2-dead-27eddeade7a0 ro loglevel=7 systemd.log_level=debug

In this case, we confirm the current kernel command-line parameters via the cmdline file in the /proc pseudo-filesystem.

5. System Log

Although we could pause the boot screen via flow control shortcuts like Ctrl+S, it’s usually better to use the system log:

$ journalctl --boot
Jan 01 00:06:56 xost kernel: Linux version 5.10.0-666-amd64 ([email protected]) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.179-1 (2023-05-12)
Jan 01 00:06:56 xost kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-666-amd64 root=UUID=606660e8-7a07-4fc2-dead-27eddeade7a0 ro loglevel=7 systemd.log_level=debug
Jan 01 00:06:56 xost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jan 01 00:06:56 xost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Jan 01 00:06:56 xost kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Jan 01 00:06:56 xost kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
Jan 01 00:06:56 xost kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
Jan 01 00:06:56 xost kernel: BIOS-provided physical RAM map:
[...]

In this case, we check the system logs from the last –boot procedure.

In fact, we can even see the kernel boot parameters that we set:

Jan 01 00:06:56 xost kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-666-amd64 root=UUID=606660e8-7a07-4fc2-dead-27eddeade7a0 ro loglevel=7 systemd.log_level=debug

Thus, we can freely scroll and search through the boot log without needing to reboot.

6. Summary

In this article, we talked about showing and increasing the verbosity of the boot log.

In conclusion, we can display a large amount of debugging information during boot, but it’s usually more convenient to check and parse it via the system log facility.

Comments are closed on this article!