Linux как открыть grub

How to get to the GRUB menu at boot-time?

My system is not dual-boot, I run a standard Ubuntu desktop system «on the metal» (I think running it in a VM is the same). Pressing c while booting does not cause the GRUB menu to appear (which I believe it does for a dual-boot system). How can I get the GRUB-menu to present itself on a single-boot system?

+1 excellent question to expose an essentially undocumented feature of Ubuntu boot process, the answer to which I only found by accident while groveling through grub.cfg. Thanks for hoisting this up to the top (Googleable) level.

Credit where credit is due. This issue came up in another question of mine (buried deep in the comments). Jorge Castro suggested that it would be a good idea to present as a question it its own right. (so credit to him. and I’m happy to bask in the reflected glow 😉 I can see the value of it being a primary Q/A.

10 Answers 10

Menu will appear if you press and hold Shift during loading Grub, if you boot using BIOS. When your system boots using UEFI, press Esc .

For permanent change you’ll need to edit your /etc/default/grub file:

Place a # symbol at the start of line GRUB_HIDDEN_TIMEOUT=0 to comment it out. If that line doesn’t exist, then you can comment out this line instead: # GRUB_TIMEOUT_STYLE=hidden , and then change GRUB_TIMEOUT=0 to GRUB_TIMEOUT=5 , for instance, to give the grub menu a 5 second timeout before it automatically logs you in.

Save changes and run sudo update-grub to apply changes.

@codeMonk: Oops! (I’ve deleted my previous comment because I was on the wrong track). I originally misunderstood the context of «GRUB_TIMEOUT=0». The context you mean is in relation to the «permanent» display of GRUB-menu. I thought you meant in relation to the «Shift» key method. It is true that for a permanently recurring display, you need both «#GRUB_HIDDEN_TIMEOUT=0» and «GRUB_TIMEOUT=*NON-ZERO*», as described in the link in the answer . (I’ve just test it both ways.)

Читайте также:  Смена домашней директории пользователя linux

In Ubuntu 18.04 there is no GRUB_HIDDEN_TIMEOUT=0 line in my /etc/default/grub — instead there is GRUB_TIMEOUT_STYLE=hidden (Shift during boot never worked for me (Dell?)). Any idea what to do?

@jena I found the advice at the top of /etc/default/grub helpful: i.e., to have a look at info -f grub -n ‘Simple configuration’ . This explains the options. Use GRUB_TIMEOUT_STYLE=menu to have the menu shown. Or press ESC if you keep the setting at hidden but want to see the menu.

Grub changes with each release, please consider adding version informatoin. The fact for example that this works only for 14.04. It sure is not relevant anymore for 18.04

I have tried both the Shift and Space keys but nothing works. Only the Esc key works for Ubuntu 14.04 and 16.04 to get Grub Menu at boot time.

The same for Ubuntu 16.04 — only Escape works. This should be mentioned in documentation (Recovery Mode)

I had to repeatedly press the ESC key, not hold it down. Let’s have 6 ways to do the same thing. Linux is fun.

@jena Agree. I have several Ubuntu, but only one installed on Intel NUC wants Esc key for GRUB menu. This is problematic because if I press Esc too many times, it goes directly to GRUB CLI.

In Ubuntu 18.04, there is no GRUB_HIDDEN_TIMEOUT=0 line in /etc/default/grub — instead there is GRUB_TIMEOUT_STYLE=hidden . According to info -f grub -n ‘Simple configuration’ :

if this option is unset or set to ‘menu’, then GRUB will display the menu and then wait for the timeout set by ‘GRUB_TIMEOUT’ to expire before booting the default entry. Pressing a key interrupts the timeout.

So if you either remove or comment out the line as:

Читайте также:  Основные команды терминала linux ubuntu

and run sudo update-grub , then the menu will show by default.

18.04 + Not dual boot, boots in grub 5 seconds:

GRUB_TIMEOUT_STYLE=false

GRUB_TIMEOUT= (no value). Works fine LVM.

  • Keep hitting Shift until you see «Grub Loading Message»
  • After the message, hold the Shift down until the menu appears.

That so does not work for me. No matter what I do to this poor SHIFT key, this Intel NUC skips the grub menu 🙁

@yPhil Intel NUC is the freak who eats Shift . It works everywhere else. I’m lucky that Esc works for my NUC, but it didn’t seem to work for you, did it?

By default, GRUB will show the menu if there is a second operating system installed. If only Ubuntu is installed, then GRUB will generally load Ubuntu without showing the menu. To reconfigure GRUB to always show a menu:

  1. Edit /etc/default/grub : Set GRUB_HIDDEN_TIMEOUT= (no value after the = sign).
    Set GRUB_TIMEOUT=n to show the menu for n seconds.
  2. Run update-grub to regenerate /boot/grub/grub.cfg based on the /etc/default/grub settings.

You can get GRUB to show the menu even if the default GRUB_HIDDEN_TIMEOUT=0 setting is in effect:

  • If your computer uses BIOS for booting, then hold down the Shift key while GRUB is loading to get the boot menu.
  • If your computer uses UEFI for booting, press Esc several times while GRUB is loading to get the boot menu.

Hopefully this clears up confusion as to why Shift works for some users and Esc works for others.

Edit /etc/default/grub ( sudo -H gedit /etc/default/grub ).

then save the file and quit the editor. Next run:

Читайте также:  Linux manjaro установка node js

GRUB_TIMEOUT_STYLE

If this option is unset or set to menu , then GRUB will display the menu and then wait for the timeout set by GRUB_TIMEOUT to expire before booting the default entry. Pressing a key interrupts the timeout.

If this option is set to countdown or hidden , then, before displaying the menu, GRUB will wait for the timeout set by GRUB_TIMEOUT to expire. If ESC is pressed during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the countdown case, it will show a one-line indication of the remaining time.

Источник

Оцените статью
Adblock
detector