Using Terminal Method
If you have Ubuntu 12.04 installed, ensure you use a Ubuntu 12.04 live CD.
Open a terminal after booting into the live environment. Identify the partition Ubuntu is installed on using one of the following commands:
sudo fdisk -l
sudo blkid
Step 1
Here is the output of both commands. In the sudo fdisk -l command, the Ubuntu partition is identified by the word Linux in the System column.
Step 2
In the sudo blkid command, the partition is identified by its ext4 file system.
Step 3
Run the following command to mount the Ubuntu partition at /mnt, replacing /dev/sdX# with the device name of your Ubuntu partition from the above commands:
sudo mount /dev/sda9 /mnt
For example, use /dev/sda1 for the first partition of the first hard disk device.
Important: If you have a separate boot partition, skip the above command and mount the boot partition at /mnt/boot. If you don't know whether you have a separate boot partition, you probably don't.
Step 4
Run the following command to reinstall grub from the live CD, replacing /dev/sdX with the device name of the hard disk above. Omit the number. For example, if you used /dev/sda9 above, use /dev/sda here.
sudo grub-install --boot-directory=/mnt/boot /dev/sda
Step 5
Restart your computer and Ubuntu should boot properly.
No comments:
Post a Comment