Score:-1

How to bless boot partition for Ubuntu 22.04 on 2009 MacBook Pro

ng flag

I have performed a full-disk install of Ubuntu 22.04 on an old MacBook Pro (MacBookPro5,2 from 2009, Core 2 Duo) machine completely wiping OS X in the process.

I'm now facing the known issue of the 30-second white screen delay on boot. I already figured out I have to use the OS X bless command to set Ubuntu as the boot partition. My question is what command-line arguments do I have to pass exactly? All examples on the internet make use of the --legacy option and talk about BIOS mode, but from what I could figure out my Ubuntu installation is using EFI (the /sys/firmware/efi directory exists).

Am I right in assuming then that I shouldn't use the --legacy option when blessing the partition? Also which partition do I have to bless? The /dev/sda1 one?

Here's the output of df -h when run in Ubuntu:

t30@macbook:~$ df -h
tmpfs           770M    1,7M  768M    1% /run
/dev/sda2       457G     12G  423G    3% /
tmpfs           3,8G       0  3,8G    0% /dev/shm
tmpfs           5,0M    4,0K  5,0M    1% /run/lock
/dev/sda1       511M    6,1M  505M    2% /boot/efi
tmpfs           770M     52K  770M    1% /run/user/1000

So would I just invoke bless like this (replacing /dev/sda1 with whatever it's mounted as under bless)?

bless --device /dev/sda1 --setBoot

So after trying out different variations, here are the results:

bless --device /dev/disk0s1 --setBoot doesn't appear to do anything. Still long timeout on white screen. System still booting afterwards.

bless --device /dev/disk0s2 --setBoot same as above.

bless --device /dev/disk0s1 --setBoot --legacy still long timeout on white screen. After that system goes to black screen and won't boot into Ubuntu.

There are only /dev/disk0s1 and /dev/disk0s2 listed in fdisk for /dev/disk0. I'm assuming /dev/disk0s1 is /boot/efi, but I have no idea.

David avatar
cn flag
Bless must have something to do with Mac? If so it is a Mac question and not for this site.
user3700562 avatar
ng flag
The apple people point me here though saying it's a linux problem, so it's an unaskable question?
David avatar
cn flag
You tried the Mac site of Stack Exchange?
karel avatar
sa flag
I rule this question as on topic.
Score:1
us flag

tl;dr: One possible command would be bless --folder /Volumes/EFI --file /Volumes/EFI/EFI/ubuntu/grubx64.efi --setBoot.

Since the question also involves boot times, I have included the boot times and specs on my Mac. I would expect the OP's Mac to be slower than my Mac.

My Mac has the following specs:

  • iMac (21.5-inch, Mid 2011)
  • 2.5 GHz Intel Core i5
  • 16 GB 1333 MHz DDR3
  • 1 TB SATA II (3 Gb/s) internal HDD

The table below shows the operating systems currently installed on my Mac.

Operating System Version Architecture Boot Method Location
Windows 11 Pro 22H2 AMD64 BIOS Internal HDD
macOS High Sierra 10.13.6 AMD64 EFI Internal HDD
Ubuntu 22.04.1 LTS AMD64 EFI Internal HDD

I took the following steps to test using the bless command to set Ubuntu as the default operating system to boot.

  1. Started the Mac and held down the option key until the Mac Startup Manager icons appeared.
  2. Choose to boot from the macOS High Sierra Recovery volume on the internal drive.
  3. Mounted the only EFI volume (/dev/disk0s1) on /Volumes/EFI.
  4. Entered the following command in a Terminal window.
    bless --folder /Volumes/EFI --file /Volumes/EFI/EFI/ubuntu/grubx64.efi --setBoot
    
  5. Restarted the Mac, which booted GRUB, then Ubuntu.

†This is the command the OP posted in a comment.

Table of Boot Timing is shown below. Here, GRUB is configured to wait 10 seconds and Ubuntu has automatic login turned on.

Event Duration Total Time
Between power on and start of white screen 6.75 6.75
White screen is visible 8.74 15.50
Between end of white screen and Desktop appearing 1:35.65 1:51.16

Below is the contents of the current /etc/default/grub file on my Mac.

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_TERMINAL=console
GRUB_DISABLE_OS_PROBER=true
Organic Marble avatar
us flag
Can you add a tl;dr? Are you saying there is actually not a problem?
David Anderson avatar
us flag
@OrganicMarble: I added a tl;dr. I assume the OP's problem is real. However, previous posts here at [Ask Ubuntu](https://askubuntu.com/questions/1284399/how-can-i-stop-ubuntu-taking-over-as-default-os-on-mac-or-at-least-reset-macos) and over at [Ask Different](https://apple.stackexchange.com/questions/394643/wierd-problem-after-doing-a-triple-boot-os-x-ubuntu-20-04-kali-linux) involve trying to get Mac to do the opposite of what the OP is asking for.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.