We recommend that you first install windows and then Linux. During system installation, boot blocks will be written in MBR. During Linux installation, a grub will be installed, but you accidentally delete the LINUX partition, the Bootstrap program cannot read the location of the system, causing a gurb command prompt. In this case, you can manually start Windows 7 on drive C. Enter the following three commands.
1. rootnoverify (hd0, 0) is set as the root partition/root device, but does not load the file system. (Hd0, 0) indicates the Partition Number of the hard disk.
2. chainloader + 1 transfers the boot guide right to the first sector of the current Partition
3. boot
But every time you start the boot, you have to enter the primary Boot Sector MBR (the first sector of the hard disk). One sector is 512 bytes, and the first 446 bytes are used for the boot program, the next 64 bytes are used to store the partition information, and the last two bytes are the end mark. There are many ways to fix it. In XP, you can use a tool named fuse, and then input bootsect/nt60 sys/MBR in cmd.
If you have installed Linux before Windows, you may not be able to enter Linux. At this time, you can manually add a grubdos startup Item to go offline in Windows. The method of adding XP is relatively simple, bcdedit must be used in win7. You can view the help to learn about bcdedit /?.
Bcdedit/create/D "Grub"/Application bootsector
Bcdedit/set {ID} device partition = C:
Bcdedit/set {ID} path/grldr. MBR
Bcdedit/displayorder {ID}/addlast
Grldr. MBR here is in the grub installation package. You need to copy it to drive C or another disk. After adding it, start it. We can go to grub and start Linux manually.
Kernel (hd0, x)/vmlinuz
Initrd (hd0, x)/initrd. img
Boot
We can also use this method to install linux. If you do not have an installation disk, you can put the Linux installation package on a disk in FAT32 format and put vmlinuz and initrd in the installation package. IMG copies the two files. Follow the above method to start the disk where the installation file ISO is located.
There is a program in Linux that can repair MBR. Download MS-sys and then execute MS-sys-MBR/dev/sda1, the effect is the same as that of "fdisk/MBR" in DOS.