Open the terminal program in Ubuntu and enter sudo fdisk-L to view the partition information:
You will see a system, which indicates the partition system type.
You can find the first partition in NTFS format, which is shown in the partition diagram of your Windows system. It is mounted to sda2. What we need to do is change the boot ID to sda2. Now we will see it in the figure. A "*" indicates the boot identifier. Enter the following code in the sda1 partition:
Sudo fdisk/dev/SDA
Next, you will be prompted to enter a-> 1 (this represents sda1)-> A-> 2 (this represents sda2)-> W
Enter sudo fdisk-l again to view the partition information and confirm the boot ID to be changed. Then mount/dev/sda2 to Ubuntu.
First, create a new directory in the/Media Directory to mount sda2 to this directory.
Code:
CD/Media
Mkdir windows7
Mount/dev/sda2/Media/windows7
(If the disk has been mounted, you must first unmount it and then mount the unmount code: umount/dev/sda2). Then we plug the win7 disc and then mount the disc.
Create a new directory under media for disk mounting
CD/Media
Mkdir cdwindows
Attach a CD:
Mount/dev/CDROM/Media/cdwindows, then go to the cdwindows directory and copy the bootmgr file and boot directory under the directory to the/sda2 (that is, the windows7 directory we created above) root directory, then run the Code:
Sudo Update-grub should have options such as Windows 7 lodaer on/dev/sda2. Restart and select the win7 disc to start. When the installation page is displayed, click repair computer in the lower left corner, run the following command to fix the problem:
Bootrec/rebuildbcd
Restart Windows 7 and try again. Finally, remind me not to install any partition in Ubuntu in the primary partition of the entire disk. Otherwise, the Windows Startup item will be lost.