Force Grub to open on reboot?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
darkrchaos
Level 1
Level 1
Posts: 26
Joined: Thu Mar 19, 2020 8:29 pm

Force Grub to open on reboot?

Post by darkrchaos »

I've just spent the last 4 hours trying to fix my computer. After updating my computer I lost my ability to connect to the internet wirelessly. I believe it was because of the new kernel, so I spent the day trying to open grub to switch to the old one with no success. I eventually got sick of trying and used to timeshift to fix the problem.

Thank god there is timeshift...

Anyway I would still like to know how to get into grub. I tried editing the file, but it still wouldn't open. Is there a way to force it open? Like a "restart and open grub" option?
User avatar
deck_luck
Level 6
Level 6
Posts: 1065
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Force Grub to open on reboot?

Post by deck_luck »

To help with the discussion and if you are command line capable, please post the output from the following command:

Code: Select all

grep -v '^#' /etc/default/grub
The initial grub process can be configured to prompt the user by waiting a predetermined number of seconds. Please provide your Linux Mint version as well.
Last edited by deck_luck on Fri Jul 24, 2020 12:57 pm, edited 1 time in total.
🐧Linux Mint 19 XFCE 💡Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

darkrchaos wrote:
Thu Jul 23, 2020 9:56 pm
Anyway I would still like to know how to get into grub. I tried editing the file, but it still wouldn't open. Is there a way to force it open? Like a "restart and open grub" option?
Not clear what file you tried editing. However, as deck_luck suggests, Grub's default behaviour (i.e., unless overridden by subsequent grub.cfg settings) is determined by the settings in the /etc/default/grub file. The default "GRUB_TIMEOUT=10" is generally adequate, but the "GRUB_TIMEOUT_STYLE=hidden" setting means that no Grub boot menu will appear unless the user hits a key (Esc) during those 10 seconds.

In some cases, results may also be affected by a bug in Ubuntu 20.04 (see here) causing Grub to ignore those defaults. In that case, the "workaround" most likely to succeed is to uncomment the "#GRUB_TERMINAL=console" line (i.e., change it to "GRUB_TERMINAL=console") in the /etc/default/grub file.

That bug should get fixed in the forthcoming Ubuntu point release due August 6th and in a LM 20.x point release that should also (one hopes) follow shortly thereafter.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
mr_raider
Level 7
Level 7
Posts: 1888
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: Force Grub to open on reboot?

Post by mr_raider »

There is usually a key to call grub during boot. Try hitting shift or ESC repeatedly.
Image
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

Exactly as I said above, but that won't overcome the problem if the Ubuntu 20.04 "bug" is involved.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
User avatar
darkrchaos
Level 1
Level 1
Posts: 26
Joined: Thu Mar 19, 2020 8:29 pm

Re: Force Grub to open on reboot?

Post by darkrchaos »

arvy wrote:
Thu Jul 23, 2020 11:01 pm
darkrchaos wrote:
Thu Jul 23, 2020 9:56 pm
Anyway I would still like to know how to get into grub. I tried editing the file, but it still wouldn't open. Is there a way to force it open? Like a "restart and open grub" option?
Not clear what file you tried editing. However, as deck_luck suggests, Grub's default behaviour (i.e., unless overridden by subsequent grub.cfg settings) is determined by the settings in the /etc/default/grub file. The default "GRUB_TIMEOUT=10" is generally adequate, but the "GRUB_TIMEOUT_STYLE=hidden" setting means that no Grub boot menu will appear unless the user hits a key (Esc) during those 10 seconds.

In some cases, results may also be affected by a bug in Ubuntu 20.04 (see here) causing Grub to ignore those defaults. In that case, the "workaround" most likely to succeed is to uncomment the "#GRUB_TERMINAL=console" line (i.e., change it to "GRUB_TERMINAL=console") in the /etc/default/grub file.

That bug should get fixed in the forthcoming Ubuntu point release due August 6th and in a LM 20.x point release that should also (one hopes) follow shortly thereafter.
That's what I was editing. I changed GRUB_TIMEOUT=0 to GRUB_TIMEOUT=10, but it still didn't work. I'm pretty sure it also had GRUB_TIMEOUT_STYLE=hidden. What would I change that to so it would open instead of being hidden.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

