How do I remove GRUB from Macbook after Debian install?

9,965

Solution 1

That is a good question. I had that same question a few years back and have a simple answer. I just tested this solution as I have about the same setup although I run El Capitan and Fedora. Personally I prefer the way you have it now so I come from the same starting point. This solution for your question additionally worked with Maveriks when I first tried it.

Simplifying the question by taking out the answer:

1)The question itself seems to include an incorrect answer or is a 2 part question. Permit me to strip down your question by removing 3 words:

"How can I remove GRUB and go back to the default boot loader, preferably while still being able to boot Debian?"

to:

"How can I go back to the default boot loader, preferably while still being able to boot Debian?"

2) If, by "remove", you mean to "erase" grub, that will be a problem for booting Debian.

3) If you want to hide that partition so as to not see it in the finder, I have had success simply by using the fstab file. That is a completely different question so I won't get into that.

That should cover the bases about "remove grub and".

Now to tackle the core question.


Question:

How can I go back to the default boot loader, preferably while still being able to boot Debian?

Answer:

(tested with multiple re-boots):

  1. Log in as administrator ( I tested this using the actual administrator account because the credential requests were numerous. Normally I run a user account).

  2. Open "Startup Disks"

    ( Menu: apple logo -> System Preferences -> Startup Disks)

  3. Unlock the lock.

  4. Make sure your OSX system disk is selected.

    (Do not put the disk in "target mode")

  5. Lock the lock.
  6. Press the restart button on the Startup disks screen.
Note: Even if it might appear that this was already the setting before you opened the window, go through the motions anyways to "remind" OSX.

Result:

  • From this moment on, the computer automatically boots OS X. From your perspective it will like like how it was before installing Debian.

  • If you want to use Debian, then you can press the option key exactly like how you are doing now and Grub will load Debian.

  • This is a "permanent" and non-destructive answer. You do not have to repeat the process. If you use Debian, you do not have to go back to the startup disk section of OS X and redo the previous steps.

Solution 2

Quoting from the Ask Ubuntu Forums:

Run Disk Utility and click on your internal hard disk (the disk itself, not the partition under it). Then click on the Partition tab. If you move the triangular slider that adjusts the partition up and then back to where it was, the "Apply" button becomes active (it starts greyed out). You can now click "Apply," and the partition will be left alone, but the bootloader will be recreated. Aaditya Bagga Link

Share:
9,965

Related videos on Youtube

oarfish
Author by

oarfish

Updated on September 18, 2022

Comments

  • oarfish
    oarfish almost 2 years

    I made a partition on my secondary hard drive and installed Debian to it. As outlined in the docs, this makes GRUB the default boot loader. Since I don't really use the Debian install, I'd like to get rid of GRUB so as to not always having to boot OSX by pressing the key. How can I remove GRUB and go back to the default boot loader, preferably while still being able to boot Debian?

    My disk and partition layout is like this (SSD and Macintosh HD partitions are encrypted)

    enter image description here

    enter image description here

    disk1s4 is where Debian resides, disk1s5 is swap. Since both volumes are Core Storage, I cannot apply the tip to resize the partition to remove GRUB. I converted to Core Storage before installing Debian so there should be a way to remove GRUB without decrypting both encrypted partitions.

    P.S.: I have rEFInd installed on a bootable stick which I previously used to boot my Linuces which I had before Debian. Will this just work if I remove GRUB?

    • Harvey
      Harvey about 8 years
      Do you want to remove rEFIt?
    • oarfish
      oarfish about 8 years
      @Harvey I don't have rEFIt installed, only rEFInd on a stick.
  • oarfish
    oarfish about 8 years
    There is no triangular slider in the partition panel. Strangely I can't edit the partitions at all, since everything is greyed out. I wonder how that happened. Probably result of encrypting partition on the second disk.
  • oarfish
    oarfish about 8 years
    Ok, that was easy. But it appears GRUB is gone, as I cannot simply boot to linux by pressing alt at startup. I still need my rEFInd usb, but that's fine with me.
  • BloodyEl
    BloodyEl about 8 years
    That would get rid of refind and grub is only used when Debian is needed. Or you could remove grub and use refind like right now. I mis-understood you had installed according to the documentation without refind. Here is the quote, the key thing is that "If" at the beginning: (next comment).
  • BloodyEl
    BloodyEl about 8 years
    QUOTE: If you will use rEFInd as rEFInd for boot management, disable the GRUB boot manager which Debian configured by resetting the computer's NVRAM (hold Command, Option, P and R when turning on the computer). The Linux kernel doesn't require a separate boot loader since version 3.3, so you can also remove the GRUB boot loader from the EFI partition. To install rEFInd, download the latest stable version on the SourceForge project page onto your Macintosh HD.
  • BloodyEl
    BloodyEl about 8 years
    Personally I have been running dual-boot linux and mac on mac hardware since before kernel 3.3 without 3rd party software like refind. You would only really need that in the last few years if you were virtualizing OSX with KVM on Debian for instance. Not for dual-boot. I don't know about non-mac hardware, but I have a macbook and mac mini I've done alot of installs on...
  • oarfish
    oarfish about 8 years
    But I don't have rEFInd installed on any disk.
  • BloodyEl
    BloodyEl about 8 years
    1) either grub is not on your system disk at all. That should not be the case because it was working earlier. It should not be erased. 2) OSX needs to know about grub. That would be something called "blessing" the drive. Systemsetup is a more modern version: krypted.com/mac-security/…. Once again a Rod Smith (refind maintainer) link using "bless". Read : Macintosh Note Mac OS X uses a program called bless to add options to the boot menu.rodsbooks.com/efi-bootloaders/installation.html#registe‌​r
  • BloodyEl
    BloodyEl about 8 years
    Something likely got mixed up along the way with the installs. Normally this should not happen. One possible reason is if you installed Linux in Bios mode. This site on ubuntu.com is a goldmine of info for managing booting on mac hardware, including getting OSX to boot through Grub. What you want is under the section, choosing the "safe apple" boot: ** Apple Mac EFI systems (both EFI architecture) For Macs you can choose any one of the 3 boot methods : rEFIt/rEFInd, Apple, and grub-only. ** help.ubuntu.com/community/UEFIBooting.
  • BloodyEl
    BloodyEl about 8 years
    At the end of the day, I think you are booting using bios. You can check by seeing if you have this directory: /sys/firmware/efi askubuntu.com/questions/162564/…
  • BloodyEl
    BloodyEl about 8 years
    I erased some comments to clarify my answer.
  • BloodyEl
    BloodyEl about 8 years
    In the links I gave you it also describes how to get rid of grub and boot directly from the kernel. That would imply setting up the kernel and properly blessing the ESP on the MAC side. I would try fixing grub before attempting replacing grub with a direct linux boot. I learned a few things myself with this final twist in the question.