1

I am using a Macbook Pro 6.2. I installed Ubuntu 12.04 and it was working fine. I Re-sized my partitions (to make more space for Linux) and of course messed up GRUB. This is fine. I corrected the issue, but only after much trial and error. Because the Mac has efi the installer tried to install grub-efi, which is did fine, but I needed grub-pc (the mac MUST boot in BIOS mode for X to work correctly).

All tihs trial and error left me with multiple installs of GRUB on several partitions and the MBR. My current setup is:

/dev/sda - GRUB /dev/sda1 - (efi partition for OS X) GURB /dev/sda2 - Mac OS X /dev/sda3 - GRUB (also Linux partition)

I need to remove GRUB from /dev/sda, /dev/sda1, and leave it on /dev/sda3.

I use ReFIT. How can I safely remove the extra installs of grub without harming the install of OS X, refit, or grub on /dev/sda3

1
  • If the issue is removing the GRUB entry from the rEFIt boot menu (for you other users that find this question), an easy, safe fix for removing the GRUB entry... Boot OSX and in the terminal write: mkdir ~/Desktop/mnt; sudo mount -t msdos /dev/disk0s1 ~/Desktop/mnt. A new drive will appear; open it and the EFI folder inside, then delete the UBUNTU (or "ubuntu") folder inside.
    – Arthur
    Jan 7, 2014 at 21:27

1 Answer 1

2

Are you seeing multiple Linux icons in rEFIt? If not, I'd just leave it alone, since the extra boot code is doing no harm. If you are seeing extra Linux icons, though, you should first check that none of them refers to an EFI boot loader that you're not using. (Check the description that rEFIt shows when you highlight an entry; EFI boot loaders normally show a path to the boot loader, like EFI/ubuntu/grubx64.efi.) A stray EFI boot loader would be the easiest to remove, since it's just a file on the disk (probably on /dev/sda1, your ESP).

If you're sure you've got extra BIOS/legacy boot loaders showing in rEFIt, you can remove the unnecessary code by using dd, as in:

sudo dd if=/dev/zero of=/dev/sda2 bs=512 count=1

The details vary depending on what you want to wipe, though. Applied to the MBR (/dev/sda), you'd set bs=440 rather than bs=512, so as to erase just 440 bytes rather than 512 bytes.

This procedure is VERY DANGEROUS. A mistake can make a partition, or even your whole hard disk, inaccessible. Thus, you should be very sure that you're wiping out the correct data. You haven't presented sufficient evidence for me to be confident enough to recommend wiping any specific location. If you want more advice, post a link to the RESULTS.txt file produced by running Boot Info Script. That will produce detailed partitioning information and data on what boot loader(s) you have installed.

One more comment: If you determined that your Mac needs to boot in BIOS mode to get an X display prior to installing Ubuntu 12.04, you may want to re-examine the issue. Such problems tend to get ironed out over time, so Ubuntu 12.04 (or 12.10, should you care to upgrade again) may be better on this score than whatever you've tried in the past. Booting in EFI mode will enable you to eliminate the flaky hybrid MBR that you're presumably using now.

5
  • Is there any way to get linux on /dev/sda3 to be the default in refit? I might just leave it alone.
    – coteyr
    Nov 17, 2012 at 0:57
  • dl.dropbox.com/u/18875117/results.txt I don't mind dd-ing if I'm sure it's not going to bork anything. I wouldn't mind just setting refit to default boot /dev/sda3. The problem now is that it's booting /dev/sda by default and that just doesn't work.
    – coteyr
    Nov 17, 2012 at 1:08
  • Going to use your advise and just leave wel enough alone. I was able to set the default boot option in refit by following these basic instructions. The location was different for me. The config file was /efi/refit/, but the instructions worked all the same. That has solved the problem of a non-booting-by-default system. While your fix would work, it just doesn't seem worth the risk. However it is correct.
    – coteyr
    Nov 17, 2012 at 10:11
  • I'm glad you've gotten it working to your satisfaction. For future reference, rEFIt seems to have been abandoned, so I've forked it at rEFInd (rodsbooks.com/refind). Among other things, it provides much more flexible options for setting the default boot entry.
    – Rod Smith
    Nov 17, 2012 at 20:11
  • I tried EFI mode in 12.10. It confuses the snot out of Nvidia graphics drivers. I look forward to using EFI mode when it gets fixed though. It seems much simpler for me (as you say no need to maintain a GPT and MBR, which was the source of much confusion).
    – coteyr
    Nov 17, 2012 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .