Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 1861  / 2 Years ago, tue, march 15, 2022, 4:55:13

What is the use of /usr/share/grub/default/grub vs. /etc/default/grub ?
Which one should I edit to make grub behave differently?
(If you are aware, what is the technical or historical reason for two distinct grub files?)


The contents of both files is the same...


# 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=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"

More From » boot

 Answers
3

The difference is that all of the files in the /usr/share directories are example configuration files. They are files that can be copied into the /etc directory, the place where all your configuration files reside that are used by the system. /etc/default/grub is the file you edit to make your changes with GRUB. Once you are done making your changes to the file, you run grub-update to have grub update and use your new settings.


GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

These are the only ones I have ever really edited. The DEFAULT tells the OS to boot by default; never usually edit this one. The TIMEOUT_STYLE here tells it to hide the GRUB menu; to have a menu put that there. TIMEOUT tells grub to wait that many seconds before booting the default entry. The CMDLINE_LINUX_DEFAULT entry tells it to boot without text scrolling (quiet) and with a splash screen (splash); remove those to have "" and you get to see the boot messages scrolling by when booting. Very handy to see where it is failing, and no reason to get all out of sorts if you do see the odd failure there if it does not affect the functioning of the system. The last, CMDLINE_LINUX, I have never really had to edit; it is where you add option(s) that need to be passed into the kernel at boot to enable functions in the kernel or to correct a quirk at boot.


[#1901] Wednesday, March 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lintical

Total Points: 344
Total Questions: 122
Total Answers: 106

Location: Sint Maarten
Member since Mon, Oct 12, 2020
4 Years ago
lintical questions
Thu, Jan 12, 23, 03:07, 1 Year ago
Mon, Jun 28, 21, 07:01, 3 Years ago
Sat, Aug 7, 21, 04:29, 3 Years ago
Mon, Dec 5, 22, 00:03, 1 Year ago
;