Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After I installed Ubuntu 12.04 from Live USB. The installation went very well. But When I restarted my computer, I couldn't boot into it. I have to boot it from Live USB.

What could be the reason and how to solve this?

share|improve this question
add comment

2 Answers

Looks like you installed the GRUB boot record onto that external Hard Drive. To fix the GRUB boot record on the MBR do following:

  1. Boot The machine (preferably from CDROM, to avoid breaking the Live USB by chance)
  2. Open terminal, sudo su -
  3. Find out the name of the partition you installed the ubuntu onto (use fdisk to look up the device (for example: fdisk -l /dev/sda))
  4. chroot into the partition and fix the GRUB (the commands below assume partition /dev/sda1)
mkdir /tmp/a
mount /dev/sda1 /tmp/a
cd /tmp
for t in dev proc sys;{ mount -o bind $t a/$t; }
chroot $t
grub-install --recheck --no-floppy /dev/sda
update-grub
exit
for t in dev proc sys;{ umount a/$t; }
umount a

take out the CDROM and reboot

share|improve this answer
    
THank you for helping me! After the 3rd step, it showed that Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x000b50aa So I assumed that my internal disk is /dev/sda. Then I did the 4th step, then they say there is no such directory. How do I resolve this? –  Khang Nguyen Apr 27 '12 at 11:43
    
Try sudo grub-install /dev/sda -- see askubuntu.com/a/125616/8844 –  belacqua Apr 27 '12 at 23:54
    
@KhangNguyen I think step 4 should have --boot-directory=/dev/sda . –  belacqua Apr 27 '12 at 23:57
add comment

I'm basically just repeating most of what is in the answer from Arie Skliarouk. I'm doing it in an answer rather than a comment because it is possible to format the text in an answer.

(By the way, for future reference please do not reply to a question in a comment with a comment. Instead, respond by updating (editing) your question. This is the preferred convention described in the How to Ask a Question Here help section.)

  1. Use your Live USB to boot the Ubuntu installed on your computer's hard drive.
  2. Open a terminal window. (The keyboard shortcut CtrlAlt + T should do this or whatever method you prefer.)
  3. Enter the command df -HT in the terminal window. The result should look something like the screenshot below. Note the circled line which says that /dev/sda1 is mounted on /. This is the "root" of your filesystem.
    If you are using the Ubuntu you installed to your hard drive then your root partition should be on your hard drive. Check this by looking at the size value. The partition on your hard drive should be the largest one shown. (Unless something very strange happened when you installed!)

    enter image description here
  4. Assuming the above confirmed that you are running the Ubuntu on your hard drive, issue the command below. This will re-install the GRUB boot loader which should allow your computer to boot from its hard drive.

      sudo grub-install --recheck /dev/sda

    Important:
    Just remove the digit at the end of the string from step 3 that / is mounted on. For example, if in step 3 / is mounted on /dev/sdb2 you would omit the 2 and just use /dev/sdb in the grub-install command.
  5. If the above went well then enter the command sudo update-grub
  6. See if you can reboot without using your Live USB.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.