怎样更改grub的默认启动顺序

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
chiayu
帖子: 7
注册时间: 2006-05-23 17:03
来自: 中国 浙江
联系:

怎样更改grub的默认启动顺序

#1

帖子 chiayu » 2006-05-26 8:30

我现在装了Windows XP Home Edition和Ubuntu 5.10的双系统
现在默认的启动操作系统是Ubuntu,Ubuntu好象还有几个内核,
每次进入 Win XP Home真的好麻烦
可以更改我的GRUB的默认启动顺序吗?
我要首先启动windows xp,我经常要在windows xp下面办公,
一下是我的 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'.
default 7

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda9 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,8)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Ubuntu, kernel 2.6.12-10-386
root (hd0,8)
kernel /boot/vmlinuz-2.6.12-10-386 root=/dev/hda9 ro quiet splash
initrd /boot/initrd.img-2.6.12-10-386
savedefault
boot

title Ubuntu, kernel 2.6.12-10-386 (recovery mode)
root (hd0,8)
kernel /boot/vmlinuz-2.6.12-10-386 root=/dev/hda9 ro single
initrd /boot/initrd.img-2.6.12-10-386
boot

title Ubuntu, kernel 2.6.12-9-386
root (hd0,8)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda9 ro quiet splash
initrd /boot/initrd.img-2.6.12-9-386
savedefault
boot

title Ubuntu, kernel 2.6.12-9-386 (recovery mode)
root (hd0,8)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda9 ro single
initrd /boot/initrd.img-2.6.12-9-386
boot

title Ubuntu, memtest86+
root (hd0,8)
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.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

请教各位谁能给我改好了之后回帖啊,感激不尽,我曾经改过一次,但是有点不对,我
怕出问题啊,我已经重装过两次windows xp并且重装过一次ubuntu了,
头像
chinux
帖子: 282
注册时间: 2005-05-31 23:53
来自: 天府之国
联系:

#2

帖子 chinux » 2006-05-26 8:36

把winXP启动的那一段剪切到最前面试一下(好像可以)
寂寂寒月夜,孤坐伴清灯。曳曳烛光摇,淡淡数点星。
起身动瑶佩,移步出门去。默默倚危阑,遥听伊人语。
bendy
帖子: 10
注册时间: 2005-11-03 18:24

#3

帖子 bendy » 2006-05-26 8:38


title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

拷贝到
## ## End Default Options ##
下面
title Ubuntu, kernel 2.6.12-10-386
的前面就可以了◎◎

也就是说把关于windows的启动信息拷贝到ubuntu的前面,
启动时默认就是windows了
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#4

帖子 karron » 2006-05-26 8:39

搜索一下论坛,学会修改方法,否则以后你还是会来问的.

这个不用重装系统.

你数一下在grub启动的时候会出现多少个菜单,然后数量-1,把menu.lst中的default的数字改成刚才的数字.直接在menu.lst中数也可以.多尝试一下.
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
guibin001
帖子: 15
注册时间: 2007-03-05 13:48

#5

帖子 guibin001 » 2007-04-09 13:15

学习一下
freey
帖子: 231
注册时间: 2006-10-10 13:01

#6

帖子 freey » 2007-04-09 13:36

default 7
其中参数7指的是你要启动哪个内核,象如是0,表示的就是排着下来的第一个,其他依次类推。
修改的时候建议先备份哈。
努力不一定成功,但放弃注定要失败!
授人与鱼,不如授人与渔!
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#7

帖子 stlxv » 2007-04-09 14:39

代码: 全选

default 7 
PHP是最好的语言!不服来战!
lpmurder
帖子: 142
注册时间: 2007-02-06 18:57
来自: 中国茶都

#8

帖子 lpmurder » 2007-04-09 19:05

default 0
改为 X_sequence X代表想要启动顺序
头像
vbem
帖子: 239
注册时间: 2006-09-13 9:09

#9

帖子 vbem » 2007-04-09 20:55

千万记住title Other operating systems: 也算一行!!!
头像
woainba15
帖子: 833
注册时间: 2006-11-11 17:14
来自: 浙江宁波
联系:

#10

帖子 woainba15 » 2007-04-09 21:04

这个还蛮简单的呢!!
时间过得快啊!
回复