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.

I am attempting to install Ubuntu on a box which was previously running Windows 7.

I have also experienced the dreaded "Unable to install GRUB" error.

I am not attempting to dual boot. I have previously run a Windows boot disk and removed all existing partitions.

If I run the Ubuntu 12.04 install CD and click install after the config screens, I get the error Executing 'grub-install /dev/sda' failed. This is a fatal error.
(It is the same error as this question: Unable to install GRUB)

All the questions I've read while looking for a solution are related to dual boot. I'm not interested in dual boot, I'm after a clean out the box Ubuntu install. How can I achieve this?

(For my sanity, please use very simple instructions when responding. I don't claim to have any talent either for linux or as a sysadmin)


Additional details copied from comments dated: 2012-05-29 ~15:19Z

After booting from the CD, clicking Try Ubuntu, and then sudo fdisk /dev/sda I get
fdisk: unable to seek on /dev/sda: Invalid argument

sudo fdisk /dev/sdb gives

Device contains neither a valid DOS partiion table, nor Sun, SGI or OSF disklabel. 
Building a new DOS disklabel with disk identifier 0x15228d1d. 
Changes will remain in memory only until you decide to write them. 
After that of course, the previous content won't be recoverable. 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite). 
Command (m for help):

I should add the Live CD desktop is graphically bad. I've got missing parts of programs and the terminal occasionally reflects to the bottom of the screen. But I can't imagine this is related.

share|improve this question
    
What is the error that you are receiving? –  harisibrahimkv May 29 '12 at 13:08
    
@harisibrahimkv "Executing 'grub-install/dev/sda' This is a fatal error - the same error as in askubuntu.com/questions/62051/unable-to-install-grub however mine is not a dual boot and I am using the detail partitions –  Liath May 29 '12 at 13:13
    
You may be experiencing this bug bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/976027 –  Enkouyami Jun 5 '12 at 17:16
    
I am also facing similar problem when using first option on installation disk where it says, it will manage partition and isstall etc. It says, it is a fatal error. When I choose manual (last option) then it works correctly. I partitioned my harddisk using partition tool and then used CD by selecting manual selection. That way problem won't come. –  Satya Prakash Jan 3 '13 at 7:10

4 Answers 4

My understanding from your comments to @harisibrahimkv are that when you run the command sudo fdisk /dev/sda in a terminal window, you get the message fdisk: unable to seek on /dev/sda: Invalid argument. I would not expect to see this and it makes me wonder if there is a problem with your computer's hard drive.

Would you please post more information about your hardware? You could do this by booting into Try Ubuntu with your install CD and then adding the output from the two commands below to your question.

sudo lshw -short
sudo lshw -class disk -class storage

Note:
You can select text in a terminal window using either the left mouse button or by pressing Alt+E while the terminal window is active and using the Select All entry in the terminal's Edit menu.

After selecting the text either the keyboard shortcut ShiftCtrl+C or the Copy entry in the terminal window's Edit menu will copy to the clipboard.

You can then add this to your question by using the LiveCD's Firefox browser to edit it and then pasting the command output into the question's edit window in the browser.

screenshot from FAQ showing edit link

Please do not use comments to add the output from the commands. Comments are not intended to be used that way.

If you are experiencing problems with graphics, then I suggest you first verify that your install media (CD) is OK. You can do this by running the Check disc for defects menu option from the Ubuntu CD Advanced Welcome Page Options.

To display this menu, press any key after booting your install CD and while the Ubuntu "small logo" Ubuntu Live CD/USB 'small logo' is displayed at the bottom of your screen.

If your install CD is valid, and therefore not the source of the graphics errors you are seeing, then you might want to try installing using the Ubuntu alternate install CD. The alternate install CD is not a "LiveCD". It performs a text based install which avoids potential problems with graphics drivers. It also contains some hardware drivers which are missing from the standard LiveCD.

You can get the alternate install CD ISO image from the Ubuntu 12.04 LTS releases page. If your hardware is old then you probably want to use the 32-bit version, ubuntu-12.04-alternate-i386.iso

share|improve this answer
    
I'd also be inclined to check the md5sum of the download you created the cd from - in fact I always check the hash - help.ubuntu.com/community/HowToMD5SUM and help.ubuntu.com/community/UbuntuHashes –  Elfy May 31 '12 at 6:45
    
@forestpiskie I tend to suggest running Check disc for defects first both because the validity of the install media is what matters most and it is easier in that it only involves making a menu selection, not running another tool. But, yes, if the install media is bad, then the ISO image needs to be checked to determine if the problem was from an error creating the CD or from a bad ISO. –  irrational John May 31 '12 at 6:58
    
@forestpiskie FWIW, the entire Check the CD section in the HowToMD5SUM help article strikes me as tedious and pointless. I can't imagine why anyone would want to use the approach outlined there rather than simply using Check disc for defects. It should probably be moved and just linked to. –  irrational John May 31 '12 at 7:07

I had the same issue.

Solved it by first clicking on the 'Try Ubuntu' button and then on the 'Install Ubuntu' desktop shortcut.

share|improve this answer

I think it might have messed up your hard disk name. Do try reinstalling GRUB.

  1. Boot using a live CD of Ubuntu.

  2. Open a terminal and run the command

    sudo fdisk -l
    

    It lists the complete partition table of the hard disk. In there, identify which partition you have got your linux installed on. You can identify it using the drive size you had allocated for it and looking at the last column of the output which will be ‘extended’ for all of your linux partitions. The partition will most probably be something like /dev/sda5 or something. Remember this partition.

  3. Create a temporary folder in your home directory (Note: You can make the temporary folder anywhere you want. I’m using the home folder just for the sake of explanation). I’m calling it ‘temp’ for now. So that ‘temp’ folder’s path will be /home/ubuntu/temp.

  4. Mount your linux partition there. That is, assuming that you found your linux partition to be /dev/sda5, you mount that at the ‘temp’ folder by doing the following command

    sudo mount /dev/sda5 /home/ubuntu/temp
    
  5. If you want to check whether you have mounted the correct partition, go to your home folder and open temp. You will be in the / directory. In there you will find ‘home’, in which your home folder’s name will be there. Once you’ve confirmed you have mounted the correct partition, do step 6.

  6. You have to install grub by showing the system where to read the data from the hard disk at the beginning. Don’t worry, just run the following command

    sudo grub-install --root-directory=/home/ubuntu/temp /dev/sda
    

    The /dev/sda corresponds to your hard disk name. Replace it by whatever the command sudo fdisk -l command showed you.

  7. You’re done. You may restart your system.

share|improve this answer
    
Thanks for your help so far! I've booted from the CD and clicked "Try Ubuntu", then when doing the fdisk I get "fdisk: unable to seek on /dev/sda: Invalid argument" –  Liath May 29 '12 at 13:31
1  
Try "sudo fdisk /dev/sda" or "sudo fdisk /dev/sdb". Also, did you have any external USB devices plugged in to your system while installing your Ubuntu? –  harisibrahimkv May 29 '12 at 13:35
    
/dev/sda gives the same as above (unable to seek), /dev/sdb gives "Device contains neither a valid DOS partiion table, nor Sun, SGI or OSF disklabel. Building a new DOS disklabel with disk identifier 0x15228d1d. Changes will remain in memory only until you decide to write them. After that of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite). Command (m for help):" –  Liath May 29 '12 at 14:07
    
I should add the trial is graphically bad, I've got missing parts of programs and the terminal occasionally reflects to the bottom of the screen... can't imagine this is related though. –  Liath May 29 '12 at 14:08
1  
I think I'm running out of options here. Do you have Gparted in your try-ubuntu? Then launch it and see what it says about your hard disk. –  harisibrahimkv May 29 '12 at 14:50

I had this same problem earlier today when trying to clean install from a USB drive. I burned the ISO to a disc and did a clean install from there and it worked fine. I know that doesn't really solve the problem but it might prove to be a quick fix if that's all you're after.

share|improve this answer

protected by Community Sep 1 '12 at 20:22

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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