What happened

A few days ago, I started this machine. The Linux Mint login screen opened as usual. I typed my password, it was accepted. But instead of loading Linux Mint, I was black shortly before it went back to the login screen. I tried several times. It was not wrong password. I could not come further than the logon screen.

Equipment

  • Lenovo ThinkPad T460p
  • Intel HD Graphics 530 and Nvidia GM108M (GeForce 940MX) graphics
  • Linux Mint 20.3 MATE
  • Nvidia proprietary driver installed
  • Home directory encrypted
  • Grub menu hidden - now shown at start up

My work to solve the issue

First, I want to mention that I currently use this machine for testing how I like the MATE version of Linux Mint. It means I do not have any data to loose.

I started by reading Linux Mint forum and other sources. I am far from the first one having this eternal loop. I learned it can happen of several reasons: Memory full (hard drive/SSD), wrong Nvidia-driver, that it often goes wrong at updates etc. I recall I shifted from Xorg driver to Nvidia proprietary driver not so long time ago.

If I could reach the Grub menu at start, I could start via the Advanced options and possible solve it from that way. Because I only have one operating system installed, the Grub menu is hidden by default. I read Grub can be started by hold down Shift at start up. I could not get that work. There was also another suggestion with CTRL + ALT + Delete that also did not work for me.

I also read about login via a termial screen: at the normal login screen, press CTRL + ALT + F1. Or, as it is needed on my machine, press CTRL + ALT + Fn + F1, at the same time. And this works, I come to a terminal screen with login.

After a few trials, I recall my username in not the same as display name. Eg on the Mint login screen, I see user "Henrik Hemrin", while I had "henrik" as my user name on this machine. With the correct user name, I can login. I try commands such as ls and cd, I can list directories and files. Note - I only have this terminal window, it will not start the desktop. Maybe there is a possibility to start and launch the ordinary desktop with a command that I am not aware of.

I decide to update and upgrade all software, hoping this will solve it.

So in this login-terminal window I type the commands "sudo apt update && sudo apt upgrade", and after entering my password are many updates and upgrades executed. After this, I turn off the computer with the "poweroff" command.

Then I try a normal login, only to find out the problem is not solved; the login screen is still in the loop.

I have a USB-stick with Linux Mint 20.3 MATE iso on it and start the live session. It's good to always have a Live-usb at hand. This means, instead of running the operating system I have installed, I ran the operating system I have on the USB-stick.

I start the GParted software to check if the EFI System Partition is full, but it has a lot of space. And no overflow in any other partition.

I do really suspect the NVidia graphics.

From the Live-USB I run the Boot-repair tool. I try again to do a normal login, but the login loop is not solved.

I read more, test some more things. But I am more and more convinced I want to launch the Grub menu. If I edit the Grub file, I can get it to launch. But how to edit the Grub file - how can I access it under these circumstances?

The "terminal login" to laptop via CTRL + ALT + Fn + F1, cannot really start any tool, it seems. I install Gedit, I can install it, but I cannot start it. Gedit is a text editor. Maybe there is a way to get a text editor working here, but I did not find out.

Instead I start the Live-USB again. I mount the ordinary SSD in the file manager. In the file manager I go to the file /etc/default/grub. After login as superuser in the file manager, I edit the file grub in text editor:
I write "# " at the beginning of the row for the command GRUB_TIMEOUT_STYLE=hidden and Save. This means that the command on this row is neglected.

In the terminal I execute the command "sudo update-grub".

I restart the machine, and finally, the Grub menu is displayed before login!

One remark: Instead of editing the file as above, I could probably have done it with the tool Grub customizer. I did not have it installed on my Live-USB, but it should have been possible to install.

In the advanced Grub menu, I have three Linux kernels to choose between:

  • 5.4.0-124
  • 5.4.0-121
  • 5.4.0-91

I start with them, one by one, in normal mode. 124 is the normal kernel that gave the loop issue. 121 gives same loop issue. But with 91, my login works and the desktop starts as normal!

In Linux installation guide and other soruces, I read about how to solve issues with NVidia at login. For the Grub file, there are suggestions to change GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="nomodeset". I do the change, execute in terminal window the "sudo update-grub" and try again to login with the latest kernel 5.4.0-124, but it does not help.

I also try "Try nouveau.noaccel=1 instead of nomodeset.
After the installation, use Advanced Options ‣ Recovery mode from the boot menu and choose resume." But it does not solve the problem.

I later find also a third one suggestion how to edit the Grub file, suggested in the Linux 21 release notes, still to be tested.

But for now, I change back to normal Grub commands. Instead I login with the older Linux kernel 5.4.0-91 and open the Driver manager. I test to change from Nvidia-driver 515.65-01 to Nvidia-driver 510.85.02.

With this change, I can start the machine with the latest kernel! It clearly indicates my trouble is related to the Nvidia-driver in combination with the Linux-kernel.

However, a quick look with the Intel graphics tool, maybe this different Nvidia driver is not working properly. I do not dig into this further. Instead I switch to the open driver xserver-xorg-video-nouveau version 1:1.0.16-1 for Nvidia graphics card.

I will probably not trouble shoot this any further. I have found out ways to solve this issue, if it occurs again. The reason I will not investigate further is that I will soon make a fresh install of Linux Mint 21 Cinnamon. Linux Mint 21 uses the Linux kernel 5.15-series as default instead of the 5.4-series that Linux Mint 20.3 uses. So, I will save my efforts to get the new installation up and running instead. But first, one more thing about encryption.

Encryption

In the current installation I have the home-folder encrypted. The home-folder encryption has a known issue that it will not encrypt again. Linux Mint writes: The move to systemd caused a regression in ecrypts which is responsible for mounting/unmounting encrypted home directories when you login and logout. Because of this issue, please be aware that in Mint 20 and newer releases, your encrypted home directory is no longer unmounted on logout: https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1734541.

My preliminary plan is to use full disc encryption when I install Linux Mint 21 Cinnamon.

But how does it work to decrypt from a Live-USB? I have a Linux Mint 20.3 Xfce installed with full disc encryption. I start that machine with the same Live-USB as before. The disc is password protected. I can login to the disc, and open files. So, it seems as it is possible to open an encrypted disc via Live-USB. Good to know.

Wrap-up

Always keep fresh back-up of data you do not want to loose.

Keep a Live-USB at hand so you can come into the computer that way.

It can also be useful to be able to connect any device to internet. To keep a wifi-password available one way or another can be helpful. I often keep a relatively simple password I can remember for my guest network that I use at these occasions.

Keep the Grub-menu active at start-up, or learn how to open it via eg some key combination. The Grub-meny can be set to only a few seconds. So Grub will only delay start-up a little.

 

Henrik Hemrin

24 August 2022