Add win7 boot menu for CentOS 7
Case background
This case is to install the CentOS 7 Linux system on an idle partition, based on the Windows 7 system installed. When the Linux system is successfully installed, it does not retain the Windows 7 System boot menu as in the CentOS 6 version. Instead, only Centos7 's system boot menu is available. The Windows 7 boot menu must be manually added by the administrator in the/boot/grub2/grub.cfg file after entering the Linux system.
Scenario One: The following content is written to the/etc/grub.d/40_custom file, and the Grub.cfg boot menu file is regenerated.
1th step, edit the/etc/grub.d/40_custom file.
Vi/etc/grub.d/40_custom Add the following content (menu content Reference scheme i)
Menuentry ' Win7 ' {
Insmod Part_msdos
Set root= ' HD0,MSDOS1 '
Search-f/windows/notepad.exe--set-root
Chainloader +1
}
2nd step, update the Grub.cfg menu file.
Grub2-mkconfig-o/boot/grub2/grub.cfg
3rd, set Win7 as the default startup.
grep win7/boot/grub2/grub.cfg
Grub2-set-default ' Win7 '
Grub2-editenv List
4th, reboot restarts the Linux system, verifies that there is a win7 boot menu, and can start the Win7 system normally.
-------------------
Appendix:
Vi/etc/grub.d/40_custom Add the following content (optimized menu Content reference scheme one)
Menuentry ' win7 ' {#指定菜单标题
Insmod Part_msdos #加载msdos分区模块
Set root= ' HD0,MSDOS1 ' #设置根分区为第1块硬盘的msdos1分区
Search-f/windows/notepad.exe--set-root #将搜索到的notepad the partition where the. ext file is set to the root
Chainloader +1 #链接引导
}
/etc/grub.d/40_custom Menu File content reference Scheme II
Menuentry ' Win7 ' {
Set Root (hd0,1)
Chainloader +1
}
/etc/grub.d/40_custom Menu File content Reference Scheme III
Menuentry ' Win7 ' {
Insmod Chain
Insmod NTFS
Set Root (HD0,MSDOS1)
Chainloader +1
}
This article is from the "Network Technology World" blog, please be sure to keep this source http://1364952.blog.51cto.com/1354952/1977161
Add win7 boot Menu for CentOS 7 (king test)