免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1612 | 回复: 0
打印 上一主题 下一主题

升级至grub2 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-08 20:45 |只看该作者 |倒序浏览

                                Debian sid默认的引导程序已经从grub 升级到grub2. 目前grub2的版本号为1.97~beta4-1.
我之前曾经测试过grub2, 当时遇到了一个问题, grub2每次引导Windows后, 总是无法引导Linux, 需要使用引导光盘引导系统并重新安装grub2才能解决. 十一长假期间, 我再次测试了grub2, 发现配置起来相当简单, 使用
wajig update grub
wajig install os-prober
升级grub, 并安装os-prober后. 运行update-grub, 所有的内核都会被添加到启动菜单中, 连Windows也增加到了启动菜单中,省去了手工配置windows的麻烦. 并且还带来了图形化的grub界面.
自动生成的grub.cfg配置如下:
#                                                               
# DO NOT EDIT THIS FILE                                          
#                                                               
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub                    
#                                                                        
### BEGIN /etc/grub.d/00_header ###
set default=0                     
insmod lvm                        
insmod ext2                        
set root=(vg00-root)               
search --no-floppy --fs-uuid --set d48e2c91-e7b8-40fe-b79f-bc3fb82edf20
if loadfont /usr/share/grub/unicode.pf2 ; then                        
  set gfxmode=640x480                                                  
  insmod gfxterm                                                      
  insmod vbe                                                           
  if terminal_output gfxterm ; then true ; else                        
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output                                         
    terminal gfxterm                                                     
  fi                                                                     
fi                                                                       
set timeout=5                                                            
### END /etc/grub.d/00_header ###                                       
### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2                              
set root=(hd0,2)                        
search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
insmod png                                                            
if background_image /grub/moreblue-orbit-grub.png ; then               
  set color_normal=black/black                                         
  set color_highlight=magenta/black                                    
else                                                                  
  set menu_color_normal=cyan/blue                                      
  set menu_color_highlight=white/blue                                 
fi                                                                     
### END /etc/grub.d/05_debian_theme ###                                
### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, Linux 2.6.31-trunk-amd64" {
        insmod ext2                                    
        set root=(hd0,2)                                
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.31-trunk-amd64 root=/dev/mapper/vg00-root ro  quiet
        initrd  /initrd.img-2.6.31-trunk-amd64                                 
}                                                                              
menuentry "Debian GNU/Linux, Linux 2.6.31-trunk-amd64 (recovery mode)" {        
        insmod ext2                                                            
        set root=(hd0,2)                                                        
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.31-trunk-amd64 root=/dev/mapper/vg00-root ro single
        initrd  /initrd.img-2.6.31-trunk-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-2-amd64" {
        insmod ext2
        set root=(hd0,2)
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.30-2-amd64 root=/dev/mapper/vg00-root ro  quiet
        initrd  /initrd.img-2.6.30-2-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-2-amd64 (recovery mode)" {
        insmod ext2
        set root=(hd0,2)
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.30-2-amd64 root=/dev/mapper/vg00-root ro single
        initrd  /initrd.img-2.6.30-2-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-1-amd64" {
        insmod ext2
        set root=(hd0,2)
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.30-1-amd64 root=/dev/mapper/vg00-root ro  quiet
        initrd  /initrd.img-2.6.30-1-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-1-amd64 (recovery mode)" {
        insmod ext2
        set root=(hd0,2)
        search --no-floppy --fs-uuid --set 8b725ae3-b750-4dfa-a4b5-c06efff0b1ff
        linux   /vmlinuz-2.6.30-1-amd64 root=/dev/mapper/vg00-root ro single
        initrd  /initrd.img-2.6.30-1-amd64
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
        insmod ntfs
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set 8ca8b599a8b5826e
        drivemap -s (hd0) ${root}
        chainloader +1
}
### 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 ###
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7667/showart_2065859.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP