Fix grub and grub
Use ubuntu9.10 or later (the system disk below 9.10 is fixed in grub1 (if not, I will introduce it in another chapter on my blog), and select "try and not install" as the boot disc ", open the terminal after entering:
(Note the space between commands, especially the space before mnt)
Add/first, sudo fdisk-l should find the id = 83 option, for example, my is:
Disk/dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0xbbc20dd6
Device Boot Start End Blocks Id System
/Dev/sda1*1 3891 31254426 7 HPFS/NTFS
/Dev/sda2 3892 6261 19028992 83 Linux
/Dev/sda3 6261 38914 262282241 f W95 Ext 'd (LBA)
/Dev/sda4 6504 11727 41953280 7 HPFS/NTFS
/Dev/sda5 6261 6504 1952768 82 Linux swap/Solaris
/Dev/sda6 11727 24794 104960000 7 HPFS/NTFS
/Dev/sda7 24794 38914 113414144 7 HPFS/NTFS
In this way, get your ubuntu partition in/dev/sda2.
Then follow the steps below
1. sudo-I
2. mount/dev/sda2/mnt
3. for mount/dev/sda2/mnt/boot, run the command to separately partition/boot. skip this step if no partition exists.
4. grub-install -- root-directory =/mnt // dev/sda
5. Restart
6. After the machine restarts, it enters the grub interface, but does not enter the grub menu, so there are the following steps:
7. find/boot/grub/core. img (if the boot is partitioned separately, find/grub/core. ima)
The command returns the following result: (hdx, y)
8. root (hdx, y)
9. kernel/boot/grub/core. img
(For boot, separate partitions: kernel/grub/core. img)
10. boot
Run this command and go to the GRUB menu.
11. Start the terminal in ubuntu
12. sudo grub-install/dev/sda
This command is used to repair grub,
After the above steps, the original dual-system can be restored.