Note:

  • I worked only on 64 bit platforms. For 32 bit platforms it could be the same or may be even much easier. So try it on your own.
  • This write-up is about how to prepare multiboot installation USB flash drive on Mac OS for the purpose of booting uniquely from Intel Mac machines. Mine is MacBook Pro 17″ (3.1, late 2007 with 64 bit EFI).
  • In all cases a simple “cp -R” command does the trick to prepare the bootable volumes.

Requirements:

  1. A USB flash drive with size, say above 8, 16, 32GB or whatever that suits your needs.
  2. The respective Operating Systems’ ISO/DMG files. And that’s it.

Prepare your USB flash drive:

Launch Disk Utility. Select the USB flash drive and click on “Partition” tab. Select the number of partitions you want to make from the “Partition Layout” drop down menu (In my case I opted for 4 partitions). Now click on “Options…” found below “Partition Layout” and select “GUID Partition Table” and click “OK”.

Note: To boot from a Mac machine it is important that the Hard drive’s or USB flash drive’s “Partition Map Scheme” must be “GUID Partition Table”.

GUID Partition Table

GUID Partition Table

Click on the partitions and edit “Name”, “Format” and “Size” according to your needs.

Partition Layout

Partition Layout

On my 32GB SanDisk I created:

  1. Name: Mountain Lion, Format: Mac OS Extended (Jounaled), Size: 5GB
  2. Name: WIN8PROWMC, Format: MS-DOS (FAT), Size: 5GB
  3. Name: FEDORA17, Format: MS-DOS (FAT), Size: 5GB
  4. Name: DataStorage, Format: ExFAT, Size: 17GB

After editing the partitions click on “Apply” to create the partitions.

Prepare MOUNTAIN LION installation boot volume:

Once you downloaded Mountain Lion for installation from “Mac App Store“, get the “InstallESD.dmg“. To do that go to “/Applications” folder. Locate “Install OS X Mountain Lion“. Right click on it and select “Show Package Contents” from the pop-up menu. Open “Contents -> SharedSupport” folder. Double click on “InstallESD.dmg” to mount it. The name of the mounted Volume would be like “Mac OS X Install ESD” and it would be sitting in the Disk Utility.

Method 1:

Click on it from Disk Utility and hit “Restore” tab. Now, the “Source” box will be populated with “Mac OS X Install ESD“. Drag and drop the Mac OS partition from the left side list under the USB flash drive (in my case “Mountain Lion“) on to the “Destination” box. Hit “Restore” to write the image on to the partition. Once it’s written the partition “Name” will change into “Mac OS X Install ESD” and “Format” will become “Mac OS Extended“. That is it. This partition is ready for booting the installation media of Mountain Lion. You can rename the partition “Mac OS X Install ESD” back to “Mountain Lion“.

Restore

Restore

Method 2:

Launch Terminal from Utilities folder. Issue:

