> Linux教程 > Linux学习 >

在 grub引导菜单中添加 WIN7启动项

终端命令:sudo gedit /boot/grub/menu.lst

1.找到hiddenmenu,在它前面打上#,变成#hiddenmenu

2.在文件最后面增加以下内容:
     title Windows
         root (hd0,0)
         makeactive
         chainloader +1

保存文件,重启电脑,就可以看到系统选择菜单了,我们又可以进入windows了

 

附上我的/boot/grub/menu.list

#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=15
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.31.5-127.fc12.i686.PAE)
        root (hd0,2)
        kernel /boot/vmlinuz-2.6.31.5-127.fc12.i686.PAE ro root=UUID=c160a497-bdc1-4017-a7d9-5bce8a4c1570  LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
        initrd /boot/initramfs-2.6.31.5-127.fc12.i686.PAE.img

title Windows 7
        root (hd0,0)
        makeactive
        chainloader +1


(责任编辑:IT)