Macos – How to remove GRUB from Macbook after Debian install

bootdebiangrubmacosmulti-boot

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?

Best Answer

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.

Related Question