Where should I install grub?

I formatted my laptop due to messing up GRUB and MBR.

And I don't want that to happen again, so... Where is the correct partition that I should install GRUB?

My partitions are

System Reserved (/dev/sda1 I beleive)
Windows 8 (/dev/sda2)

The next ones are not made but are supposed to be as I list when I create them:

Ubuntu (/dev/sda3)
Pear OS 8 32-Bit (/dev/sda4)
Swap Partition (2GB /dev/sda5)

Now, where should I put GRUB?!


Solution 1:

If you are using your internal hard disk for both Windows 8 and Ubuntu, then you should be storing your grub on the first sector of the HDD.

This is while installing Ubuntu, in the partitioning stage. You will get a dialog box with all your partitions mentioned and at the bottom, you will be asked where you want to store your grub. Here, you should point it to /dev/sda. Note that there is no number at the end and just the device name.

Solution 2:

if your hdd is gpt (not ntfs), Ubuntu should put grub in a "bios grub" partition. Shouldn't need a GB, 2MB is plenty for multiple OS's in Grub