You are not logged in.

#1 2013-08-05 20:08:32

youngdm
Member
Registered: 2013-08-02
Posts: 20

[SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

Hello

This is my first Arch post and I feel a bit of a fool for making the error I'm going to describe but here we go....

A couple of weeks ago I installed Arch as dual boot on my Macbook pro 7.1 and I'm generally quite happy with the result.  I boot as EFI using Grub2 having followed instructions to make a standalone boot.efi and boot from the mac's bootloader. The boot.efi file is placed on a small macosx journaled partition that has been made bootable with "bless". I've been able to boot between the two systems using 'alt' at startup or, more generally, just leave the pc to boot into Arch.

When I generated the boot.cfg file I didn't specify ro or rw but grub added ro. So I've had the "root mounted as ro" warning since upgrading to 3.10.3-1 (I don't subscribe to the testing repository) although it was obviously an issue from the start and I was aware of it. After reading some of the forum posts today I thought I'd have a go at changing the boot parameters at startup and edit the boot menu to include rw. This worked and I didn't get the read only warning. I decided to try to generate a new grub.fcg and specify rw before generating a new boot.efi. On inspecting the new boot.cfg I noticed it had both ro and rw entries. I decided to think about what to do (thinking of removing the ro) before making the standalone file.

Anyway, I had to boot into osx for something else but when doing so noticed that I now have 3 efi boot options in the mac bootmanager. Two are grub and one boots osx. I've had a look in the forums and on the internet in general but can't find out how to remove the second entry. My guess is I've installed grub on my Arch /boot partition but can't figure out how to remove it.   

Although I can boot into Arch as normal as the pc defaults to the original grub menu, I'd like to remove the additional entry if possible and would be grateful for any help.

Dylan

Last edited by youngdm (2013-08-06 21:00:37)

Offline

#2 2013-08-05 20:35:43

youngdm
Member
Registered: 2013-08-02
Posts: 20

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

I just thought I'd add the structure of my filesystem. I presume grub has added an entry to the mac EFI vfat partition (sda1) but I'm slightly wary of how I should go about fixing it. The original grub bootloader was installed on sda4 (disk0s4).

Dylan


sda                                                             
├─sda1 vfat    EFI                                 
├─sda2 hfsplus Macintosh   
├─sda3 hfsplus Recovery HD
├─sda4 hfsplus disk0s4   
├─sda5 ext2                      /boot
├─sda6 ext4                      /
└─sda7 ext4                      /home

Offline

#3 2013-08-06 02:31:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

Welcome to Arch's forums.

I'm not very familiar with the process you are describing. Could you link to the instructions in the wiki you followed? I can find information about doing this but I'm not sure if there is Mac-specific information somewhere.

I'm not sure about grub adding an entry to the EFI partition. What you are seeing is the OS X boot menu, correct? So I assume that is based on EFI menu entries as it is on non-Macs but that OS X picks up partitions marked bootable with the bless command to configure the menu rather than relying only or primarily on nvram entries. Is that correct?

Is there a way of undoing it in OS X? Sort of an unbless command?

I'm not sure how grub would have added the entry. Normally grub-install does this but I take it you never used this command and I'm not sure it would do it on a Mac anyway due to the risk of bricking. (grub just uses efibootmgr to create nvram entries as far as I know.)

EDIT: PS: Why do you feel a fool? Unless there's something major you're not telling us... I can't see anything especially foolish in what you did even if it didn't work quite as you hoped. And when all is said and done, much better 2 entries than none at all wink!

EDIT EDIT: Has grub put any files on sda1? And by the way grub-mkconfig will stop adding the ro in a version coming to a cinema near you soon, I believe.

Last edited by cfr (2013-08-06 02:37:37)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2013-08-06 02:44:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

@cfr, This is on Matthew Garretts blog. http://mjg59.dreamwidth.org/7468.html 

@OP, if you still have OSX on your machine, then it is not necessary to create this additional HFS+ partition.  You can simply use the existing OSX partition's /efi directory to boot the machine.  YOu just have to properly "bless" the right thing, which in this case it seems you want to be grub.

Offline

#5 2013-08-06 02:52:47

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

WonderWoofy wrote:

@cfr, This is on Matthew Garretts blog. http://mjg59.dreamwidth.org/7468.html 

@OP, if you still have OSX on your machine, then it is not necessary to create this additional HFS+ partition.  You can simply use the existing OSX partition's /efi directory to boot the machine.  YOu just have to properly "bless" the right thing, which in this case it seems you want to be grub.

My understanding of the description you linked to is that you do require a separate partition to do it this way.

Unless things have changed a very great deal, you bless partitions - not files or whatever. So I don't see how you could bless grub if it is on the systems EFI partition. I thought the idea was to put grub on a separate partition of its own and then bless that partition so that OS X's boot loader picks it up as bootable?

But presumably I'm mistaken because if that were right, I don't see how the second option could show up if it is installed on sda1...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-08-06 03:56:41

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

That link is regarding using Linux on a system that doesn't have OSX on it.  By doing it that way the firmware acts sanely and gives you just one entry in the firmware boot manager instead of two.  So if you have an existing HFS+ partition (whatever it is), you can use that as the partition to hold the things that would normally go in the ESP.

As far as the "bless" command, I am pretty sure you can bless files.  I remember having to bless refit as /efi/refit/refit.efi (or something like that).

Offline

#7 2013-08-06 05:52:18

youngdm
Member
Registered: 2013-08-02
Posts: 20

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

These are the instructions I followed

grub-mkconfig -o boot/grub/grub.cfg grub-mkstandalone -o boot.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg 

Then in osx:

sudo bless --device /dev/disk0s4 --setBoot 

I think that on initial installation I ran the command above as one and then last night ran it as two. Like this:

grub-mkconfig -o boot/grub/grub.cfg 
grub-mkstandalone -o boot.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg 

The instructions were from:

http://codylittlewood.com/arch-linux-on … tallation/

From the apple discussion forums..

This one is a bit more tricky, surely there is another way but this one is simple and not so risky
1- burn a GParted Live CD iso
2- boot on the GParted live CD (press alt on boot and wait for the CD boot option to appear) and choose the first boot entry
3- during the boot process accept every option with its default value
4- in GParted select the EFI partition and somewhere in the menus select the "flags" entry and uncheck "boot"
5- exit GParted Live CD and boot in Mac OS
6- a new volume has appeared "/volumes/efi"
in the finder go to "/volumes/efi/EFI" and delete the "ubuntu" folder
7- repeat steps 2/3 and step 4 but check "boot" instead of unchecking it
8- exit GParted live CD and reboot


I have found the instructions above on the apple discussion forums but as noted above I'm a little wary about following them. I guess though that I need to remove the entry in the mac EFI partition which is hidden in osx but shows as sda1 in Arch.
Do you think I could mount sda1 in Arch and have a look at what's on there? From the instructions above it looks like there should be a directory  for Arch that could be deleted. I presume that Arch is booting from the blessed partition on sda4. Is this correct?

Last edited by youngdm (2013-08-06 11:46:09)

Offline

#8 2013-08-06 09:27:03

youngdm
Member
Registered: 2013-08-02
Posts: 20

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

Cymru

I felt a bit daft because I realised I could have just edited the original grub.cfg to add rw and remove ro and then make the standalone boot.efi. Ho hum.

Offline

#9 2013-08-06 20:59:17

youngdm
Member
Registered: 2013-08-02
Posts: 20

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

I think I've fixed it. I mounted sda1 and there was an EFI directory and a boot.efi file. The boot.efi file had a date of yesterday so I moved the file to a directory in my home partition and rebooted whilst holding alt. I now have the two wanted entries in the mac bootmanager.

So when I update my grub config and create another standalone file I need to make sure it goes where I want. Interestingly the boot.efi file in "/" has the same creation date as the one on the mac boot partition. So it seems two copies were made... ? I've booted into OSX and all seems to work ok there as well (thankfully).

Offline

#10 2013-08-06 22:06:32

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Two Grub boot menus on Macbook pro 7.1 efi boot

WonderWoofy wrote:

That link is regarding using Linux on a system that doesn't have OSX on it.  By doing it that way the firmware acts sanely and gives you just one entry in the firmware boot manager instead of two.  So if you have an existing HFS+ partition (whatever it is), you can use that as the partition to hold the things that would normally go in the ESP.

Ah, fair enough - that wasn't clear to me.

As far as the "bless" command, I am pretty sure you can bless files.  I remember having to bless refit as /efi/refit/refit.efi (or something like that).

Interesting. I guess it makes sense as an extension for EFI systems, now I think about it.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB