How to hide grub menu (without installing grub-quiet)

Without installing 'grub-quiet', we can make grub menu hidden.

At /etc/default/grub, add this line and 'update-grub'

GRUB_TIMEOUT_STYLE=hidden

Notes:

  1. GRUB_TIMEOUT=15
    Do not set this to less than 3 (never 0) as I think we are not fast enough to press 'esc' key if we want to see the menu that we make hidden.

  2. GRUB_CMDLINE_LINUX_DEFAULT="quiet"
    This is good enough without needing other things like "vt.global_cursor_default=0" or rd.xxxx'
    resume UUID for hibernation excepted.

  3. To make the hidden menu visible, press the 'esc' key not the 'shift' key.

  4. Note this welcome bar will appear for a very short while and then disappear.
    WELCOME TO GRUB
    This line does not appear in some other distro's like Ubuntu.

  5. These 2 lines are deprecated and not needed nor do they do anything.
    #GRUB_HIDDEN_TIMEOUT
    #GRUB_HIDDEN_TIMEOUT_QUIET=true

  6. Variations of GRUB_TIMEOUT_STYLE= are
    GRUB_TIMEOUT_STYLE=menu
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_TIMEOUT_STYLE=countdown
    [A] when GRUB_TIMEOUT_STYLE=menu
    This is be the default behaviour, the menu will appear and
    GRUB_TIMEOUT=15 will then determine how long this menu will appear before the default entry boots or how long the user can select another entry.
    [B] when GRUB_TIMEOUT_STYLE=hidden or
    [C] when GRUB_TIMEOUT_STYLE=countdown
    GRUB_TIMEOUT=15 will determine the wait time for the default entry to boot.
    Pressing the 'Esc' key during that time, it will display the menu and wait for user input.
    'countdown' will display a very small time indicator of the remaining time left.

  7. Remember, this applies to grub package and not to the 'grub-quiet' package.
    To change from 'grub-quiet' package to grub package.
    sudo pacman -S grub
    Say 'y' to remove grub-quiet.
    Review and correct your /etc/default/grub and
    sudo update-grub

Cheers, everyone.

13 Likes

You have to install grub-quiet to have this hidden. See the following patch.

Thanks. But I personally do not hide my menu (for a long time now) and after all, I use my own grub (and grub menu). This topic is for people who wants to hide their menu and using grub (not grub-quiet).

Hopefully, we can see an agreement with all distros and upstream on a unified grub process.
Cheers.

To make it quiet we have to set at least the following in /etc/default/grub:

GRUB_TIMEOUT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_CMDLINE_LINUX_DEFAULT=“quiet”

Also you have to install grub-quiet. You can either hold SHIFT or press F8 to display the menu. More about configuration you can find here. Also take a look at the history of grub-quiet development.


How to get a quiet-boot-up in Manjaro

  • install linux418 or linux419
  • install grub-quiet
  • reinstall grub to MBR (Attention: use the correct cmd for your system!)
    • EFI: sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
    • BIOS: sudo grub-install --recheck /dev/sd[X] (change [X] for your device letter. Check via lsblk -f)
  • reboot to see if all is still booting fine
  • check that you have GRUB_TIMEOUT=0 and at least quiet in /etc/default/grub under GRUB_CMDLINE_LINUX_DEFAULT or GRUB_CMDLINE_LINUX. Add loglevel=3 vga=current rd.systemd.show_status=auto rd.udev.log-priority=3 vt.global_cursor_default=0 if you still see some messages.
  • sed -i -e 's|fsck||g' /etc/mkinitcpio.conf or add fsck.mode=skip to GRUB_CMDLINE_LINUX. More about it here.
  • sudo mkinitcpio -P
  • sudo update-grub
  • reboot your system

A question, philm.

How would one go about 'unhidding' a hidden grub menu?
Should there be a write up on this?

I noticed after downloading manjaro-xfce-18.0-rc1-stable-x86_64.iso that grub-quiet package is installed, but not grub package.
Would making some changes in /etc/default/grub alone like commenting out some lines and adding some lines like these below be sufficient without removing grub-quiet package and installing grub package?

#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT_STYLE=countdown
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5

Thanks.

If you set any timeout here, you will have to wait the seconds until it boots. Adding the hidden style only hides the menu until it will be displayed. You can still press F8 or hold SHIFT when having grub-quiet installed.

This is cause grub displays those strings as they are hard-coded. Either you patch them out like fedora does our use our patch.

No, you have to install grub-quiet to have this effect. grub has the hard-coded lines like Welcome to GRUB! and any string displayed will hide the manufactor logo when linux418+ is used and display the message or error. grub-quiet is a further patched grub as the normal grub package is. Plan will be to add the additional patches from grub-quiet to the grub package and remove grub-quiet from the repos. Simple as grub-quiet will become the grub package at some point.

To understand why we have to do this you may study the PKGBUILDs and patches:

So, how does one go about unhidding a grub menu?
(without pressing 'shift' or 'esc' in a hidden menu)

So from your last post, it means we will need to uninstall grub-quiet and install grub.
Can you confirm that is the only way?

If you have grub installed you can press ESC. With grub-quiet you can either press ESC, F8 or hold SHIFT. Either way, you can only install one package, either grub, which displays still some strings, or grub-quiet, which has new features as explained here and here.

