Ubuntu中文论坛 ? 查看主题 - [整理]有關設置grub默認進入的操作系統的問題

来源:百度文库 编辑:神马文学网 时间:2024/04/18 23:32:47
有關設置grub默認進入的操作系統的問題 发表于 : 2005-08-29 16:39 
注册: 2005-07-02 14:41
帖子: 3792 [整理]有關設置grub默認進入的操作系統的問題

[說明]本帖是根据論壇里相應的帖子整理的。

oneleaf 写道: sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
修改中间的 default 0


你想默認進入的操作系統位於第幾項(第n個title)(從0開始計算)。就把0改成n。


不明白的看下面的例子

假定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是不算的。

最后由 millenniumdark 编辑于 2008-05-25 14:38,总共编辑了 6 次

页首       2 楼   文章标题 : 发表于 : 2005-11-18 0:32 
注册: 2005-11-15 20:14
帖子: 101
地址: 湖北 武汉 代码: title      Other operating systems:

记得刚开始用Linux的时候,这一行害我不浅啊。记得当时看的是Grub的官方文档,结果我把这一行没有计算在内。
Ubuntu中文论坛 ? 查看主题 - [整理]有關設置grub默認進入的操作系統的問題 Ubuntu中文论坛 ? 查看主题 - windows转至Ubuntu的过程记录,希望对刚... Ubuntu中文论坛 ? 查看主题 - [分享]从头开始对ubuntu进行优化 Ubuntu中文论坛 ? 查看主题 - [原创]在Ubuntu中设置samba共享可读写文... Ubuntu中文论坛 ? 查看主题 - 使用org-mode来GTD(1)— 入门 Ubuntu中文论坛 ? 查看主题 - 重装WIN7后怎么引导UBUNTU10.04 Ubuntu中文论坛 ? 查看主题 - [原创]虚拟机VMware+Red Hat上搭建a... Ubuntu中文论坛 ? 查看主题 - virtualbox共享文件夹与主机通讯(共享数据... Ubuntu:修复grub SAS中文论坛 ? 查看主题 - SAS考证一点经验 OpenCV 中文论坛 ? 查看主题 - C#中使用OpenCV OpenCV 中文论坛 ? 查看主题 - C#中使用OpenCV Ubuntu透露新的视觉设计、主题和Logo Ubuntu 中软件的安装、卸载以及查看的方法总结 Ubuntu中文 论坛 :: 阅读主题 - [分享]解决vmware tools 在ubuntu 6.10 无法让鼠标平滑切换的问题 Grub for DOS 的下载和使用 Linux启动流程与Grub的配置 GRUB & LILO 操作備忘 中國的稀土問題 - 天下财富 -中文论坛 一些常用的“Excel操作”整理 ubuntu下的极点五笔 | ubuntu五笔 陶渊明《闲情赋》的主题 - 文赋 - 中国古代文学 - 北大中文论坛 www.pkucn.... Skype中文论坛 :: 阅读主题 - Skype拨打普通电话的费率是多少? Ubuntu中文 论坛 :: 阅读主题 - [转帖]关于locale的设定,为什么要设定locale