Operating system version:Ubuntu14.04.1 and Windows7 sp1x64 versionFailure phenomena:
Install the Windows7 SP1 64-bit version first, then use a USB stick to install Ubuntu 14.04.1. After the installation of Ubuntu is successful, it can start normally, and the Windows 7 menu item on grub will not boot to the Win7 interface and return to the Grub menu interface directly.
Fault Analysis:
The process of installing Ubuntu goes through the partitioning steps, such as. Instead of selecting the default option/DEV/SDA when specifying boot loader, select/DEV/SDA1. Because the active partition of the hard disk is the first partition sda1. The Windows7 installer by default divides a small 100MB partition to store the boot file. And the partition of the C disk is the second partition on the hard disk is sda2. At this point, if the GRUB2 boot program is installed in the "/" partition, it will cause Ubuntu can not start, and I do not want to GRUB2 the cause of the program installed on the MBR of the hard disk. So choose to install grub on the boot partition Sda1 windows.
Ubuntu installation Successful, restart the selection windows7 start, the results of a tragic appearance. Select the Windows 7 Startup menu to start Windows without reflecting back to the grub boot menu after a few seconds.
1. To analyze the problem Open Ubuntu Software Center installation Software "Inspect boot environment" can also search directly "Boot-info-script"
2. Open terminal, Run command
3. The default output to the RESULTS.txt in the home folder, the contents are as follows:
Boot Info Script 0.61 [1 April 2012] ====================== Boot Info Summary: ========================== = = Windows is installed in the MBR OF/DEV/SDA. SDA1: __________________________________________________________________________ File System:ntfs Boot Sector TYPE:GRUB2 (v1.99) Boot Sector INFO:GRUB2 (v1.99) is installed in the boot sector of SDA1 and looks at sector 1886304656 of the same For core.img. Core.img is at the location and looks In partition. No errors found in the Boot Parameter Block. Operating System: Boot Files:/BOOTMGR/BOOT/BCD Sda2: __________________________________________________________________________ File System:ntfs Boot sector type:windows VISTA/7: NTFS Boot sector Info:no errors found in the boot Parameter Block. Operating System:windows 7 Boot Files:/windows/system32/winload.exe Sda3: __________________________________________________________________________ File System:ntfs Boot sector type:windows VISTA/7: NTFS Boot sector Info:no errors found in the boot Parameter Block. Operating System: Boot files: |
The startup information looks at the Windows Launcher installed on the primary hard disk MBR, and the boot file is installed on Sda1. The initiator is bootmgr. Boot sector type is grub, not NTLDR. The boot Sectorinfo is also not a Windows initiator information. This determines that the Windows initiator located on the SDA1 boot sector has been superseded by grub. Therefore, the Windows initiator located on SDA1 is corrupted.
4. Take a look at the problem in the Grub startup script below. Enter the/boot/grub directory, open the Grub.cfg file view, and the Grub.cfg section that appears below about Windows 7 startup.
323 # # # begin/etc/grub.d/30_os-prober # # 324 menuentry ' windows 7 (loader) (on/dev/sda1) '--class windows--class os $menuentry _id_option ' Osprober-chain-04ec18f4 ec18e22a ' { 325 Insmod Part_msdos 326 Insmod NTFS 327 set root= ' HD0,MSDOS1 ' 328 if [x$feature_platform_search_hint = xy]; Then 329 Search--no-floppy--fs-uuid--set=root--hint-bios=hd0,msdos1--hint-efi=hd0,msdos1--hint-baremetal=ahci0, MSDOS1 04ec18f4ec18e22a "Else" 331 Search--no-floppy--fs-uuid--set=root 04ec18f4ec18e22a 332 fi 333 Parttool ${root} hidden- 334 chainloader +1 335} 336 Set Timeout_style=menu 337 if ["${timeout}" = 0]; Then 338 Set timeout=10 339 fi 340 # # # End/etc/grub.d/30_os-prober # # |
There is no problem with the Windows Startup section of the configuration file. If the Windows launcher on your hard disk is not broken by grub, the above configuration will work perfectly. In particular, the meaning of Chainloader is to be mentioned here.
The Chainloader is used to toggle the initiator, +1 is the drive fan block location of the specified initiator. The meaning of the CHAINLOADER+1 statement in line 334 is to enable the initiator of the first block in sda1 to boot the operating system. At this point the first block of SDA1 has been occupied by grub, and the result of switching the initiator is to start the grub again. So when the user chooses Windows 7 loader in grub, it's weird to return to the Grub menu.
Process steps
Win 7 starts from MBR boot, the second step calls Bootmgr, and the third step calls Winload.exe. Finally, the boot of the Win7 system is completed by Winload.exe. SDA1 bootmgr file is saved well and winload is not corrupted in the system folder. So just complete the MBR-to-bootmgr boot to fix windows startup.
1. Modify the Grub.cfg profile to use Administrator privileges in Ubuntu. Open the terminal and enter the following command to edit the configuration file:
sudo gedit/boot/grub/grub.cfg |
2. Modify the 334-line chainloader+1 statement to replace the Ntldr/bootmgr
........ Omitted above 331 Search--no-floppy--fs-uuid--set=root 04ec18f4ec18e22a 332 fi 333 Parttool ${root} hidden- 334 Ntldr/bootmgr 335} ......... The following ellipsis |
The NTLDR command completes the MBR-to-bootmgr boot.
3. Save the configuration file and restart the computer. You will see the familiar Win7 splash screen.
Linux: After installing dual system (Win7+ubuntu), Ubuntu Normal, Win7 unable to boot