Imac 2006 Boot From Usb

broken image


A friend recently gave me his old Apple iMac (Late 2006) after it began having graphics issues. Before freecycling it, I wanted to try to boot Linux on it, just for kicks. That turned out to be harder than I imagined it would be…

There were two main problems:

  1. Some Macs of this era had only 32-bit EFI bootloaders; and
  2. Many Linux distributions are only designed to do 64-bit UEFI boot.
This page describes how I overcame these obstacles. It assumes you are using a Mac to prepare the USB device, but the instructions can easily be adapted for other situations.

D: Start up to the Apple Diagnostics utility. Or use Option-D to start up to this utility over the Internet. Disabled when using a firmware password. N: Start up from a NetBoot server, if your Mac supports network startup volumes. To use the default boot image on the server, hold down Option-N instead. Disabled when using a firmware password. External Boot feature is the one that controls whether your Mac can boot from an external hard drive, thumb drive, USB drive, CD, DVD or other external media. When your MacBook Pro refuses to boot from internal hard drive, you can set it to allow external boot by selecting 'Allow booting from external media' in Startup Security Utility.

If you want to skip the backstory, jump directly to Booting Linux.

Table of contents:

Booting memtest86

The first thing I wanted to try was memtest86. I downloaded the memtest86 bootable USB image, then used diskutil to find and prepare my USB stick, and dd to copy the memtest86 image to my USB device:

Holding down Option while booting brought up the Startup Manager, which allowed me to select EFI Boot. Worked perfectly! (No memory errors, by the way. ;-)

In fact, there were two EFI Boot entries, which both worked – more on that later.

Examining the memtest86 image

Unlike many of the Linux distribution images, which come as ISO files, memtest86 came already designed for USB booting. Here are some of its properties, information which would later be useful.

Checking the image file itself, notice that it's actually a hard drive image:

At first its partition layout looked pretty odd to me: I did some reading, and discovered that partition type EE is known as a protective MBR, used when the drive is partitioned using the newer GUID Partition Table (GPT) standard.

New browser download for pc. The GPT layout looks like:

The GUIDs have some meaning, which is:
GUIDPurpose
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7Basic data partition
Used for storing the majority of data on the device
C12A7328-F81F-11D2-BA4B-00A0C93EC93BEFI System partition
Contains EFI bootloaders, etc

By default, only the data partition is mounted, but one can mount the EFI System partition also:

Here is a listing of the EFI directory from the data partition:

And here is a listing of the EFI directory from the EFI System partition:

Originally I thought that the two EFI Boot entries were explained by having both BOOTIA32.efi and BOOTX64.efi, but now I know that it is caused by having the EFI bootloader in both partitions.

Summary

For this particular image, we have:

  • a protective MBR, within which is
  • a GUID Partition Table, which has two partitions:
    1. a data partition; and
    2. an EFI System partition
  • within each partition is a directory /EFI/BOOT containing EFI bootloaders named
    • BOOTIA32.efi (for 32-bit EFI); and
    • BOOTX64.efi (64-bit EFI).

32-bit vs 64-bit EFI

One of the first things I checked on this Mac was whether it had a 32-bit or 64-bit processor. The processor is an Intel® Core™2 Duo Processor T7400 which, according to ARK, is 64-bit. So I mistakenly thought that the EFI would be 64-bit, too. Wrong!

EveryMac.com has an excellent list of machines and which processor and EFI they support. There I found that this Mac had a 32-bit EFI.

Another way to find this information is with a command: https://trueufiles775.weebly.com/clicking-op-auto-clicker-2-1.html.

Note that you can boot a 64-bit kernel from a 32-bit EFI, provided that the bootloader and kernel support it.

Booting Linux

General procedure

The goal is to get a USB stick with:

  1. a writeable data partition (so we can, eg, make changes to the grub.cfg file); and
  2. a 32-bit EFI bootloader in /EFI/BOOT/BOOTIA32.efi
Most Linux distributions don't seem to ship a 32-bit EFI bootloader, but Debian does, so we can just rip it out of there.

What doesn't work: dding the hybrid ISO directly

Imac early 2006 boot from usb

Your initial thought might be to use dd to write a hybrid ISO (as most Linux distributions come these days) directly to the USB stick, just as you'd do for a PC. That's going to fail.

The Ubuntu 15.10 (amd64) ISO looks like this:While you could theoretically modify the EFI System partition, there really isn't enough space on there to put everything. The data partition is ISO9660 format, which some systems might let you mount read-write, but I couldn't see how in OS X.

Using UNetbootin

By using UNetbootin, one can prepare the USB key for editing. I won't go into the operation of UNetbootin since I think it's fairly self-explanatory. (One tip, though: erase the disk in Disk Utility first.)

The new USB disk looks like:

Adding 32-bit GRUB EFI

