Score:0

Grub bootloader

cn flag

I have just switched to Linux and made a clean install of Ubuntu 20.04 over Windows 10 (no dual boot). I want to skip the grub bootloader screen which appears at the startup. I have already gone through several posts which are written on this, but I still have the same issue. I have changed the grub config file and after changing it I saved the changes through a command as instructed.

Here is the config file.

# 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="Ubuntu"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="0"
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"

#GRUB_HIDDEN_TIMEOUT="0"
GRUB_DISABLE_OS_PROBER="true"
GRUB_SAVEDEFAULT="false"

export GRUB_COLOR_NORMAL="light-gray/magenta"
export GRUB_COLOR_HIGHLIGHT="black/black"

enter image description here

Artur Meinild avatar
vn flag
You didn't actually mention what the problem is - so please clarify: What is the problem you experience? What happens now when you boot that is undesired?
Artur Meinild avatar
vn flag
Also, was the initial config file not working? By default, Grub is hidden and boots directly to Ubuntu.
Saurabh Nirwan avatar
cn flag
Actually i wanna skip the grub bootloader screen where it ask for choosing the operating system i wanna boot into. As for the initial config file also, i had the same issue. There is a screen asking for choosing the os. I wanna skip that screen and want to boot directly into ubuntu
Artur Meinild avatar
vn flag
Can you please insert what the Grub menu looks like when you boot? Please insert a screenshot or photo, as this will help.
Organic Marble avatar
us flag
The grub menu will be displayed in some cases if there was a problem with one of the disks at shutdown, even if you set it to be hidden.
Saurabh Nirwan avatar
cn flag
@ArturMeinild i have just uploaded a screenshot of boot screen
oldfred avatar
cn flag
If you want to use a description as GRUB-DEFAULT= , it must match exactly to the default description. I might just change back to 0 to avoid description issues. Your last line does not have # to convert to comment? Do you then get an error message on `sudo grub-update` where is does not write grub.cfg but grub.cfg.new?
Artur Meinild avatar
vn flag
Also, as a workaround, you might change to `GRUB_TIMEOUT=3`. In this case, the menu will be there for only 3 seconds if you don't press anything, even if it still appears.
Saurabh Nirwan avatar
cn flag
@oldfred no i haven't got any error while updating grub config file
Saurabh Nirwan avatar
cn flag
@Artur still the same screen at the start with a timer of 30 seconds as shown in the screenshot
Score:1
es flag

Summarizing what others wrote here:

You are about to shoot yourself in the foot. You need that menu in case something goes wrong; sooner or later that will happen. Don't attempt to get rid of the Grub menu completely; give yourself a chance to fix things in the worst case. It's okay to minimize the timeout to 2 seconds, but don't try to remove the menu completely.

Considering how long everything else takes at boot time (memory and hardware self-test etc., loading the kernel, initializing the system with all the various system services), those 2 seconds won't kill you; but not having the ability to fix your system by booting a previous kernel will.

Take this advice from someone who has been working with Linux since the late 1990s.


Also, from your comments it sounds as if you might not be aware that you need to run sudo update-grub after you edited that config file: Only then will the changes be propagated from /etc/default/grub which you edited to /boot/grub/grub.cfg which is generated from your configuration in /etc/default/grub plus kernels and other operating systems that are found (at that time) on your disks.

If your changes never seem to take effect, check where Grub is actually installed to; if you use the legacy MBR partitioning scheme, make sure you install it to the MBR of the disk you are booting from. If there is a previous install of Grub and your current one was installed to another boot sector, it might still boot your system, but any changes you make to your current Grub will only affect a Grub that is never used.

If you do that, please check the documentation exactly how to do it; it might be a dangerous operation.

Saurabh Nirwan avatar
cn flag
Thanks for the answer. But the issue is i cant even reduce it time to 3 second. It had no effect to the boot screen. (Same as shown in screenshot). And yes i am aware of sudo update-grub. I ran that command each time after changing the config file.
HuHa avatar
es flag
Then check if your changes actually arrived in `/boot/grub/menu.cfg`, and also if there is any similar entry _after_ yours.
Saurabh Nirwan avatar
cn flag
Yes sir, just after my first installation I accidentally deleted the grub bootloader (as I was playing around my mistake) and after that, I took my life USB drive and installed ubuntu on the same disk again. If it's because of that then how can I fix it?
Saurabh Nirwan avatar
cn flag
I "Erase everything" and used "LVM" as suggested by a friend during both installations. And there is no such file as `/boot/grub/menu.cfg`
HuHa avatar
es flag
Sorry, that was `/boot/grub/grub.cfg`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.