|

systemd to Allow Automatic Fallback to an Older Kernel in Case of Boot Failure

Recently, systemd launched a new feature to manage boot failure. Let’s read about it in this short coverage on the same.

What is systemd, again?

systemd

Systemd is a system daemon that serves as a software suite of basic building blocks for a Linux system. It facilitates system and service management and starts the rest of the system. It is conventionally represented all in lowercase letters as systemd (system daemon) according to Unix/Linux standards.

It was started as a developer project in 2010 by Lennart Poettering and Kay Sievers. Fedora became the first major distribution to include systemd by default since May 2011.

Inclusion of systemd created some sort of revolt in veteran Linux users. Distributions like Devuan were created just to keep systemd away.

I am not going into the systemd vs init debate here. That’s entirely your call if you understand the technicalities. I am going to share the new feature of systemd along with my experience in fixing boot failure with it.

Boot Counting: Systemd’s Newest Feature 

As the phrase suggests, counting boot attempts is a part of a revised version of systemd’s “Automatic Boot Assessment”, which allows tracking kernel boots and failures.

With the help of this assessment, the system can automatically revert to a previous version of the OS/kernel, in case a newer one refuses to boot successfully due to failure.

The revised set of features of systemd’s new Automatic Boot Assessment is available on the GitHub documentation. You may read it if you are interested in the technical details.

The developers also suggest that in addition to providing a complete solution on UEFI systems, the different components may also be used independently in combination with other software.

Diagnosing issues with systemd: My Experience

I am excited about this new feature of systemd. This could save a lot of time and trouble for Linux users. I’ll share my experience with boot problem BEFORE systemd introduced this boot failure feature.

Systemd has helped me diagnose an issue in the past on my dual boot system and I think it would be useful to share the experience here, to know about its resourcefulness:

Once, while attempting to boot my Ubuntu 16.04 LTS system, I got the following error message after selecting the same from GRUB:

systemctl boot failure in Ubuntu

I was alarmed as to why being “greeted” with such an annoying message all of a sudden after a busy day at work. When I read that it is mentioning one of my PC hard disks (/dev/sdb3), I got the hint that it might have to do something with Windows 10’s hibernate feature and the fact that shutdown attempts on Windows 10 are actually partial hibernations for a faster bootup.

As soon as I got this hint, I booted into Windows and did a complete shutdown by holding on to the Shift key and then clicking on Shutdown from the Windows Startup menu, after which I was successfully able to login to Ubuntu. Henceforth, I disabled “fast startup” and hibernation on Windows.

When I looked into the logs with the help of the command, back on Ubuntu, I found out that the error message is a part of systemd’s features. I used the following command to store the complete output of the command in a log file:

journalctl -xb | tee systemdlogged.log

On going through the log file, I could reconfirm that it was indeed due to a partial hibernation on Windows 10 (Cannot create session: Already running ina session).

Love it or hate it?

As you can see that this new automatic fallback to older kernel would save Linux users some trouble here.  

This idea would enable implementation of similar schemes on other boot loaders or non-UEFI systems. Perhaps systemd can also be considered for use with LinuxBoot in future?

Similar Posts

  • I did a clean install of Linux Mint 19.1 and I also kept my Linux Mint 19 (which was on the same ssd as 19.1) The newer version would boot up with no problems and very fast. When I tried to boot into version 19 I was getting the exact same message as you mention “Once, while attempting to boot my Ubuntu 16.04 LTS system, I got the following error message after selecting the same from GRUB:” This is the only article I have found that has helped me deal with this error… thanks

  • That’s actually really funny if you stop and think about it.

    The OS that Windows forced everyone to use, boots up so ridiculously slowly that they finally feel compelled to do something about it. But the only thing they can think of to fix it, is to have it not actually shut down even though it tells you that it is.

    What could go wrong with that?

    • Sorry, Windows beats Linux every time on my system. But the real question is, why does anyone allow a Windows feature to stop a Linux boot? Bad system configuration. Totally defeats the point of a multiboot system.

      • I run arch with openbox on a hdd takes it 12 secs to boot. It has windows 10 on a ssd that I rarely ever use maybe 3 times a year to fix relatives computers if I cut off hibernation, which you have to do to have write ability on the drive in linux cause I have world of warcraft on the ssd to run faster, takes win 10 around 14 to 15 secs. Maybe the reason it takes your linux longer is you are using a bigger version on linux. Arch runs super fast on my computer win 10 is over 3 times slower. And even in world of warcraft in linux with lutris installer I get the same frame rates as win 10 gave me 60 to 103 in old areas on a 750 ti video card.