0

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?

2
  • Do you want to remove rEFIt?
    – Harvey
    May 25 '16 at 11:49
  • @Harvey I don't have rEFIt installed, only rEFInd on a stick.
    – oarfish
    May 25 '16 at 13:36
6
+50

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.

10
  • 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.
    – oarfish
    May 30 '16 at 10:39
  • 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
    May 30 '16 at 14:07
  • 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
    May 30 '16 at 14:08
  • 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...
    – BloodyEl
    May 30 '16 at 14:19
  • But I don't have rEFInd installed on any disk.
    – oarfish
    May 30 '16 at 17:02
1

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

1
  • 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
    May 25 '16 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.