Sei sulla pagina 1di 3

Here's how:

Boot from the live CD.


Determine the partition number of your main partition. GParted can help you
here. I'm going to assume in this answer that it's /dev/sda2, but make sure you
use the correct partition number for your system!
Mount your partition:
sudo mount /dev/sda2 /mnt # make sure that sda2 is correct!
Bind mount some other necessary stuff:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
chroot into your Ubuntu install:
sudo chroot /mnt
At this point, you're in your install, not the live CD, and running as root.
Update grub:
update-grub
If you get errors, go to step 7. (Otherwise, it is optional.)
Depending on your situation, you might have to reinstall grub:
grub-install /dev/sda
update-grub # I'm not sure if this is necessary, but it doesn't hurt.
If everything worked without errors, then you're all set:
exit
sudo reboot
At this point, you should be able to boot normally.
If you cannot boot normally, and didn't do step 7 because there were no error me
ssages, try again with step 7.
Sometimes giving GRUB2 the correct configuration for your partitions is not
enough, and you must actually install it (or reinstall it) to the Master Boot Re
cord, which step 7 does. Experience helping users in chat has shown that step 7
is sometimes necessary even when no error messages are shown.
-----------------The windows installer doesn't care about other OS in the system. So it writes ow
n code over the master boot record. Its not a problem of windows installer, its
intended. If you reinstall, upgrade windows you will face the issue. Fortunately
the solution is easy too.
You need to repair the mbr. Do the following
Boot using a live usb/cd of ubuntu. Use boot-repair to fix the problem.
After booting with live usb/cd ,Run following command in terminal,

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update


sudo apt-get install -y boot-repair && boot-repair
Use Recomended Repair.
----------------------"METHOD 3 - CHROOT
This method of installation uses the chroot command to gain access to the broken
system's files. Once the chroot command is issued, the LiveCD treats the broken
system's / as its own. Commands run in a chroot environment will affect the bro
ken systems filesystems and not those of the LiveCD.
1) Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live
CD must be the same as the system you are fixing - either 32-bit or 64-bit (if n
ot then the chroot will fail).
2) Open a terminal (Applications > Accessories > Terminal).
3) Determine your normal system partition - (the switch is a lowercase "L")
sudo fdisk -l
If you aren't sure, run
df -Th
Look for the correct disk size and ext3 or ext4 format.
4) Mount your normal system partition:
Substitute the correct partition: sda1, sdb5, etc.
sudo mount /dev/sdXX /mnt
Example: sudo mount /dev/sda1 /mnt
5) Only if you have a separate boot partition: sdYY is the /boot partition desig
nation (for example sdb3)
sudo mount /dev/sdYY /mnt/boot
6) Mount the critical virtual filesystems:
sudo
sudo
sudo
sudo

mount
mount
mount
mount

--bind
--bind
--bind
--bind

/dev /mnt/dev
/dev/pts /mnt/dev/pts
/proc /mnt/proc
/sys /mnt/sys

7) Chroot into your normal system device:


sudo chroot /mnt
8) If there is no /boot/grub/grub.cfg or it's not correct, create one using
update-grub
9) Reinstall GRUB 2:

Substitute the correct device - sda, sdb, etc. Do not specify a partition number
.
grub-install /dev/sdX
10) Verify the install (use the correct device, for example sda. Do not specify
a partition):
sudo grub-install --recheck /dev/sdX
11) Exit chroot: CTRL-D on keyboard
12) Unmount virtual filesystems:
sudo
sudo
sudo
sudo

umount
umount
umount
umount

/mnt/dev/pts
/mnt/dev
/mnt/proc
/mnt/sys

13) If you mounted a separate /boot partition:


sudo umount /mnt/boot
14) Unmount the LiveCD's /usr directory:
sudo umount /mnt/usr
15) Unmount last device:
sudo umount /mnt
16) Reboot.
sudo reboot

Potrebbero piacerti anche