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 getfdisk: 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.

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 PrakashJan 3 '13 at 7:10

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

Boot using a live CD of Ubuntu.

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.

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.

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

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.

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

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"
–
LiathMay 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?
–
harisibrahimkvMay 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):"
–
LiathMay 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.
–
LiathMay 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.
–
harisibrahimkvMay 29 '12 at 14:50

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.

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" 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.

@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 JohnMay 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 JohnMay 31 '12 at 7:07

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.