Ubuntu 9.10开始使用grub2引导系统


由于Ubuntu 9.10开始使用grub2来引导系统,新版grub2的引导配置文件就不再是menu.lst了,而是
/boot/grub/grub.cfg文件,这与旧版本不同了,而且为了安全起见,该文件默认为“只读”属性,因此在修改启动菜单之前你必须先将其文件属性改为“可读写”后方可修改文件内容。

sudo chmod +w /boot/grub/grub.cfg

添加后内容如下:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from  and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set default=0 //默认启动顺序
set timeout=5 //等待时长
set root=(hd0,7) //引导文件所在分区目录
search --fs-uuid --set 98c1c189-b321-440d-89b5-7ff0723c83e2 //根分区的UUID

set menu_color_normal=cyan/blue //设置背景色
set menu_color_highlight=white/blue //设置高亮色

# menuentry后面双引号内的文字即是显示在启动菜单上的启动项目名称
menuentry "Ubuntu,9.10 (linux 2.6.30-8-generic)" {
# 定位启动分区
set root=(hd0,7)
# 检查UUID后启动系统
search --fs-uuid --set 98c1c189-b321-440d-89b5-7ff0723c83e2
linux    /boot/vmlinuz-2.6.30-8-generic root=UUID=98c1c189-b321-440d-89b5-7ff0723c83e2 ro  quiet splash
initrd    /boot/initrd.img-2.6.30-8-generic
}

# XP系统的引导部分与旧版本相同
menuentry "Windows XP Pro" {
set root=(hd0,1)
chainloader +1
}

相关内容