1, first open the Win7 System Command Prompt window, and then first enter the command sudo-i;
2, first to find your Ubuntu installed in that partition, with the command: fdisk-l my partial output is as follows:
Device Boot Start End Blocks Id System
/DEV/SDA1 5 69443 14998528 Linux
/dev/sda2 69443 94825 5482496 Linux Swap/solaris
/dev/sda3 * 94825 95299 102400 7 hpfs/ntfs
/DEV/SDA4 95299 271531 38066176 7 hpfs/ntfs
The partition where I ubuntu10.04 the root directory is/dev/sda1, if you are unsure, look for ID 83.
3, mount the original system of the root directory:
MOUNT/DEV/SDA1/MNT will/dev/directory/mnt, of course, you can also choose other places.
Here to the directory interpretation, is in the loading system is to select the root partition/income of the directory, such as I installed in the system selected is SDA1
Enter Mount/dev/sda1/mnt here to/dev/sda1/mnt under
It's a special note here that if you hang the boot separately when you install the system, you need one more step.
Mount/dev/sda12/mnt/boot.
SDA12 is the partition where the boot is hung separately when the system is installed
4, Grub-install--ROOT-DIRECTORY=/MNT/DEV/SDA
5, will see installation finished. No Error reported.
6, sudo init 6 re-system, you can choose to enter the system, if you see the grub〉 command line, you may be the third step to choose the boot partition wrong;
7, go to this step on the OK, a user said may not enter the Win7 system, but also need the following steps:
sudo update-grub2 to update grub2 on it.
Follow the prompts to enter the password, if it goes well, the following similar statements will appear, which means success.
Generating grub.cfg ...
Found Linux Image:/boot/vmlinuz-2.6.32-22-generic-pae
Found initrd Image:/boot/initrd.img-2.6.32-22-generic-pae
Found memtest86+ Image:/boot/memtest86+.bin
Found Windows 7 (loader) On/dev/sda3
Done
After the above method is set up, you can enter Ubuntu, if you have to reload the system encountered the same problem, to solve the above method.