rEFInd & Grub, MacBook triple-boot

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help

rEFInd & Grub, MacBook triple-boot

Postby msheaver on Wed May 08, 2013 5:50 pm

I have a mid 2012 MacBook Pro Retina, and my goal is to have a clean triple-boot system of Mac, Linux Mint (Cinnamon) and Windows 8. I have succeeded in installing both Linux Mint and Windows 8; my challenge is getting the rEFInd bootloader screen to behave nicely. When I select Mac, it boots normally, but when I select either Linux or Windows, it goes into the Grub bootloader menu - something I do not want to see. I wrote to the developer of rEFInd, he said that this is coming from the Grub bootloader installed by Mint. I tried to remove and reinstall Mint, but did not find any option to NOT install Grub during the install process. So, my question for this forum is: What is the best way of handling this? I have found numerous suggestions, including:
1) Have rEFInd ignore the root folder by editing the refind.conf file
2) Uninstall Grub
3) Use Grub instead of rEFInd (not an option for me)

Does anyone have any tried and tested solution to this?

One more thing: after I removed and reinstalled Mint, now it just gives me the blinking cursor when I select Linux.
msheaver
Level 1
Level 1
 
Posts: 6
Joined: Sun Apr 21, 2013 1:25 pm

Linux Mint is funded by ads and donations.
 

Re: rEFInd & Grub, MacBook triple-boot

Postby srs5694 on Wed May 08, 2013 6:19 pm

Please run the Boot Info Script and post the RESULTS.txt file that it produces, either as a link or within code tags. That will answer some critical questions and may provide a way to give you a solution.
srs5694
Level 6
Level 6
 
Posts: 1020
Joined: Mon Feb 27, 2012 1:42 pm

Re: rEFInd & Grub, MacBook triple-boot

Postby msheaver on Wed May 08, 2013 9:12 pm

I have hit a problem with the Mint install (blinking cursor) and will need to reinstall tomorrow. I'll get back with the info once it is back.
msheaver
Level 1
Level 1
 
Posts: 6
Joined: Sun Apr 21, 2013 1:25 pm

Re: rEFInd & Grub, MacBook triple-boot

Postby msheaver on Fri May 10, 2013 9:11 pm

I was finally able get it to boot into Mint by reinstalling the latest version of rEFInd (0.6.10); the results of the boot info script are shown here. Note that the Windows partition is not showing up because I removed it in my troubleshooting efforts. Interesting thing is that it is now booting into Mint correctly, but the rEFInd menu is incorrectly showing an additional Linux bootloader.
Code: Select all
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
    848238704 of the same hard drive for core.img, but core.img can not be
    found at this location.
 => Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Unknown
    Boot sector info:  According to the info in the boot sector, sda1 starts
                       at sector 0. But according to the info from fdisk,
                       sda1 starts at sector 40.
    Operating System: 
    Boot files:        /efi/linuxmint/grubx64.efi

sda2: __________________________________________________________________________

    File system:       hfsplus
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:       

sda3: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:

sda4: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Linux Mint 14 Nadia
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sdb1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Unknown
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 500.3 GB, 500277790720 bytes
255 heads, 63 sectors/track, 60821 cylinders, total 977105060 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1                   1       409,639       409,639  ee GPT
/dev/sda2    *        409,640   879,186,623   878,776,984  af HFS / HFS+
/dev/sda3         879,450,112   910,700,111    31,250,000  82 Linux swap / Solaris
/dev/sda4         910,700,112   977,104,408    66,404,297  83 Linux


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sda1              40       409,639       409,600 EFI System partition
/dev/sda2         409,640   879,186,623   878,776,984 Hierarchical File System Plus (HFS+) partition (Mac OS X)
/dev/sda3     879,450,112   910,700,111    31,250,000 Swap partition (Linux)
/dev/sda4     910,700,112   977,104,408    66,404,297 Data partition (Windows/Linux)

Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 16.0 GB, 16008609792 bytes
255 heads, 63 sectors/track, 1946 cylinders, total 31266816 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1                   2    31,266,815    31,266,814   b W95 FAT32


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        67E3-17ED                              vfat       EFI
/dev/sda2        1d22bded-eed4-3839-bd4e-53204213307f   hfsplus    Macintosh HD
/dev/sda3        db0e6c0f-3b4a-4967-9f3e-60067a9ba30e   swap       
/dev/sda4        9cddd13e-49ce-4c61-a984-22760b7cb996   ext4       
/dev/sdb1        507B-1C0E                              vfat       MICHAEL

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda1        /boot/efi                vfat       (rw)
/dev/sda4        /                        ext4       (rw,errors=remount-ro)
/dev/sdb1        /media/michael/MICHAEL   vfat       (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)


=========================== sda4/boot/grub/grub.cfg: ===========================

