How to Troubleshoot Boot Up Issues with CentOS 8

What Do I Need?

  • A Dedicated or VPS Linux Server
  • CentOS

The Problem

Your server has broken and just won’t appear to do what you need it to do. As a sysadmin you should always be looking for the root cause. So you need to do the analysis so as to avoid such failures in the future. In this how-to guide, we’ll look at the basic troubleshooting of booting issues. This is a very high-level overview and things can get pretty deep depending on the booting issue.

  1. Inspecting Logs
    1. Looking at the logs of a previously failed boot can be super useful. If the system journals are persistent across reboots, which they should be, you can use the journalctl tool to inspect those pesky logs.
    2. Remember that by default, the system journals are kept in the /run/log/journal directory, which means the journals are cleared when the system reboots. To store journals in the /var/log/journal directory, which persists across reboots, set the Storage parameter to persistent in /etc/systemd/journald.conf.
    3. Using the following command you can access your journald.conf file and edit as required, ensuring to press ctr+x when finished to save and exit.
    sudo nano /etc/systemd/journald.conf

    How to Troubleshoot Boot Up Issues with CentOS 8

    1. To inspect the logs of a previous boot, use the -b option of journalctl. Without any arguments, the -b option only displays messages since the last boot. With a negative number as an argument, it displays the logs of previous boots. Use the following command:
    sudo journalctl -b -1 -p err

  1. Repair a systemctl Boot Issue

    Enabling the Early Debug Shell
    • By enabling the debug-shell service with systemctl, enabling debug-shell.service, the system spawns a root shell on TTY9 (ctrl+alt+f9) early during the boot sequence. This shell is automatically logged in as root so that administrators can debug the system while the operating system is still booting.
    • Don’t forget to disable the debug-shell.service when you’re done debugging because otherwise, it leaves an unauthenticated root shell open to anyone with local console access.

  1. Using the Emergency and Rescue Targets
    1. By adding the following or alternative to the kernel command line from the boot loader, the system spawns into a rescue or emergency shell instead of starting normally. Both of these shells require the root password.
    systemd.unit=rescue.target
    systemd.unit=emergency.target

    1. The emergency target keeps the root file system mounted read-only, while the rescue target waits for the sysinit.target to complete so that more of the system is correctly initialized; for example, the logging services or the file systems. The root user at this point can not make changes to /etc/fstab until the drive is remounted in a read/write state by using the following command:
    mount -o remount,rw /

    1. Administrators and sysops can use these shells to fix pretty much any issue that prevents the system from booting normally; for example, a dependency loop between services, or an incorrect entry in /etc/fstab. Existing these shells continues the regular boot process.

  1. Identifying Stuck Jobs
    1. During the startup process, systemd spawns a number of jobs. If some of these jobs cannot complete or unexpectedly fail, they block other important jobs from running. To inspect the current job list, administrators can use the following command:
    systemctl list-jobs

    How to Troubleshoot Boot Up Issues with CentOS 8

    1. What you’re hoping for is something a little like above, however, if not, no drama. Any jobs listed as running must complete before the jobs listed as waiting can continue.

Conclusion

There are lots more useful commands to explore so be sure to keep an eye out for more incoming how-to guides on maintaining and monitoring your Linux servers.

How to Install and Setup CentOS 8

CentOS is a Linux operating system that provides an open-source, fully community
6 min read
JB Benjamin
JB Benjamin
Hosting Expert

How to Set Up NextCloud on CentOS 8

NextCloud is one of the best self-hosted solutions for sharing and collaborating
3 min read
JB Benjamin
JB Benjamin
Hosting Expert

How to Install mCrypt on CentOS 8

Essentially the mcrypt extension is a replacement for the classic Unix crypt com
2 min read
JB Benjamin
JB Benjamin
Hosting Expert

How to Install Apache, MySQL, and phpMyAdmin on CentOS 8

Apache is an open-source web server solution, developed and maintained by the Ap
4 min read
JB Benjamin
JB Benjamin
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top