HOWTO_Change Default Boot Order for Grub in Ubuntu

萧英睿
2023-12-01

Ubuntus 9.10, 10.04, 10.10, 11.04 etc. use Grub2 so if your are using any of these versions of Linux then this trick should work for you. This post discusses the standard command line approach as well as GUI approach, discussed at the end of this post.

With Grub 2 you can no longer edit grub.conf or menu.lst files located in /boot/grub folder. The file to be edited is now “grub” located in/etc/default/folder, you can edit it by running the following command from terminal (sudo gedit /etc/default/grub). The contents would look like this:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

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 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_LINUX_RECOVERY="true"

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

To change the default boot option, you just need to change theGRUB_DEFAULTparameter.

0 is the first entry, so if you want windows to be your default boot option which is, say at, 5th position in the grub menu(when you boot your computer, you can see the win is the 5th), then you just need to change the GRUB_DEFAULT value to 4 and save the file and close it.

If you want to change the Auto Boot preset time then you would need to change the value of GRUB_TIMEOUT parameter, it should be assigned a value in seconds and would determine the delay in seconds before grub boots the default choice, automatically.

Now from the terminal run following command and your grub default boot order would be changed when you boot the next time:

sudo update-grub

GUI Approach

Just install the startup manager by using synaptic or running the following command:

sudo apt-get install startupmanager

Now launch System > Administration > StartUp-Manager and you can change the boot order using graphical interface.


 类似资料:

相关阅读

相关文章

相关问答