msheaver
Level 1
Level 1
 
Posts: 6
Joined: Sun Apr 21, 2013 1:25 pm

Re: rEFInd & Grub, MacBook triple-boot

Postby srs5694 on Fri May 10, 2013 10:46 pm

The "extra Linux bootloader" may not be shown incorrectly. There are at least three possibilities for Linux boot loaders shown by rEFInd:

  • A BIOS-mode GRUB. There's definitely one in the MBR of the disk, and there may be one in your Linux partition (/dev/sda4). This will show up in rEFInd as "Boot Linux from HD", if I recall the terminology it uses correctly. This method of booting, if it works now, is prone to fail as you adjust the system to boot Windows, so you shouldn't rely on it.
  • An EFI-mode GRUB. This is definitely installed on your EFI System Partition (ESP; /dev/sda1) as EFI/linuxmint/grubx64.efi. This will show up in rEFInd as "Boot EFI\linuxmint\grubx64.efi from {volume name or description}". I suspect that this boot method is working for you now, but I'm not positive of that.
  • A Linux kernel. You've presumably got one of these installed in /dev/sda4, although the Boot Info Script output isn't showing it for some reason. This will show up in rEFInd as "Boot boot\vmlinuz-{version} from {volume name or description}". It probably won't work unless you enter kernel options manually, at least not yet. It's conceivable you'll have two or more of these, one for each kernel installed.

Before proceeding, I recommend you get the last of these working; or failing that, get the EFI-mode GRUB working. If you don't currently see an entry for a Linux kernel, you'll need to install an ext4fs driver for EFI. To do this, you must create an /EFI/refind/drivers directory in OS X (assuming rEFInd is installed in /EFI/refind) and copy the ext4_x64.efi file from the rEFInd .zip file to that directory. You should then reboot into Linux in any way that works (even BIOS-mode GRUB, if that's the only way that's working) and run the mkrlconf.sh script that comes in the rEFInd .zip file. You'll need to run it as root or using sudo. Thereafter, you should see the entry to directly boot the Linux kernel when you reboot into rEFInd. Test that this kernel entry works.

Once that's done, you can move on to installing Windows. (Don't worry about the extra rEFInd entries just yet.) You'll need to:

  1. Resize your partition(s) to make room for a Windows partition.
  2. Create a FAT or NTFS partition for Windows.
  3. Create a new hybrid MBR. This can be tricky. The easiest way to do it is if you use OS X's Disk Utility to create your Windows partition (as FAT); however, that method may not be reliable or may produce something that's sub-optimal. The most flexible way to create a hybrid MBR is to use gdisk, as described in the link at the start of this bullet point. However you do it, be sure that your Windows partition resides in the hybrid MBR. Neither the Linux nor the OS X partitions need to be in it, although including them won't hurt. If you shrink the OS X partition to make room for Windows and use gdisk to create the new hybrid MBR, I recommend including the Windows partition and both the Linux swap and Linux root (/) partitions in the hybrid MBR.
  4. Install Windows normally.

At this point, if everything goes well, you should see a Windows option appear in rEFInd. This option may replace one of the Linux options or it may add to the set. Test that you can boot OS X, Windows, and Linux.

If it's all working, you can now start trimming your Linux options. If both a vmlinuz-* option and the grubx64.efi option are working, you can remove one of them. Uninstalling the grub-efi package, and perhaps manually removing the /boot/efi/EFI/linuxmint/grubx64.efi file (from Linux), is one way to get rid of the grubx64.efi option. A less radical method is to add "EFI/linuxmint" to the "dont_scan_dirs" option in refind.conf. If you want to boot Linux via GRUB rather than directly, you can uninstall the ext4fs driver that I told you to install earlier; or you can comment out the "scan_all_linux_kernels" option in refind.conf.

If you're still seeing an option to boot Linux via a BIOS-mode boot loader, the safest approach is to simply ignore it, whether or not the option works. Removing it requires guessing where the BIOS-mode boot code resides and wiping it out via "dd", which is both guesswork and risky. It can be done if you're determined to do so, though; post back if you need advice.

You can customize rEFInd's icons in various ways. See the bulleted list under "Hiding and Displaying EFI Boot Loaders" for details. If you want to give a Linux Mint icon to a kernel-boot option, the easiest way is likely to be to use tune2fs to give your Mint partition a label that includes "linuxmint" as a single word:

Code: Select all
sudo tune2fs -L linuxmint /dev/sda4


(Note that the device filename may well change if you do this after repartitioning for Windows, though.)
srs5694
Level 6
Level 6
 
Posts: 1020
Joined: Mon Feb 27, 2012 1:42 pm


Return to Installation & Boot

Who is online

Users browsing this forum: jimallyn and 19 guests