4

I am on Ubuntu 20.04 LTS and I want to suppress all kernel messages of the form

[0.342652] Blah blah ...

during boot, while keeping the splash screen. The default grub setting quiet splash does not work. I added fsck.mode=skip and loglevel=0 to suppress some kernel messages for disk checking and old hardware. However, I still get an empty line like

[4.568562] 

before the splash screen shows up. I found this post that redirects everything to console=ttyS0 so the kernel messages are gone but so is the splash screen. Below is my grub setting in /etc/defaults/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_STYLE=menu GRUB_TIMEOUT=120 GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian

Don't show Ubuntu bootup text

GRUB_CMDLINE_LINUX_DEFAULT="fsck.mode=skip quiet loglevel=0 splash" GRUB_CMDLINE_LINUX=""

Detect other operating systems

GRUB_DISABLE_OS_PROBER=false

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `videoinfo'

GRUB_GFXMODE=1280x1024

I noticed that when I switch to my intel graphic card sudo prime-select intel then the empty line disappears and the current grub setting works fine. However, when I am using the nvidia graphic card sudo prime-select nvidia, the following appears before the splash screen

enter image description here

and here is the result of sudo dmesg around the time [4.568562] that appeared in the previous picture.

[    4.553719] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    4.568556] nvidia-nvlink: Nvlink Core is being initialized, major device number 511

[ 4.569341] nvidia 0000:01:00.0: enabling device (0006 -> 0007)

The empty line shown in the above log exists and is not a typo.

  • 1
    You don't have quiet splash in your grub file. You stuck a loglevel directive in between quiet and splash. Fix that so it actually says quiet splash and update grub. – Organic Marble Aug 30 '23 at 12:24
  • @OrganicMarble: That does not work either. I added that option to suppress some kernel messages. – Hosein Rahnama Aug 30 '23 at 14:01
  • 2
    @OrganicMarble sorry but that is a valid method ;-) your comment was correct up to some year and then quiet got the extra loglevel option (even has to be after quiet) – Rinzwind Sep 08 '23 at 18:30
  • 1
    @Rinzwind thanks! I learned something. – Organic Marble Sep 08 '23 at 19:07

2 Answers2

1
GRUB_CMDLINE_LINUX_DEFAULT="fsck.mode=skip quiet loglevel=3 splash"

works for me without a print of any character and it shows the splash screen without anything related to fcheck.

This seems to work as intended and as you are expecting it to work. The parameters ...

loglevel=2
loglevel=1
loglevel=0

instead of loglevel=3 make no difference.

The [4.568562] might not be from Grub but something else. Do a sudo dmesg |grep -i '4.568562' -A 2 -B 2 and it will show 2 lines above and below of the messages.

Tested on Ubuntu Cinnamon 23.04 and 23.10

Rinzwind
  • 299,756
  • Thanks for the last tip. By the way, did you mean the empty line [3.721]? right? – Hosein Rahnama Sep 08 '23 at 18:24
  • 1
    @HoseinRahnama yeah that was me copy/paste from my dmesg as I did not have a 0.342 ;-) add your grep command and result to the question and if possible I'll expand – Rinzwind Sep 08 '23 at 18:27
  • I added more details to the question. Surprisingly, the time corresponding to the empty line did not appear in sudo dmesg so the grep has nothing to return. However, I found the messages before and after that time manually. Hope that helps. :) – Hosein Rahnama Sep 08 '23 at 21:26
  • 1
    that looks like a bug in the nvidia driver where it does print the timestamp but not the text :P – Rinzwind Sep 08 '23 at 23:40
  • Yeah! I will check against different driver versions to see if it can be solved. Maybe checking against different kernel versions be useful too! :) – Hosein Rahnama Sep 09 '23 at 09:32
0

As suggested by @Rinzwind, I checked the kernel messages before and after the time corresponding to the empty line. Surprisingly, the time corresponding to the empty line did not appear in sudo dmesg. Moreover, when I did sudo dmesg --level=err, the empty line appeared without the corresponding time being displayed! I found the messages before and after that time manually. It turned out that this empty line error has something to do with the nvidia driver as messages before and after the empty line suggest. Consequently, I downgraded my driver from nvidia-driver-535 to nvidia-driver-390 and the empty line was gone while using the nvidia graphic card. My notebook graphic card is NVIDIA GTX 1050.