Change it to "GRUB_TIMEOUT_STYLE=menu" and run sudo update-grub. If that doesn't work, try uncommenting the "#GRUB_TERMINAL=console" line.
Last edited by arvy on Fri Jul 24, 2020 12:20 am, edited 1 time in total.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
User avatar
darkrchaos
Level 1
Level 1
Posts: 26
Joined: Thu Mar 19, 2020 8:29 pm

Re: Force Grub to open on reboot?

Post by darkrchaos »

I heard a few places say to update grub2. So just to be clear I update grub not grub2?
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

The command is exactly as posted with a hyphen. Copy/paste as follows:

Code: Select all

sudo update-grub
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
User avatar
deck_luck
Level 6
Level 6
Posts: 1065
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Force Grub to open on reboot?

Post by deck_luck »

darkrchaos wrote:
Fri Jul 24, 2020 12:18 am
I heard a few places say to update grub2. So just to be clear I update grub not grub2?
The update-grub2 is a symbolic link to update-grub. Either one works. :wink: (Now, if I could just eliminate my typos.)

Code: Select all

$ ls -l /usr/sbin/update-grub{,2}
-rwxr-xr-x 1 root root 64 Mar 11 15:57 /usr/sbin/update-grub
lrwxrwxrwx 1 root root 11 Mar 11 15:57 /usr/sbin/update-grub2 -> update-grub
$
🐧Linux Mint 19 XFCE 💡Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.
User avatar
darkrchaos
Level 1
Level 1
Posts: 26
Joined: Thu Mar 19, 2020 8:29 pm

Re: Force Grub to open on reboot?

Post by darkrchaos »

Thank you GRUB_TIMEOUT_STYLE=menu worked. Now if I ever need to change kernels, I have a easy way of accessing that.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

Good. Actually, I'm surprised that the default "GRUB_TIMEOUT_STYLE=hidden" setting hasn't caught more people unaware. It used to be handled by an override in /etc/grub.d/40_custom that they removed from LM 20 for some strange and unknown (to me) reason. I put it back for myself and you can do likewise if you want to ensure that a Grub boot menu will always be visible on start-up. Just add back the following into your /etc/grub.s/40_custom file:

Code: Select all

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
ajgreeny
Level 5
Level 5
Posts: 843
Joined: Mon Nov 19, 2007 3:27 pm

Re: Force Grub to open on reboot?

Post by ajgreeny »

I am very happy to hear that this is now solved for you, but simply as an addendum to this thread I show below the important content from my /etc/default/grub file that I have used ever since I started using UEFI, several years ago, when bringing up the grub menu by tapping Esc never seemed to work as it should.
This gives me a grub menu for 2 seconds only, giving me time, as long as I'm at the computer, to choose another kernel if I ever need to. It has saved a lot of trouble once or twice since when a new kernel has caused boot problems so I keep this configuration in every machine I have.

Code: Select all

GRUB_DEFAULT=0
#Next line will make the countdown time show the menu
GRUB_TIMEOUT_STYLE=menu
#Next line changed from 0 to 2 for 2 second delay
#GRUB_HIDDEN_TIMEOUT=2
GRUB_TIMEOUT=2
#Next line changed from true to false to allow delay countdown to show
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_DISTRIBUTOR="Xubuntu-20.04"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

More precise and authoritative explanations are provided in the Grub manual here for each Grub /etc/default/grub setting which, in turn, control the operation of grub-mkconfig. As also explained there, customization can be done by editing /etc/grub.d/40_custom or by creating /boot/grub/custom.cfg. In extreme cases (seldom necessary) automatic running of grub-mkconfig itself can be disabled and grub.cfg is then edited directly instead.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
Seff
Level 4
Level 4
Posts: 223
Joined: Mon Aug 31, 2015 5:40 pm

Re: Force Grub to open on reboot?

Post by Seff »

What if you can't boot from your hard drive? "Sorry, but that drive isn't in /etc/fstab."
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Force Grub to open on reboot?

Post by arvy »

Different problem. Start your own thread if you want help with that.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
Post Reply

Return to “Installation & Boot”