Difference between revisions of "Ubuntu install on Apple Mac Intel hardware"

From Noah.org
Jump to navigationJump to search
(New page: Category:Engineering Category:Ubuntu Installed [reEFIt 0.12]. Reboot computer while holding down the '''option''' key (alt key). I had to do this twice. The first time it showed ...)
 
m
 
(13 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
[[Category:Ubuntu]]
 
[[Category:Ubuntu]]
  
Installed [reEFIt 0.12].
+
== Disable three finger tap or double-tap ==
 +
 
 +
I'm always resting my fingers above the trackpad and accidentally triggering three finger double-tap, which causes Ubuntu Unity to swap Windows or swap the previous running application. This is incredibly annoying. This kills that feature.
 +
<pre>
 +
synclient TapButton3=2
 +
</pre>
 +
 
 +
== Install Linux with dual boot, not single boot ==
 +
 
 +
Originally I did not want to dual boot; I just wanted Ubuntu Linux by itself. It turns out this can be harder than creating a dual boot setup. So I set aside a small 40GB partition for Mac OS X and the rest I give to Linux.
 +
 
 +
=== why must I dual boot? ===
 +
 
 +
Dual boot with OS X and Linux the easiest way I have found to get Linux to install consistently on an EFI motherboard. This is actually easier than trying to get the Mac to boot just Linux by itself. The Mac uses EFI to control the boot loading process which takes place of the BIOS in traditional x86 based hardware. The details can get complicated, but basically Apple's EFI has a BIOS compatibility layer which is necessary for Linux to run accelerated video drivers. So if you try to just install Linux with no dual boot your results may vary -- you may get perfect working system; or you might get an installation that will not boot; or you may get a system that boots, but is limited to slow display drivers. It's voodoo. I don't know of the easy way to make single boot Linux install the same way every time. Yes, this is annoying. Give up and go the dual boot route and most of the problems go away. Yes, you have to install two operating systems, but it's less effort in the end.
 +
 
 +
== '''BEFORE YOU BEGIN''' ==
 +
 
 +
Before you do anything be sure to read the note [[#second_to_last_step]] below. You just want to beware of choosing the correct option before you click the final "Install" button. Most of the steps you can just follow along without knowing what is coming up next, but if you are not careful and you mess up the second to last step then your EFI boot will get screwed up and the easiest way to fix that is to start all over again from the beginning.
 +
 
 +
== totally reformat the Mac main drive ==
 +
 
 +
You will totally reformat the Mac and reinstall OSX and Ubuntu. I setup about 40GB for OS X and the rest for Ubuntu.
 +
 
 +
Boot off Mac OS X Install CD (or the recovery partition). You are going to reinstall OSX, but first select '''Disk Utility''' from the Utilities menu. Reformat the main drive and repartition with 2 partitions. Set first partition to 40 GB formatted as Mac OS Extended (Journaled, Case-Sensitive) aka HFSX. Set bigger, second partition to '''UNUSED'''. Click OPTIONS button to open a dialog; select "GPTFormat (GUID Partitioning Table)". This is standard for booting OS X off x86 hardware. Do not use "MBRFormat" or "APMFormat". I know you are tempted by "MBRFormat" -- it won't do what you think it would.
 +
 
 +
Once the main drive reformat is done, select 'Quit Disk Utility' to go back to the OS X Installer.
 +
 
 +
== install OSX ==
 +
 
 +
After using Disk Install OSX on first partition (40 GB, HFSX).
 +
 
 +
Boot into OS X. Use "System Preferences" to start "Software Update". Install all necessary updates.
 +
 
 +
== install rEFInd (fork of obsolete rEFIt) ==
 +
 
 +
Install [http://refit.sourceforge.net/ rEFIt]. Reboot.
 +
 
 +
Assuming your USB flash drive comes up as /dev/disk3.
 +
<pre>
 +
sudo su -
 +
diskutil unmountDisk /dev/disk3
 +
dd if=refind-flashdrive-0.9.0.img of=/dev/disk3
 +
diskutil eject /dev/disk3
 +
</pre>
 +
You may not see the rEFIt menu the first time you boot. It may just boot directly into OS X. Reboot again. It always seems to come up the second time. This does not happen on all Apple hardware -- just certain models.
 +
 
 +
After you reboot you should see the rEFIt menu with two or three options "OS X", "Legacy Windows", "Ubuntu CD". You will also see a few small options under those called "Partition Tool", shutdown, and restart. Select "Partition Tool". This does one simple thing -- it copies partition info from the Linux MBR over to the GPT maps. The GPT maps are what the EFI boot loader uses. The "Partition Tool" will analyze the disk and decide if a sync is necessary. It will ask if you want to write changes to disk. Select YES... You will need to do this again later after you install Linux too. Basically you have two partition maps now and you have to keep them both in sync.
 +
 
 +
=== ERROR:  Starting shellx64.efi Using load options '' ===
 +
 
 +
The rEFInd shell binaries are very sensitive the the Mac environment. Some EFI shells boot with no trouble, whereas other lock up with little to show what may have caused the trouble... You need to find new disk image built with a different shell binary.
 +
 
 +
== Boot "Ubuntu Live CD" ==
 +
 
 +
First note that you will not want to select '''Guided - Use entire disk''' when you get to the window for the "Prepare disk space" step (disk partition step). It's not a big deal if you get this wrong -- simply click the "Back" button if you made the wrong choice.
 +
 
 +
Go through install process, but at the step to "Prepare disk space" you should check the radio button for '''Manual''' to partition manually. You will see a partition map something like this:
 +
<pre>
 +
Device          | Type | Mount point | Format? | Size      | Used
 +
---------------------------------------------------------------------
 +
/dev/sda        |      |            |        |          |
 +
    free space  |      |            |        | 0 MB      |
 +
    /dev/sda1  |  efi |            |        | 209 MB    | 209 MB
 +
    /dev/sda2  | hfsx |            |        | 42815 MB  | 9476 MB
 +
    free space  |      |            |        | 277047 MB |
 +
</pre>
 +
You do not want to meddle with that first 'free space' partition nor the 'efi' and 'hfsx' partitions. Leave those and select the big '''free space''' partition (in this case the last free space sized 277047 MB). Click "New partition" to start creating new partitions in the last free space. Create a 4 GB (4000 MB) use as "swap area" (no mount point) then create a partition used as "Ext3 journaling file system" with all remaining space and set Mount point as "/". After doing that you should see something like this (numbers will vary for your system):
 +
<pre>
 +
Device          | Type | Mount point | Format? | Size      | Used
 +
---------------------------------------------------------------------
 +
/dev/sda        |      |            |        |          |
 +
    free space  |      |            |        | 0 MB      |
 +
    /dev/sda1  |  efi |            |        | 209 MB    | 209 MB
 +
    /dev/sda2  | hfsx |            |        | 42815 MB  | 9476 MB
 +
    /dev/sda3  | swap |            |        | 4000 MB  | unknown
 +
    /dev/sda4  | ext3 | /          |  X      | 273047 MB | unknown
 +
    free space  |      |            |        | 0 MB      |
 +
</pre>
 +
 
 +
== second to last step ==
 +
 
 +
'''PAUSE BEFORE CRITICAL STEP'''
 +
 
 +
Click "Forward" to continue through the install process, '''but do not continue past the last step''' -- step 9 or step 7 called "Ready to install". The step number can vary. At the last step you will see the final "Install" button and you will see an "Advanced..." button. Click "Advanced...". Check 'Install Boot Loader'. There will be a drop-down menu for "Device for boot loader installation". By default it will probably say "(hd0)" which is the main drive. '''DO NOT PUT THE BOOTLOADER ON THE MAIN DRIVE OR THE FIRST PARTITION'''. Put the Boot Loader on the 'ext3' partition you last created (in this example it would be "/dev/sda4").
 +
 
 +
Go thorough the rest of the install process. At the end you will reboot as normal.
 +
 
 +
== reboot and run the rEFIt "Partition Tool" again ==
 +
 
 +
The rEFIt menu should come up. Choose the one in the lower-left, "Partition Tool" again to sync the MBR and GPT. It will ask if you want to write changes to disk. Say YES.
 +
 
 +
== Done: system should dual boot Mac OS X and Linux ==
 +
 
 +
Now shutdown and reboot. When rEFIt comes back up it should show both "OS X" and "Linux" boot options. Choose "Linux" and it should boot normally.
 +
 
 +
-----
 +
 
 +
== old notes -- ignore these ==
 +
 
 +
Open terminal, "sudo gparted" to start graphical
  
 
Reboot computer while holding down the '''option''' key (alt key). I had to do this twice. The first time it showed the Mac HD. I selected that then rebooted and after that it came back with the rEFIt menu.
 
Reboot computer while holding down the '''option''' key (alt key). I had to do this twice. The first time it showed the Mac HD. I selected that then rebooted and after that it came back with the rEFIt menu.

Latest revision as of 02:21, 30 January 2016


Disable three finger tap or double-tap

I'm always resting my fingers above the trackpad and accidentally triggering three finger double-tap, which causes Ubuntu Unity to swap Windows or swap the previous running application. This is incredibly annoying. This kills that feature.

synclient TapButton3=2

Install Linux with dual boot, not single boot

Originally I did not want to dual boot; I just wanted Ubuntu Linux by itself. It turns out this can be harder than creating a dual boot setup. So I set aside a small 40GB partition for Mac OS X and the rest I give to Linux.

why must I dual boot?

Dual boot with OS X and Linux the easiest way I have found to get Linux to install consistently on an EFI motherboard. This is actually easier than trying to get the Mac to boot just Linux by itself. The Mac uses EFI to control the boot loading process which takes place of the BIOS in traditional x86 based hardware. The details can get complicated, but basically Apple's EFI has a BIOS compatibility layer which is necessary for Linux to run accelerated video drivers. So if you try to just install Linux with no dual boot your results may vary -- you may get perfect working system; or you might get an installation that will not boot; or you may get a system that boots, but is limited to slow display drivers. It's voodoo. I don't know of the easy way to make single boot Linux install the same way every time. Yes, this is annoying. Give up and go the dual boot route and most of the problems go away. Yes, you have to install two operating systems, but it's less effort in the end.

BEFORE YOU BEGIN

Before you do anything be sure to read the note #second_to_last_step below. You just want to beware of choosing the correct option before you click the final "Install" button. Most of the steps you can just follow along without knowing what is coming up next, but if you are not careful and you mess up the second to last step then your EFI boot will get screwed up and the easiest way to fix that is to start all over again from the beginning.

totally reformat the Mac main drive

You will totally reformat the Mac and reinstall OSX and Ubuntu. I setup about 40GB for OS X and the rest for Ubuntu.

Boot off Mac OS X Install CD (or the recovery partition). You are going to reinstall OSX, but first select Disk Utility from the Utilities menu. Reformat the main drive and repartition with 2 partitions. Set first partition to 40 GB formatted as Mac OS Extended (Journaled, Case-Sensitive) aka HFSX. Set bigger, second partition to UNUSED. Click OPTIONS button to open a dialog; select "GPTFormat (GUID Partitioning Table)". This is standard for booting OS X off x86 hardware. Do not use "MBRFormat" or "APMFormat". I know you are tempted by "MBRFormat" -- it won't do what you think it would.

Once the main drive reformat is done, select 'Quit Disk Utility' to go back to the OS X Installer.

install OSX

After using Disk Install OSX on first partition (40 GB, HFSX).

Boot into OS X. Use "System Preferences" to start "Software Update". Install all necessary updates.

install rEFInd (fork of obsolete rEFIt)

Install rEFIt. Reboot.

Assuming your USB flash drive comes up as /dev/disk3.

sudo su -
diskutil unmountDisk /dev/disk3
dd if=refind-flashdrive-0.9.0.img of=/dev/disk3
diskutil eject /dev/disk3

You may not see the rEFIt menu the first time you boot. It may just boot directly into OS X. Reboot again. It always seems to come up the second time. This does not happen on all Apple hardware -- just certain models.

After you reboot you should see the rEFIt menu with two or three options "OS X", "Legacy Windows", "Ubuntu CD". You will also see a few small options under those called "Partition Tool", shutdown, and restart. Select "Partition Tool". This does one simple thing -- it copies partition info from the Linux MBR over to the GPT maps. The GPT maps are what the EFI boot loader uses. The "Partition Tool" will analyze the disk and decide if a sync is necessary. It will ask if you want to write changes to disk. Select YES... You will need to do this again later after you install Linux too. Basically you have two partition maps now and you have to keep them both in sync.

ERROR: Starting shellx64.efi Using load options

The rEFInd shell binaries are very sensitive the the Mac environment. Some EFI shells boot with no trouble, whereas other lock up with little to show what may have caused the trouble... You need to find new disk image built with a different shell binary.

Boot "Ubuntu Live CD"

First note that you will not want to select Guided - Use entire disk when you get to the window for the "Prepare disk space" step (disk partition step). It's not a big deal if you get this wrong -- simply click the "Back" button if you made the wrong choice.

Go through install process, but at the step to "Prepare disk space" you should check the radio button for Manual to partition manually. You will see a partition map something like this:

Device          | Type | Mount point | Format? | Size      | Used
---------------------------------------------------------------------
/dev/sda        |      |             |         |           | 
    free space  |      |             |         | 0 MB      |
    /dev/sda1   |  efi |             |         | 209 MB    | 209 MB
    /dev/sda2   | hfsx |             |         | 42815 MB  | 9476 MB
    free space  |      |             |         | 277047 MB |

You do not want to meddle with that first 'free space' partition nor the 'efi' and 'hfsx' partitions. Leave those and select the big free space partition (in this case the last free space sized 277047 MB). Click "New partition" to start creating new partitions in the last free space. Create a 4 GB (4000 MB) use as "swap area" (no mount point) then create a partition used as "Ext3 journaling file system" with all remaining space and set Mount point as "/". After doing that you should see something like this (numbers will vary for your system):

Device          | Type | Mount point | Format? | Size      | Used
---------------------------------------------------------------------
/dev/sda        |      |             |         |           | 
    free space  |      |             |         | 0 MB      |
    /dev/sda1   |  efi |             |         | 209 MB    | 209 MB
    /dev/sda2   | hfsx |             |         | 42815 MB  | 9476 MB
    /dev/sda3   | swap |             |         | 4000 MB   | unknown
    /dev/sda4   | ext3 | /           |  X      | 273047 MB | unknown
    free space  |      |             |         | 0 MB      |

second to last step

PAUSE BEFORE CRITICAL STEP

Click "Forward" to continue through the install process, but do not continue past the last step -- step 9 or step 7 called "Ready to install". The step number can vary. At the last step you will see the final "Install" button and you will see an "Advanced..." button. Click "Advanced...". Check 'Install Boot Loader'. There will be a drop-down menu for "Device for boot loader installation". By default it will probably say "(hd0)" which is the main drive. DO NOT PUT THE BOOTLOADER ON THE MAIN DRIVE OR THE FIRST PARTITION. Put the Boot Loader on the 'ext3' partition you last created (in this example it would be "/dev/sda4").

Go thorough the rest of the install process. At the end you will reboot as normal.

reboot and run the rEFIt "Partition Tool" again

The rEFIt menu should come up. Choose the one in the lower-left, "Partition Tool" again to sync the MBR and GPT. It will ask if you want to write changes to disk. Say YES.

Done: system should dual boot Mac OS X and Linux

Now shutdown and reboot. When rEFIt comes back up it should show both "OS X" and "Linux" boot options. Choose "Linux" and it should boot normally.


old notes -- ignore these

Open terminal, "sudo gparted" to start graphical

Reboot computer while holding down the option key (alt key). I had to do this twice. The first time it showed the Mac HD. I selected that then rebooted and after that it came back with the rEFIt menu.

Reboot with Ubuntu 8.10 live CD. The boot option screen might show the disk as "Windows". Apple bastards...

You will probably see a partition "/dev/sda1" that says "fat32" type. It may also say "EFI GPT". You want to leave that partition!

Delete the "hfs+" partition.

Create a partition with a size of 150 GB (150000 MB); set use as "ext3"; and set Mount point as "/".

Create a partition with a size of 4 GB (4000 MB) and set use as "swap area",

Create a partition with the remaining space and set use as "do not use the partition".

The system will start to install.