17

So, I had a dual boot and just nuked the windows partitions, and then got rid of the boot files for windows and updated the grub, and now my PC boots directly into ubuntu. However, I'd like to still have the grub option so I can switch between kernels, and I want to make it permanent.

I've read about the matter and what I found was advice to comment the following line out of the grub file:

GRUB_HIDDEN_TIMEOUT=0

However, there is no such line in the file, which sole content is:

# 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=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# 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 `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

What does this mean? Should I instead comment out the GRUB_TIMEOUT_STYLE=hidden line, or what?

1
  • 2
    It is a valid command. If it's not there for you to uncomment, you can simply put it in and run update-grub.
    – Jos
    Commented Oct 15, 2018 at 11:47

2 Answers 2

33

Edit the file /etc/default/grub, and find this line:

 GRUB_TIMEOUT_STYLE=hidden

Change that line to:

GRUB_TIMEOUT_STYLE=menu

and most importantly, after making that change, save the file and run:

 sudo update-grub

sometimes if grub is not installed properly you may need

if boot is legacy

sudo grub-install /dev/sdx

or

sudo grub-install --force /dev/sdx

sdx being the boot drive sda,sdb or sdc If boot is EFI you need to specify where your EFI System partition is mounted:

 sudo grub-install --efi-directory=<address of efi-directory (eg. /mnt/efi)>
3
  • I switched the style to countdown and updated the grub, and now when I booted not only did the grub still not appear, as it showed the message Error: unknown command "hwmatch", followed by a 10 sec countdown. Should I reinstall, considering that it used to work before I removed the dual boot? I have UEFI, and I already did grub-install /dev/sda in another context, before making this post. Should I do it again?
    – aaaaa
    Commented Oct 15, 2018 at 13:37
  • 1
    Search on grub timeout gnu.org/software/grub/manual/grub/grub.html and ‘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.
    – oldfred
    Commented Oct 15, 2018 at 14:03
  • Ah, so the countdown mode allows me to access the menu by pressing ESC during the countdown, and the menu one works straight out of the box! Tried both, and both work. Sticking with the second one. Thanks a lot for that useful link. I now consider my problem solved.
    – aaaaa
    Commented Oct 15, 2018 at 14:19
0

Yeah, While it wasn't major before I updated to 24.04, it is now but learn quickly that, and this is with the nvidia470 version of drivers, yes my card is that old like 2013-15 thereabouts where it was first released. at least it's gddr5 though. But yea black screen and just stays there, so had to do the sysreq key combo, if no change to grub especially I prefer splash over quiet splash and even with the drivers from Nvidia, I still need to add nomodeset as well. Once you install 24.04 and if you do experience the black, my suggestion is to hold down the shift key even before the bios/UEFI screen shows up and get to pre-boot grub and add nomodeset at least, and I need some visual indicator of something going right or wrong with just splash, at least then you'll see if any errors or hangs, it'll be more obvious, and edit once you're fully booted, grub from here /etc/default/grub with menu, and unhiding it and all. I have no idea if it's at all similar to AMD cards. Still, yea just be prepared to have to hit and hold the Alt+ctrl+Print screen, hold down those 3 then press slowly like 2-3 seconds apart of these in this order with left-hand, r e i s u b .. Canonical needs to allow a better way of all this, for being sure this won't confuse people. Hilarious too how my Brother and I consider him than me, far more an expert in OS-related stuff, but he didn't know about it either until I learned of it at the kernel documentation website and shared it with him. Sure you could with sysreq, just hit the b key, but that could damage HDD or SSD as the other keys help to slowly unmount and just prepare it for another reboot.

Just to help give an idea, this is how my grub settings look, and this might change when an OS upgrade happens IE 24.04-or.1, and so on. So yes, in case just be prepared to have to re-edit. "" GRUB_DEFAULT=1 GRUB_TIMEOUT_STYLE=menu GRUB_TIMEOUT=25 GRUB_DISTRIBUTOR=( . /etc/os-release; echo ${NAME:-Ubuntu} ) 2>/dev/null || echo Ubuntu GRUB_CMDLINE_LINUX_DEFAULT="splash nomodeset" GRUB_CMDLINE_LINUX="" "" (the last "" do not include and don't forget before rebooting after this change too also do sudo update-grub .)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .