Contribute
Register

Installing GRUB after the fact

Status
Not open for further replies.
Joined
Dec 27, 2015
Messages
53
Motherboard
Gigabyte GA-EP45-UD3R 1.0/F12
CPU
Q9650
Graphics
GTX 750 Ti
Mac
  1. MacBook
Mobile Phone
  1. iOS
After successfully getting Sierra up and running on my old Gigabyte box, I'm now attempting to dual-boot Ubuntu 16.04, using the second 80 GB HD I had used to beta test Sierra. In a sense, that's going back to this machine's roots, as Ubuntu was the OS originally installed when I bought it.

I used the Ubuntu "mini" net installer on a CD, as I'd used that to install Xubuntu on an old HP box (lacking DVD-R support) for a friend. Following GoingBald's instructions, I set up an Ubuntu GNOME* install on 'sdb', which doesn't have an EFI partition, and specified 'sda1', the EFI partition containing Clover, as the location to install GRUB. (For reference, 'sda2' is OS X, and 'sda3' is the Recovery HD. 'sdb1' and 'sdb3' are the Linux root and swap partitions, respectively; there is no 'sdb2'.)

What I got was a warning that /dev/sda1 would be erased, along with of course /dev/sdb. Not wanting to ruin my existing OS X install, I skipped the GRUB installation; later, after the main install was finished on 'sdb', I got a request to install GRUB to the MBR of 'sda', which I went ahead with (thinking that this was appropriate for a Legacy Mode install). Upon rebooting to OS X, I looked in the EFI partition—no GRUB. I went ahead and added a "true" key to /GUI/Scan/Linux in config.plist, just in case GRUB was lurking in the MBR somewhere. No dice.

Rebooted to the install CD, this time in rescue mode, to reinstall GRUB. Again, I specified /dev/sda1 as the install location. This time, I got "FATAL ERROR: Can't install GRUB in specified location".

Is there a way to install GRUB on the EFI for Legacy Mode without (a) disrupting Clover, or (b) requiring me to download the full Ubuntu install DVD (or USB)? All the instructions I see either (a) assume I have a true UEFI machine, and/or (b) assume I also have Windows (and thus access to Windows-based tools), or (c) are out-of-date.

*Ubuntu GNOME is the same as Ubuntu Standard, but using the legacy GNOME environment instead of Unity (which I hate-Unity is for tablets and phones, not the desktop, IMHO).

EDIT: Corrected 'Ubuntu Classic' to 'Ubuntu GNOME'
 
Last edited:
You only need install Grub2 in the OS X EFI if booting UEFI mode. For your installation on Legacy BIOS, install Grub to your root partition ( / ) or create /boot partition and install there.
If on a single drive you would then run GPTSynch to synchronize your partitions in the MBR/PBR - not sure anymore if this is required for separate drives, but would tend to think not. Been too long since I had a legacy OS X and Linux drive in the box at the same time! :lol:
 
You only need install Grub2 in the OS X EFI if booting UEFI mode. For your installation on Legacy BIOS, install Grub to your root partition ( / ) or create /boot partition and install there.

Would this be the root partition of OS X (sda2) or Linux (sdb1)? I'm assuming the latter; IIRC, every [U, Ku, Xu, Lu, Myth]buntu install I've ever done on a BIOS machine (whether alone or with Windows) just installs GRUB in /boot/grub on the root Linux partition. By contrast, the only Linux install I've ever done on a UEFI machine was on my MacBook; there, I don't remember whether GRUB was installed in the EFI or not—Clover didn't exist at that time; I was using rEFIt to dual boot.

If on a single drive you would then run GPTSynch to synchronize your partitions in the MBR/PBR - not sure anymore if this is required for separate drives, but would tend to think not. Been too long since I had a legacy OS X and Linux drive in the box at the same time! :lol:

Is this included with Clover (as it was with rEFIt), or is it a separate utility? If it's in Clover, how is it accessed?
 
Last edited:
Would this be the root partition of OS X (sda2) or Linux (sdb1)? I'm assuming the latter; IIRC, every [U, Ku, Xu, Lu, Myth]buntu install I've ever done on a BIOS machine (whether alone or with Windows) just installs GRUB in /boot/grub on the root Linux partition. By contrast, the only Linux install I've ever done on a UEFI machine was on my MacBook; there, I don't remember whether GRUB was installed in the EFI or not—Clover didn't exist at that time; I was using rEFIt to dual boot.
Correct - on the Linux drive - it needs to be in the root or the boot partition so Clover can see it.

Is this included with Clover (as it was with rEFIt), or is it a separate utility? If it's in Clover, how is it accessed?
GPTSynch is a downloaded app via a terminal command. Download, install and run. Only needed if you have Windows and Linux installed on the same drive I would think - after all, if installed on separate drives why would you want/need to synch the partitions on 2 separate drives/MBRs?
 
After the fourth time reinstalling Ubuntu, I'm about to give up.

Installer (this time, a standard Ubuntu installer on a USB, created with unetbootin) appears to run normally, but then halts on the same error: "FATAL ERROR: Can't install GRUB on specified partition (/dev/sda)" even though I specified another location. If I try to select another device or partition, nothing happens.

Perhaps something wonky has happened to the MBR on /dev/sda? Recall the following, after my first attempt:

Not wanting to ruin my existing OS X install, I skipped the GRUB installation; later, after the main install was finished on 'sdb', I got a request to install GRUB to the MBR of 'sda', which I went ahead with (thinking that this was appropriate for a Legacy Mode install).

Thankfully, Sierra hasn't had any problems! Still, if it's possible, I'd like to get a look at that MBR, just to see if there's something hiding there that shouldn't be. Is there any equivalent to the old Windows FIXMBR command in Mac or Linux?

EDIT: Perhaps I can try running the Linux version of GPTsync in rescue mode...I'm also wiping /dev/sdb in Disk Utility before trying again, just in case.
 
Last edited:
SUCCESS.

The key: Disconnect the Mac HD before installing Linux. Since /etc/fstab now goes by UUID, it doesn't matter to GRUB what the /dev entries are.

I now have a working Ubuntu GNOME install, alongside Sierra, on the second HD I'd used for Sierra beta. It even shows up in Clover. Now I won't need to fire up the old MacBook just to transfer stuff to and from my media box :clap:

Unrelated: Also snagged the latest Adobe Air, so National Geographic works in Sierra now. It's sloooooooooooowwwwww......
 
Was Sierra installed in UEFI? If so, was Ubuntu installed in UEFI?
 
Was Sierra installed in UEFI? If so, was Ubuntu installed in UEFI?

No and therefore not relevant. This is a Legacy BIOS machine, and Sierra (and El Cap and Lion before it) was installed using Clover in Legacy Mode.

When I did the Linux install, I disconnected the Mac HD and did so just as I would for any BIOS-based PC (with or without Windows; typically, Windows would be done first if you wanted both). Once the installation was done I reconnected the Mac HD. Sierra boots with Clover, as usual. Although "Whole Disk Linux" shows up as a boot option in Clover, nothing happens when it is selected; press any key and you're back at the Clover main menu. To boot Linux you have to press F12 before Clover loads to get to the BIOS boot menu, and then select the second (Linux) HD as your boot device.

All of this is a moot point at present. For some reason my Ubuntu GNOME setup appears to be self-destructing: the last time I used it, it gave me multiple "Ubuntu 16.04 has experienced an internal error" messages which resulted in a tangle of authentication prompts, and it refused to update; now login prompt requires multiple attempts, no icons show on desktop, and any attempt to launch any app results in my being kicked out and faced with…the login prompt. I finally gave up and dragged out the old MacBook for that one critical task that eludes my Hackintosh: transferring files to my media box.
 
No and therefore not relevant. This is a Legacy BIOS machine, and Sierra (and El Cap and Lion before it) was installed using Clover in Legacy Mode.

When I did the Linux install, I disconnected the Mac HD and did so just as I would for any BIOS-based PC (with or without Windows; typically, Windows would be done first if you wanted both). Once the installation was done I reconnected the Mac HD. Sierra boots with Clover, as usual. Although "Whole Disk Linux" shows up as a boot option in Clover, nothing happens when it is selected; press any key and you're back at the Clover main menu. To boot Linux you have to press F12 before Clover loads to get to the BIOS boot menu, and then select the second (Linux) HD as your boot device.
To get Linux to boot from Clover on a separate drive in Legacy mode make sure you install Grub to either /boot or to root / and not to the HDD MBR/PBR as it would normally install if you allowed the installer to automatically set up Linux partitions and install for you.
Better to select "Something else" at the install screen and set up tour partition structure manually and select where you want Grub to be installed than to allow the installer automatic control. I prefer to set my own partitions and partition size and I do not think a swap partition is necessary with 16GB or more of RAM in the system.
 
OK…I think I've got it:

1. Format target drive in Disk Utility (or the "sudo diskutil" Terminal command) as legacy MBR/FAT32—do not use GPT.
2. It shouldn't be necessary to disconnect Mac (Windows, Time Machine, etc.) HD(s).
3. Choose "Something Else" when Ubuntu asks where to install.
a. Remove FAT32 partition on targeted HD.
b. Manually set up /, /boot, /home (if desired), and swap (if RAM < 16 GB) partitions. Make a note of which is which (sdb1, sdb2, etc…).
c. Be sure to specify /boot as GRUB install location—not MBR!
4. Ubuntu install should complete normally. Remove installation media when instructed to do so, and reboot.
5. When Clover appears, choose "Linux on Legacy HD1" (Tux icon). Linux should then boot.

After yet another reinstall, everything appears to be working properly, with the exception of Bluetooth ownership quarrels over the Magic Trackpad; it seems that Mac and Linux refuse to share—to use the trackpad requires re-initializing it every time.
 
Status
Not open for further replies.
Back
Top