1, install Win7 First, then install Ubuntu, then after the installation of Ubuntu will go directly to the Ubuntu system, after entering the system to execute:
#sudo Updata-grub Update grub to find Win7 bootloader, reboot and see the option to enter Win7 in the Grub interface. 2, first installed Ubuntu, then install the Win7. At this point, the previous grub boot record in the MBR of the hard disk is overwritten and the grub information needs to be re-written to the MBR. Since the Ubuntu system is already on the disk, simply write the grub information in the system to the MBR. The method is as follows: Make an Ubuntu system LiveCD, the normal USB stick installs the boot file, enters to the LiveCD, mounts to the/media/ubuntu directory in the current system the Ubuntu system is located: #sudo Mount/dev/sdan /media/ubuntu Note that n is where Ubuntu is located in your current system. Then execute the following command: #sudo grub-install--ROOT-DIRECTORY=/MEDIA/UBUNTU/DEV/SDA can write the appropriate grub information to the MBR of the current hard disk. Reboot to enter the Grub boot interface. 3, the original dual system using grub boot, but in Win 7 format the Ubuntu partition, resulting in boot boot failure. The Grub rescue interface is then entered because of information about the grub that still exists in the MBR. Since the core file is no longer in the partition, there is no rescue interface to enter the normal interface. The Win7 installation disk can be used to repair the Win7 startup item, and the Win7 boot information is written directly to the MBR, overwriting the original grub information. Here's how: Find a Win7 installation file (such as a USB flash drive installation file) to boot into the repair screen, enter the command line, enter: >bootrec/fixmbr restart. 4,grub Rescue Processing mode: The commands available in rescue mode are: Set, ls, insmod, root, prefix; If the kernel file of Grub is in the (hd0,8) partition, the steps to enter normal mode are as follows: >root= ( hd0,8) >prefix=/boot/grub>set root= (hd0,8) >set prefix= (hd0,8)/boot/grub>insmod normal>normal> Linux/boot/vmlinuz-xxx-xxx Root=/dev/sda8>initrd/boot/initrd.img-xxx-xxx>boot So you can start the system.
Two ways to fix startup items in Ubuntu under dual system