Now that you have a read-write partition, you can add the 32-bit GRUB EFI bootloader. I took the one from the Debian netinst ('network install') CD image. From that image, you need:

  • efi/boot/bootia32.efi
  • boot/grub/i386-efi/*
which, conveniently, need to be placed in the exact same location on your USB device. I used 7-Zip to extract the contents from the ISO, but you could use any program you find convenient.

Here are the commands I used:

And that's it! You now have a USB device that will boot on a Mac with 32-bit EFI.

Odds & sods

There are a couple of quirks I found (not related to EFI booting) which I thought I'd include here for reference.

Video modes

I found it was necessary to edit boot/grub/grub.cfg to include the kernel option nomodeset to prevent the console video from being trashed. I changed the original:

Boot Imac 2006 From Usb

linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash ---
to:

2009 Imac Boot From Usb

linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper nomodeset ---

You may find a slightly different command necessary depending on your hardware and kernel release. digium has a good article on their site for this: How to disable the Linux frame buffer if it's causing problems.

Console-only boots

For somewhat murky reasons, many distributions have switched over to the confusing systemd. On these systems (eg Ubuntu), the text kernel option no longer does what it's supposed to. (One would think the systemd folks could've made it work but I guess they chose not to.)

Imac Early 2006 Boot From Usb

Anyhow, there is a (much longer and less obvious) option which does work. Add systemd.unit=multi-user.target to your kernel parameters, eg:

linux /casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper nomodeset systemd.unit=multi-user.target ---

Typically I'll have a graphical entry and a text entry so I can decide at boot time without having to remember that particular incantation.

References

These advanced steps are primarily for system administrators and others who are familiar with the command line. You don't need a bootable installer to upgrade macOS or reinstall macOS, but it can be useful when you want to install on multiple computers without downloading the installer each time. Google chrome download for pc windows 7 64 bit free.

What you need to create a bootable installer

  • A USB flash drive or other secondary volume, formatted as Mac OS Extended, with at least 12GB of available storage
  • A downloaded installer for macOS Big Sur, Catalina, Mojave, High Sierra, or El Capitan

Download macOS

  • Download: macOS Big Sur, macOS Catalina, macOS Mojave, or macOS High Sierra
    These download to your Applications folder as an app named Install macOS [version name]. If the installer opens after downloading, quit it without continuing installation. To get the correct installer, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. Enterprise administrators, please download from Apple, not a locally hosted software-update server.
  • Download: OS X El Capitan
    This downloads as a disk image named InstallMacOSX.dmg. On a Mac that is compatible with El Capitan, open the disk image and run the installer within, named InstallMacOSX.pkg. It installs an app named Install OS X El Capitan into your Applications folder. You will create the bootable installer from this app, not from the disk image or .pkg installer.

Use the 'createinstallmedia' command in Terminal

  1. Connect the USB flash drive or other volume that you're using for the bootable installer.
  2. Open Terminal, which is in the Utilities folder of your Applications folder.
  3. Type or paste one of the following commands in Terminal. These assume that the installer is in your Applications folder, and MyVolume is the name of the USB flash drive or other volume you're using. If it has a different name, replace MyVolume in these commands with the name of your volume.

Big Sur:*

Marginnote 3 5 90 degree. Catalina:*

Mojave:* Hey google download minecraft.

High Sierra:*

El Capitan:

* If your Mac is using macOS Sierra or earlier, include the --applicationpath argument and installer path, similar to the way this is done in the command for El Capitan.


After typing the command:

  1. Press Return to enter the command.
  2. When prompted, type your administrator password and press Return again. Terminal doesn't show any characters as you type your password.
  3. When prompted, type Y to confirm that you want to erase the volume, then press Return. Terminal shows the progress as the volume is erased.
  4. After the volume is erased, you may see an alert that Terminal would like to access files on a removable volume. Click OK to allow the copy to proceed.
  5. When Terminal says that it's done, the volume will have the same name as the installer you downloaded, such as Install macOS Big Sur. You can now quit Terminal and eject the volume.

Use the bootable installer

Determine whether you're using a Mac with Apple silicon, then follow the appropriate steps:

Apple silicon

  1. Plug the bootable installer into a Mac that is connected to the internet and compatible with the version of macOS you're installing.
  2. Turn on your Mac and continue to hold the power button until you see the startup options window, which shows your bootable volumes and a gear icon labled Options.
  3. Select the volume containing the bootable installer, then click Continue.
  4. When the macOS installer opens, follow the onscreen instructions.

Intel processor

  1. Plug the bootable installer into a Mac that is connected to the internet and compatible with the version of macOS you're installing.
  2. Press and hold the Option (Alt) ⌥ key immediately after turning on or restarting your Mac.
  3. Release the Option key when you see a dark screen showing your bootable volumes.
  4. Select the volume containing the bootable installer. Then click the up arrow or press Return.
    If you can't start up from the bootable installer, make sure that the External Boot setting in Startup Security Utility is set to allow booting from external media.
  5. Choose your language, if prompted.
  6. Select Install macOS (or Install OS X) from the Utilities window, then click Continue and follow the onscreen instructions.

Learn more

For more information about the createinstallmedia command and the arguments that you can use with it, make sure that the macOS installer is in your Applications folder, then enter the appropriate path in Terminal:

  • Big Sur: /Applications/Install macOS Big Sur.app/Contents/Resources/createinstallmedia
  • Catalina: /Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia
  • Mojave: /Applications/Install macOS Mojave.app/Contents/Resources/createinstallmedia
  • High Sierra: /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia
  • El Capitan: /Applications/Install OS X El Capitan.app/Contents/Resources/createinstallmedia

A bootable installer doesn't download macOS from the internet, but it does require an internet connection to get firmware and other information specific to the Mac model.





broken image