After Ubuntu is installed, grub will be written into mbr, which will cause inconvenience to re-install XP in the future. It also makes Windows-based users, supplemented by ubuntu somewhat uncomfortable. The following describes how to restore the mbr and establish the ubuntu boot option while guiding XP. You need to download grub4dos from http://www.linuxidc.com/linux/2009-01/18027.htmto download grldrfiles. Install gr in Ubuntu
After Ubuntu is installed, grub will be written into mbr, which will cause inconvenience to re-install XP in the future. It also makes Windows-based users, supplemented by ubuntu somewhat uncomfortable. The following describes how to restore the mbr and establish the ubuntu boot option while guiding XP.
You need to download grub4dos from http://www.linuxidc.com/linux/2009-01/18027.htmto download grldrfiles.
Install grub in Ubuntu
Sudo apt-get install grub
Go to the grub command line
Sudo grub
Query the partition where/boot is located
Grub> find/boot/grub/core. img
Will prompt (hd0, 6), write down
Go to the windows C root directory:
Find the boot. ini file, add c: \ grldr = Ubuntu 11.04 to the last line, and modify the timeout time you want. Save it.
Create menu. lst in notepad and enter the following content
Timeout 1
Default 0
Title Laptop going into Grub2
Kernel (hd0, 6)/boot/grub/core. img
Boot
(Hd0, 6) the content you just queried. The preceding boot partitions are separated by/grub/core. img instead of/boot/grub/core. img.
Copy the grldr file to the C root directory.
Restart the system and enter the DOS mode (you can use the boot and maintenance Cd, As long as the doscommand is included). Enter
Fdisk/mbr
Restore to normal mbr
OK. The system starts normally. This will display a selection menu, you can choose to enter XP or ubuntu. Back up boot. ini, menu. ls, grldr, and reinstall XP later. You only need to restore these three files to the C root directory.