$ cp -R “/Volumes/Mac OS X Install ESD”/* “/Volumes/Mountain Lion”/

(or)

$ ditto “/Volumes/Mac OS X Install ESD”/* “/Volumes/Mountain Lion”/

Though “cp” seems to be quite fast.

It’s that simple. Only thing is that make sure all the hidden files and directories such as mach_kernel, boot.efi, etc. are copied properly. Issue an “ls -al” command to verify it.

This volume boots off and installs Mountain Lion flawlessly on to your internal hard disk or external USB flash drive or hard disk.

Prepare FEDORA 17 installation boot volume:

First copy the entire “Fedora-17-x86_64-DVD.iso” or whatever respective ISO file directly to the desired USB flash drive’s partition (In my case FEDORA17 partition).  Then extract ONLY the “images” folder from “Fedora-17-x86_64-DVD.iso” to the same partition. No other folders or files (hidden or not) are required. Use “The Unarchiver“, which is available in Mac App Store for free, or others to extract files. If a file called “TRANS.TBL” is present in every folder, you can delete all by searching for the said file in Finder’s search box under FEDORA17 volume and once all the “TRANS.TBL” files are listed delete them all.

Once it’s done, now mount the same ISO file using “DiskImageMounter“. It mounts a ridiculously small sized volume called “ANACONDA“. Drag and drop all of its contents (EFI, System and mach_kernel) to FEDORA17 partition in Finder. The FEDORA17 partition should look like the image below.

FEDORA17 Partition's Contents

FEDORA17 Partition’s Contents

Now go to the System -> Library -> CoreServices folder. This is the folder structure where all the information needed to do an EFI boot is put. This applies to Mountain Lion, Fedora 17, Windows 8, etc..

Open the “boot.conf” file using a text editor. Modify the first entry as shown below.

title Fedora 17
root (hd0,3)
kernel /images/pxeboot/vmlinuz repo=hd:LABEL=FEDORA17:/
initrd /images/pxeboot/initrd.img

boot.conf File

boot.conf File

In (hd0,3), 0 is your USB flash drive and 3 is your FEDORA17 partition. It’s important that the “LABEL” in kernel command must be assigned the exact name of your “FEDORA17” partition label. If there is any blank spaces in partition label use “\x20” for a single blank space. It’s better you avoid any blank spaces in partition label.

As soon as the “mach_kernel” file is present in any partition, that partition will be added to “System Preferences -> Startup Disk“. These Startup Disk partitions are available in installed Mountain Lion, Mountain Lion installation environment, and in Boot Camp installed Window 8.

That’ is it. Your FEDORA17 installation boot volume is ready.

Note 1:

  • I arrived at the above mentioned solution after having tried different permutations and combinations of “root=“, “repo=” and others. So, it must be working for most of you.
  • In this method, I didn’t encounter “AttributeError: ‘NoneType’ object has no attribute ‘format’“, which was persistent in my other trials. This error came just after preparing/formating the installation media and Anaconda was trying to locate local installation repo.
  • The error “ISO image could not be mounted. Verify that the media is not LVM or RAID” also vanished.
  • I didn’t encounter any bootloader installation problem or any such.
  • I tried to install Fedora 17 from one USB flash drive to another. It went smoothly without any glitches whatsoever though it took an awful lot of time (around 8 hours for Desktop installation). It’s may be because of a direct ISO repo on a USB 2.0 to another USB 2.0. Anyway, now, the installed Fedora 17 Desktop boots off smoothly in EFI mode from the USB flash drive.

Note 2:

I installed Fedora 17 on my MacBook Pro using a USB flash drive prepared using dd command:

$ sudo dd if=Fedora-17-x86_64-DVD.iso of=/dev/disk1 bs=1m

The installation went flawlessly without any glitches.

Prepare Windows 8 installation boot volume:

Note:

  • The below method worked only once (at the very first time, which is quite bizarre since it is not supposed to work on my old Mac machine). After that, all my attempts resulted in Windows 8 getting booted and ending up displaying an error message “Status: 0x000000e Unexpected error occurred” complaining about change/problem in hardware settings.
  • The problem is that, Apple uses EFI 1.1 whereas Microsoft supports UEFI 2.1, so it is not going to work smooth anytime soon without BIOS emulation. Compared to other operating systems like Fedora, Ubuntu or other tools, Microsoft does not provide a decent support for EFI on Mac machines and others.
  • According to this forum, the real issue lies in hardware problem related to video cards. Some users had success following the guidance given by the forum members.
  • The below method may work for MacBook Air and other new Mac machines. So, try it on your own.

It is simple, just mount the ISO image and drag & drop all files to your Windows partition, in my case WIN8PROWMC. At root level there must be a folder called “efi” containing “boot” and “Microsoft” subfolders. Make sure the “boot” folder has a file called “bootx64.efi“. Once it is done:

  • Boot from Windows 8 partition by pressing and holding down “Alt (Option)” key immediately after the startup CHIME.
  • Or select “bootx64.efi” from rEFIt or rEFInd menu, if you have installed one of those Boot Managers (See below to find how to install rEFInd).

Alternatively, you can go to “EFI Shell” and issue:

Shell> fs6:
fs6:> \efi\boot\bootx64.efi

Where fs6 stands for the Windows partition of your USB flash drive, in my case WIN8PROWMC.

Prepare rEFInd Boot Manager:

We are going to install rEFInd on the first partition “EFI” (ie: diskxs1, x being your USB flash drive’s number) of the USB flash drive. But you can also install it on any other partitions of your choice, if you want.

diskutil list

diskutil list

First mount the “EFI” partition. Issue:

$ mkdir /Volumes/EFI
$ sudo mount -t msdos /dev/disk1s1 /Volumes/EFI

Now, go to rEFInd website and download the CD-R image file. You can also use the binary zip file. But the CD-R image file contains the said binary zip file, docs as well as other goodies. Extract the .zip file and mount the resulting .iso file. Once mounted, copy the “EFI” folder, which contains “boot” subfolder, and paste it to the mounted “EFI” volume. You may delete the “bootia32.efi” file and the “drivers_ia32” folder, which are present in “boot” folder. That is it.

You may also want to add extra tools like EFI shell, GPT Sync, etc. to the rEFInd Boot Manager.

rEFInd Screen

rEFInd Screen

To do so, you need tools, which are NOT provided by rEFInd. These tools can be found in rEFIt, from which rEFInd is derived. Though rEFIt is now discontinued and it was last updated on March 2010, these tools are very useful and some other aspects are recycled and used in rEFInd. Go to rEFIt website and download the .dmg file. Mount the .dmg file, go to “efi -> tools” folder and copy the tools you want to use. Now, go to “EFI” volume, “efi” folder and create a folder called “tools” and paste the copied tools on to the “tools” folder.

rEFIt tools Folder

rEFIt tools Folder

Once it’s done, in “EFI” volume, go to “efi -> boot” folder and edit “refind.conf” file as below.

refind.conf File

refind.conf File

It’s done. Now, your “EFI” volume has an “efi” folder, which contains “boot” and “tools” subfolders. You can safely eject or unmount the volume.

$ umount /Volumes/EFI/

Note:

1) Since it is GUID Partition Table (GPT), you can add as many OS boot/installation partitions or other tools as you want as long as they are EFI and GPT compatible.

2) In all cases, a simple direct extraction of files from the ISO/DMG to the respective partitions does the trick. Or mount the ISO/DMG and drag & drop or issue a simple “cp -R *” or “ditto” command from the /Volumes towards the respective partitions.

3) You access these partitions by pressing and holding “Alt (Option)” key immediately after the startup CHIME. This results in the Startup Manager bringing all bootable volumes.

4) Copy a desired .icns file from “efi -> boot -> icons” folder in rEFIt or rEFInd and paste it on to the root folder of corresponding partitions (Mountain Lion, Fedora, Windows or rEFInd, etc.) and then rename it as “.VolumeIcon.icns”. This will display the appropriate icon of the associated partition while startup after pressing “Alt (Option)” key.

Partition Icons

Partition Icons

5) I worked only with Fedora 17 and not with Fedora 18 since I didn’t like the new Anaconda Installer, where customized installation is not possible (I felt comfortable upgrading from 17 to 18 using “FedUp“). Also, Fedora 18’s unsupported GRUB 2 on EFI machine and Fedora 18’s DVD ISO image exceeding 4GB limit for a FAT32 filesystem put a check on my testing process for time being.

Thanks for the read and please leave comments🙂