[說明]本帖是根据論壇里相應的帖子整理的。
你想默認進入的操作系統位於第幾項(第n個title)(從0開始計算)。就把0改成n。oneleaf 写了: sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
修改中间的 default 0
不明白的看下面的例子
假定menu.lst如下:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
## You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## ## End Default Options ##
# 下面是第0项
title Ubuntu, kernel 2.6.15-23-386
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda3 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot
# 下面是第1项
title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda3 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot
# 下面是第2项
title Ubuntu, memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
# 下面是第3项
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
# 下面是第4项
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
--------------------------------
title Microsoft Windows XP Professional是第4项(从0开始)
假如你想把win xp作為默認的操作系統,那就把default 0改為default 4
注意:
如果没有default 0 就在“## ## End Default Options ##”前自行添加。
以#开头的行是注释,被注释掉的行是给人看的,电脑不会去读的。所以注释掉的行里面的title是不算的。