With grub-quiet you can run Run sudo grub-editenv - set menu_show_once=1 , reboot, the menu should now show with a 60 second countdown.

Okay, got it.

From the link..

3. How to disable hidden GRUB menu

To permanently disable the auto-hide feature run:

sudo grub-editenv - unset menu_auto_hide

That is it.

Thanks. Cheers.

Yep, but this thread is about to hide the menu :wink:

But, but, but... :grin:
- unset means to not set
and the title of point 3.

3. How to disable hidden GRUB menu

means exactly that.

Never mind, philm, it's new at this stage we shall try out and see if your interpretation or mine is accurate.
I'll try to install the iso and we'll see. But I'm running out of partitions. :sweat_smile:

Cheers.

Well, by default we set the menu to hide. So if you want to see it, you have to unset it :wink:

Correct. And that's what I'm on about.

So I want to see the menu, not hide it. All the time.
Upon start, without pressing 'shift' or 'esc'.

So I have to 'unset' it.
which is
sudo grub-editenv - unset menu_auto_hide

Again, I'll try to install it. And I'll let you know.

Cheers. Thanks for the explanations.

@philm
Okay installed xfce 18.0-rc1-stable-x86_64 on a 16 GB usb stick on bios-legacy/msdos.

It (hidden menu) works with GRUB_TIMEOUT=0 as you said above it must have.
At GRUB_TIMEOUT=15, it did not.

The trouble is, with the 'normal' grub (not grub-quiet), having GRUB_TIMEOUT=0 will also not have the grub menu appearing as, well, the timeout is zero.

Then applying " sudo grub-editenv - unset menu_auto_hide" with GRUB_TIMEOUT=15, the grub menu also appears.
Changing to GRUB_TIMEOUT=0, grub menu does not appear.

It is difficult to draw any conclusion that grub-quiet is the cause of the hidden grub or that GRUB_TIMEOUT=0 is the actual cause.

Again hope that all distros and upstream can agree on a unified process and more developments will go in this direction.

On an unrelated note, after installing this xfce 18.0-rc1-stable-x86_64, I couldn't boot into it without using the fallback initramfs. I think it is reported elsewhere as well. I have all other existing Manjaro's on 4.19 kernels and I do not have this problem with them. Of course, trying to boot with a hidden menu to fallback initramfs is a hassle :laughing: Luckily I have my other grub to boot into this OS and make it back to the menu with GRUB_TIMEOUT=15. I've checked that removing intel-ucode from the initrd line with normal initramfs gets into the initrmfs shell too. So it is not a microcode issue.

Cheers.

... hides the menu for now. I've to check with Fedora once more. Normally it should also hide when doing sudo grub-editenv - set menu_auto_hide=1.

1 Like

Thanks. Appreciate the response.

Seems this needs more testing. Normally this patch adds timout_style to hidden and the timeout to 1s. For fastboot it will get set to 0s. If the last boot was not OK it will unhide the menu by setting it to menu. And since I never added the needed systemd services it doesn't work as documented here. So all in all it is still half done :wink:

1 Like

OK, let's break down the magic.

How to hide the grub menu

At least the following needs to be set:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=1

For fastboot you can set even GRUB_TIMEOUT to zero.

How to make grub totally silent

Well you need grub-quiet installed, or at least this patch applied. It removes any strings like Welcome to GRUB! Add loglevel=3 vga=current rd.systemd.show_status=auto rd.udev.log-priority=3 vt.global_cursor_default=0 to GRUB_CMDLINE_LINUX in /etc/default/grub if you still see some messages.

What are the advantages of grub-quiet package?

Since we want to see the menu when the bootup failed or need other ways to see the menu we have added additional scripts.

/etc/grub.d/01_menu_auto_hide

It shows if the last boot-up was OK. If so we will set the following:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=1

This gives you one second to press a button for showing the menu. If fastboot is enabled this will be set:

GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=0

It will avoid the countdown code keypress check.

You can set this also via:

  • sudo grub-editenv - unset menu_auto_hide to disable autohiding of the menu
  • sudo grub-editenv - set menu_auto_hide=1 to enable autohide of the menu
  • sudo grub-editenv - set menu_auto_hide=2 to enable autohide of the menu even when you have another OS installed
  • sudo grub-set-bootflag menu_show_once to show the menu for 60s once
  • sudo grub-set-bootflag boot_success to mark the current bootup as successful

/usr/lib/systemd/user/grub-boot-success.service

This service triggered by the timerscript will mark the bootup as successful after running for two minutes.


Please test grub-quiet 2.03.0-18 release and report any issues with it. See also the history of the development.


Seems I still miss the last piece to trigger grub-set-bootflag boot_success after we have the DE loaded ... This needs to be executed to mark a succesful boot. Then the menu will be hidden on next boot.

3 Likes

After some more testing of grub-quiet, this time in existing OS's, and further tests on grub, I've edited the first post. Nothing major to report but more fine tuning and more clarifications.

But I want to reiterate that setting GRUB_TIMEOUT=0 is not advised for either grub or grub-quiet.
There is no way to select another entry or make modifications if we need to change kernel parameters.

Cheers.

ps: Disclosure - I personally do not use hidden menu. In fact I do not use any OS generated bootloader and I disable os-prober in all of them. But I can test and review them.

1 Like

Forum kindly sponsored by