xp与Squeeze debian 双系统启动菜单的更改

来源:互联网 发布:更改windows桌面路径 编辑:程序博客网 时间:2024/04/20 12:06

安装了xp和squeeze debian后,想把默认的启动系统更改为xp,查了些资料,大部分都是错的(因为debian版本的不同)


以下为错误的解决方式:

先备份:sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
修改启动菜单:sudo gedit /boot/grub/menu.lst
修改中间的default 0
你想进入的OS位于第几项 就把0改为几就可以了。(记住项数是从0开始算起的)
for example
假设menu.lst菜单如下:
default 0  (在menu.lst 中间,认真点找)
timeout 10  (此处是你设置的开机选择系统时间)
gfxmenu (hd0,2)/boot/message.mint
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.20-16-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=31ef2f9a-d93c-4533- 94c7- 223f69a184e6 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
boot
title Debian GNU/Linux, kernel 2.6.20-16-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=31ef2f9a-d93c-4533- 94c7-223f69a184e6 ro single
initrd /boot/initrd.img-2.6.20-16-generic
boot
title Debian GNU/Linux, kernel 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.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows XP
root (hd0,0)
savedefault
makeactive
chainloader +1
假如你想把win xp作为默认的操作系统,那就把default 0改为default 4 即可。
注意:
title Other operating systems:
也是算一个操作系统的哦

在squeeze debian的grub目录下是不存在menu.lst这个文件的。正确的更改方式如下:

在终端输入:
gedit /etc/default/grub

grub文件里 GRUB_DEFAULT=0 这一项是默认启动的操作系统, 0 代表第一个操作系统, 1 代表第二个操作系统,依此类推。
如果想默认启动第三个操作系统就把 0 改为 2 。

GRUB_TIMEOUT=5 这一项是进入系统的等待时间,默认为 5 秒。

修改好后,保存关闭,在终端输入:
sudo update-grub
更新grub



在http://wiki.debian.org/Grub#Debian_Squeeze_and_later中可以看出,这是因为squeeze版和以前的版本(如lenny)引导软件有些不同所致。

Configuring Grub

Configuring grub v1

The configuration file is /boot/grub/menu.lst

Under Debian, the grub configuration file is updated automatically, when you install a new kernel. This is done automatically byupdate-grub.

You can edit the settings in /boot/grub/menu.lst. Make sure you read the comments,/usr/share/doc/grub/README.Debian.gz for more information and theupdate-grub(8) manpage from your distribution.

Configuring grub v2

The configuration file is /boot/grub/grub.cfg, but you shouldn't edit it directly. This file is generated by grub v2'supdate-grub(8), based on:

  1. The script snippets in /etc/grub.d/

  2. The configuration file /etc/default/grub

To configure grub "v2", you should edit/etc/default/grub, then runupdate-grub. Advanced configuration are achieved by modifying the snippets in/etc/grub.d/.

Also check the Grub2 page for more detailed configuration instructions, ideas and suggestions.




其他有用外链:http://forums.debian.net/viewtopic.php?f=17&t=60328


原创粉丝点击