默认的14.04 / etc / default / grub文件内容是什么?


9

我像这个家伙一样也意外地重击了我的/etc/default/grub文件,尽管我是通过使用>而不是>>在配置脚本中完成此操作的。所提供的答案看起来与我在14.04桌面默认grub文件中所记得的不同...它包含什么?

教鱼...是否可以使用一些资源/方法自己找到答案,而不必重新安装14.04只是为了找出答案?


1
重新安装14.04太多了;重新安装grub会更容易;)
Rinzwind 2014年

1
如果您将来要进行任何修改/etc/default/grub,请先使用进行备份sudo cp /etc/default/grub /etc/default/grub-backup。这意味着,如果将来将其存储起来,则还原起来会更容易-大多数配置文件在其内部/etc和其他地方也一样。
2014年

Answers:


10

对于“ 教学捕鱼... ” 这一部分,仍有可能的答案:

...可以自己找到答案,而不必重新安装14.04只是为了找出答案?

/etc/default/grubhttp://packages.ubuntu.com/#search_contents上进行了搜索:

抱歉,您的搜索没有结果

除去第一个/etc,因此搜索第二个源包名称/default/grub。结果很成功:

/usr/share/grub/default/grub grub2-common

我的Ubuntu机器上仍然有此文件吗?

$ sudo ls /usr/share/grub/default/grub
/usr/share/grub/default/grub

或者,例如:

$ sudo [ -f /usr/share/grub/default/grub ] && echo Found || echo Not\ found
Found

事实上,它在那里。

它的内容是什么?

$ sudo cat /usr/share/grub/default/grub
# 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_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
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"

您可能已经发现,与Rinzwind的答案的输出相比,还有另一条明显的不同线:

#GRUB_HIDDEN_TIMEOUT=0

4

干得好:

# 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_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
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"
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.