I. XP guidance and repair:
XP boot is very simple, usually in this mode:
Normally, XP is guided by MBR (which does not belong to any partition and is located in the first sector of the hard disk, that is, the primary boot sector,
-- MBR boot program will load the Boot Sector of the active partition (XP installation zone, usually drive c) into the memory
-- The file NTLDR in the boot sector (drive C) is loaded into the memory -- NTLDR reads boot. ini menu (boot. ini lists many boot items. You can select one boot item. Generally, our computer has two boot items, XP and GHOST)
-- If you select NT/XP, NTLDR runs Ntdetect.com (ntdetect.com only provides hardware parameters for NTLDR)
-Start (after NTLDR gives control to XP)
To sum up the above process, choose MBR> boot Sector (first sector of drive c)> NTLDR (boot. ini, ntdetect.com)> Start XP.
Ntdetect.com is only required to start the OS of the NT kernel.
For more information, see: http://baike.baidu.com/view/161134.htm
No error occurs at any stage. The following solution is provided:
1. Windows XP mbr is damaged:
Method 1: insert the Windows installation disc, go to the recovery console, and enter fixmbr or fdisk/MBR. (On the win7 CD: this command is available: bootsect/nt60 sys/force/MBR. This bootsect is similar to fixboot fixmbr under xp)
Method 2: If it is a ghost disc, the console is not restored, but a disk of it will provide commands similar to fixmbr in the dostool. But the name may not be fixmbr (like mbrfix). You can see it in the dostoolbox of the CD.
Method 3: Enter winpe from the CD and run mbrfix/drive 0 fixmbr under cmd of winpe. I suspect this is the same as the fixmbr command in ghost CD mentioned in B. Please download mbrfix here. It is worth mentioning that 2000/2003/Vista uses the same MBR program, like Windows 7, which is also used.
Http://forum.ubuntu.org.cn/viewtopic.php? F = 139 & t = 189240
Http://www.ylmf.net/read.php? Tid = 1496366 & fpage = 0 & page = 1
2. Damage to the Boot Sector of the system partition:
Insert the Windows installation disc and go to the recovery console. Enter fixboot. The ghost CD does not seem to provide such commands. I didn't have any of my CDs. I finally bought an original cd for a fixboot.
3. Corruption of the boot file:
Download boot. ini (which can be written by yourself), ntldr, ntdetect.com.
Then copy the data to your drive C in a variety of ways:
If you are not familiar with doscommand operations, you can enter winpe (small XP on Ghost) and insert the USB flash disk into your computer, copy the files on the USB flash drive to your drive C!
All of the above are the most common, original, effective, and simple methods. If you are familiar with the partition structure, you can also manually modify it using tools such as winhex.
Here is a webpage for reference: http://www.linux-wiki.cn/index.php/repair the NTFS partitioned boot sector covered by grub.
-----------------------------------------------------------------
Ii. Ubuntu boot and repair
Ubuntu is usually guided by grub. The state1 part is put in mbr by default, and may be placed in the boot sector of the partition.
Grub is divided into three types: grub, grub2, grub for dos (grub4dos) (see http://bbs.znpc.net/viewthread.php? Tid = 2297)
For more information about grub2, see Google DOC.
Below I will provide some common solutions for some of my problems. My OS is ubuntu10.04. I have basically tried these solutions and they are very effective.
1. If grub rescue>
The cause of this problem is that grub cannot find the partition where ubuntu is located (in this case, you have adjusted the partition, but the grub configuration has not been adjusted accordingly ).
Therefore, you need to re-specify the partition. Here I will directly post the grub2 getting started tutorial Solution
In rescue mode, only a few basic commands are available. You must perform some operations to load the normal module and then enter the normal mode. <Br/> commands available in rescue mode include: Set, ls, insmod, root, and prefix (set the startup path) <br/> assume that the core file of grub2 is in the (hd0, 8) partition, And then you can see how to switch from rescue mode to normal mode started from (hd0, 8 ). <Br/> the search Command is unavailable in rescue mode. You can run the LS command to check the partition in which the grub2 file is located. For example, <br/> ls (hd0, 8) /View (hd0, 8) the root directory of the partition to see if there is a boot folder <br/> ls (hd0, 8)/boot/View (hd0, 8) file in the/boot directory of the partition <br/> ls (hd0, 8)/boot/GRUB/View (hd0, 8) partition/boot/GRUB directory file <br/> by checking the file, you can determine which partition the grub2 core file is in. Then you can perform the conversion from rescue to normal: <br/> first, check the partition by ls. Based on the partition list, guess the/Partition Number and then ls (hd0, x)/check the file in the partition directory to find/partition, if not, continue searching. Locate/partition (hd0, x) and continue <br/> grub rescue> root = (hd0, X) <br/> grub rescue> prefix =/boot/GRUB <br/> grub rescue> set root = (hd0, X) <br/> grub rescue> set prefix = (hd0, X) /boot/GRUB <br/> grub rescue> insmod normal <br/> rescue> normal --------> If the Start menu appears, press C to enter the command line mode <br/> rescue> Linux/boot/vmlinuz-xxx root =/dev/sdax <br/> rescue> initrd/boot/initrd. IMG-xxx <br/> rescue> boot <br/> kernel version number-xxx can be viewed by pressing the tab key and then manually supplemented All. <Br/> if there is a/boot partition, you must first find the/boot partition (hd0, x), then find the/partition (hd0, Y), and use ls (hd0, x) // and LS (hd0, Y)/determine the partition <br/> grub rescue> root = (hd0, X) <br/> grub rescue> prefix =/GRUB <br/> grub rescue> set root = (hd0, x) <br/> grub rescue> set prefix = (hd0, x)/GRUB <br/> grub rescue> insmod normal <br/> rescue> normal --------> If the Start menu appears, press C to enter the command line mode <br/> rescue> Linux/vmlinuz-xxx root =/dev/SDAY <br/> rescue> initrd/initrd. IMG-xxx-x XX <br/> rescue> boot <br/> Note: <br/> 1) due to the inconsistency of grub2, some may be in insmod normal in step 1. after the MOD loads the normal module, it directly enters the normal mode, that is, the prompt of normal grub> appears. In this case, you cannot execute step 1, that is, you can skip the input of the normal command. <Br/> 2) Although the menu appears when you enter the normal command, you cannot enter the system directly from the menu due to the lack of Linux commands for Kernel loading. You need to press C to continue the operation on the command line. <Br/> 3) If you use/boot to separate partitions, correct the path, as shown in <br/> prefix = (hd0, 8) /GRUB <br/> insmod/GRUB/normal. moD <br/> In addition, root =/dev/sda8 also needs to modify the Partition Number of the root partition. <Br/> 4) Press boot to start the system, open the terminal in the system, and run the command to repair grub. <br/> recreate the configuration file grub. CFG <br/> sudo Update-grub <br/> rebuilding grub to the first hard disk MBR <br/> sudo grub-install/dev/SDA
PS: this problem occurs on my computer because I deleted the partition using sudo fdisk/dev/sda and the partition table has changed. After the change, my OS is in hd0, 9.
After I use grub rescue> set to view it, I find that the original hd0 and 10 are still in it. Then I run the following command:
Grub rescue> set root = (hd0, 9) <br/> grub rescue> set prefix = (hd0, 9) /boot/grub <br/> grub rescue> insmod normal <br/> rescue> normal
Then it enters ubuntu10.04 smoothly, but it is still rescue after restart. We need to re-adjust grub.
So I used sudo grub-install/dev/SDA in the terminal and re-wrote grub to MBR. Normal!
2. In the dual system, reboot windows and boot ubuntu
Cause:
When you reinstall windows with the installed version, the MBR will be rewritten, resulting in the loss of grub in the MBR.
Solution:
You can use grub4dos to boot to Ubuntu and then fix grub. If you have a CD in your hand, you can also fix grub after livecd is started. (For specific solutions, see grub2 getting started Tutorial: Google Doc "using grub2 Common Errors and Solutions ")
Note:
Here to remind everyone that the use of grub4dos words must use the latest, at least grub4dos-0.4.4-2009.10.16. (My previous grub4dos-0.4.4-2009-01-11.zip won't be able to access the ext4 partition, always prompting file not found) This problem I posted on the UBUNTU Forum: http://forum.ubuntu.org.cn/viewtopic.php? F = 139 & t = 273929
There is also a relatively simple solution:
Download a unetbtin from the Internet and use it to easily implement Ubuntu boot. You can also use it for Linux hard disk installation. It does not rewrite the boot program, so it is safe to use it. It provides menu options and is easy to use. See the tutorial (with a picture, but need to register): http://ubuntuforums.org/showthread.php? T = 690912
3. Install gurb In the xp partition rather than mbr when installing ubuntu.
Cause:
This is because the Boot Sector of the XP partition is overwritten by grub. In this case, you can only boot ubuntu, not XP, and use the sudo update-grub2. This command will only update the configuration file/boot/grub. cfg (this is just the boot menu ).
Solution:
A. First, rewrite grub to mbr and enter:
Sudo grub-install/dev/sda
B. Use fixboot to repair the Boot Sector of the XP partition. refer to the"Damage to the Boot Sector of the system partition :"