Change Grub timeout seconds

Grub menu
Grub menu

Changing Grub timeout seconds is not as many people said, by edit /etc/default/grub. At least with Fedora 20, I can proove it is not the right place to make the change. The corresponding file is /boot/grub2/grub.cfg. In the file look for

set timeout=5

5 seconds is the default timeout. Change it to any seconds you want it to be.

set timeout=0

0 seconds means no waiting at all.

set timeout=-1

-1 means wait infinite seconds until you make a choice.

(My updated knowledge on 06 Feb 2014) /boot/grub2/grub.cfg 是针对 BIOS systems 的,UEFI systems 要修改 /boot/efi/EFI/fedora/grub.cfg。修改 grub.cfg 文件后直接生效,但是不建议直接修改 grub.cfg 文件。grub.cfg 的文件头上就有一段这样的提示:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

因为系统在某些情况下会覆写 grub.cfg 文件。这样又回到之前很多人说的 /etc/default/grub 文件,在这里修改参数是对的,只是修改后不直接生效,还要运行一遍

grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

覆写 grub.cfg 才生效。

Leave a Reply

Your email address will not be published. Required fields are marked *