您的位置:首页 > 其它

GRUB - Debian 6 下无/boot/grub/menu.lst

2013-05-10 13:17 281 查看
GRUB是一个多重操作系统管理器,用于引导不同的系统。

在Debian 6 以前 GRUB的版本是 v1,到了Debian 6之后,GRUB的版本就升级为v2,而配置v1与v2有着比较大的区别:

配置grub v1:

配置文件是 /boot/grub/menu.lst,在Debian系统下,grub的配置文件在你安装完一个新的内核后是会自动更新的,自动调用 update-grub 命令。

配置grub v2:

配置文件是 /boot/grub/grub.cfg,但是我们不能直接修改或者编辑这个文件,它是由 grub v2 版本的 update-grub 命令根据以下文件生成的:

1. /etc/grub.d/ 目录下的脚本片段。

2. 配置文件 /etc/default/grub。

我们可以修改或编辑 /etc/default/grub配置文件,然后运行 update-grub 命令,来配置 grub v2。

/etc/grub.d/目录下一般有以下文件:

-rwxr-xr-x 1 root root 6433 Sep 19  2011 00_header

-rwxr-xr-x 1 root root 5343 Sep 19  2011 05_debian_theme

-rwxr-xr-x 1 root root 4284 May 28 16:40 10_linux

-rwxr-xr-x 1 root root 4925 Sep 19  2011 20_linux_xen

-rwxr-xr-x 1 root root 5789 Sep 19  2011 30_os-prober

-rwxr-xr-x 1 root root  214 Sep 19  2011 40_custom

-rwxr-xr-x 1 root root   95 Sep 19  2011 41_custom

-rw-r--r-- 1 root root  483 Sep 19  2011 README

/boot/grub/grub.cfg文件中的配置分别根据以上文件由update-grub命令与/etc/default/grub文件合并而来。

下面是/boot/grub/grub.cfg部分内容:

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###

# This file provides an easy way to add custom menu entries.  Simply type the

# menu entries you want to add after this comment.  Be careful not to change

# the 'exec tail' line above.

### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###

if [ -f  $prefix/custom.cfg ]; then

  source $prefix/custom.cfg;

fi

### END /etc/grub.d/41_custom ###

哪些配置由哪个文件生成而来的一目了然。
具体的说明参见:http://wiki.debian.org/Grub

博主所有文章已转自私人博客 Joe 的个人博客,谢谢关注!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: