个人工具

UbuntuHelp:MactelSupportTeam/AppleIntelInstallation

来自Ubuntu中文

跳转至: 导航, 搜索

https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=up2.png_up

This page is in major revision

This page is being revised. The various partitioning options require further testing. The revised page will describe preparation necessary before using the standard Ubuntu installer for Intel Macs.

Introduction

Slightly adventurous Intel-based Mac ("Mactel") owners seem to often be afraid or confused about installing Ubuntu alongside OS X, but in reality, it is not as bad as it might seem. There are some oddities that make installation on Mactel different from installation on a PC (but if it were the same, it wouldn't be a Mac, now would it?). Because of this, Guidelines for several different install situations are detailed here. If you are using a computer that does not have a CD-ROM drive, such as the Mac``Book Air, this document may not have enough information. To install on such a computer, should see the guide at FIXME. FIXME: Recommended Ubuntu version to install

BACKUP YOUR DATA

You may laugh now, but when you make a mistake and wipe out your disk, you will be sorry! Time Machine comes with Leopard, and it is so easy to use that it isn’t funny, so most people have no excuse for not backing up your data.

Single-Boot: Ubuntu Only

AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning2.pngIt is recommended that you keep an install of OS X, even if you do not plan to use it as a primary environment, so that you can install firmware updates in the future. (Such updates may be required for your Mac to continue to operate properly.) One way to avoid using space on your Mac's internal hard drive for OS X to install it to an external USB or Firewire hard drive; if a firmware update is released, you can then boot from the external drive to upgrade.

Many users would like to make Ubuntu their only operating system. If this is what you plan to do, there are some changes that you can make to your system that will make its operation closer to that of a normal PC, avoiding some of the special partition considerations detailed in the other installation situations below. Intel Macs have an EFI instead of a BIOS (such as a typical PC contains). With this change, a different partition table scheme (GPT) is used on the hard drive. The EFI of your Mac, however, is capable of utilizing the older partition table format (MBR) for compatibility. Since the recommended Ubuntu installation methods use the "legacy mode" of the EFI anyway, it make sense for a single-booter to convert their hard drive back to the older style.

  • As an Ubuntu installer developer, I recommend against making this change. GPT is a fundamentally better partition table format, and is where we're likely to be going as time goes on (for instance, MBR partition tables can't cope with disks over 2TB). I recommend staying with GPT. Perhaps the author of this recommendation could contact me (cjwatson AT ubuntu.com) to discuss it. --ColinWatson

You can convert your hard drive partition format with gparted on the Ubuntu LiveCD.

  1. Insert the Ubuntu LiveCD into your Mac and Shutdown. Restart the Mac and hold the Option Key. When the boot selector screen comes up, choose to boot from the CD.
  2. Choose you language and and select to start Ubuntu without making a change to your computer.
  3. Once you get to the Ubuntu desktop, go to System > Administration > Partition Editor
  4. gParted will start. From gParted's menu, choose Device > Create Partition Table...
  5. In the Dialog Box that comes up, heed the large, bold warning at the top, and click the "Advanced" triangle to enable the option to create a new partition table format.
  6. make sure to choose "msdos" for the type of partition table and click "Create".
  7. Once your disk has been converted there should be no partitions in gParted. You can create your custom partition layout here or exit gParted and start the Ubuntu Installer and use it's partitioner to do the dirty work. Proceed through the install as normal
  8. Proceed to the documentation for your specific mac version to configure additional drivers and fix any issues.

Dual-Boot: Mac OSX and Ubuntu

AppleIntelInstallation?action=AttachFile&do=get&target=OSX.png AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

Quick Steps

  1. Install rEFIt first and make sure it is working (you should get a boot chooser on startup…)
  2. Use Bootcamp or Disk``Utility to create a partition at the end of the disc. Don’t worry about what format, just make it the size you want for Ubuntu and your swap partition.
  3. After that boot the Ubuntu LiveCD and start the partition editor (gparted) under System > Adminstration. Use gparted to delete the partition you just made in OS X. It should be the last partition on the disc and follows after the HFS+ partition (OS X). Deleting it will leave free space. Apply changes and exit.
  4. Start the Ubuntu Installer from the desktop icon. When prompted, choose to install to the “largest continuous free space”. This will let the installer create a root partition and a swap partition in the free space you made. On the last dialog of the installer, be sure to click the “Advanced” button and choose to install the boot loader (grub) to /dev/sda3.
  5. Reboot when done with the install, and in the rEFIt menu, choose the partition tool. It will attempt to sync the partition tables on your disk. Then SHUTDOWN the computer (not reboot), and start it up. You should be able to boot to Ubuntu now. If it seems to freeze on the tux logo, completely shutdown again and try one more time.

Detailed How-To

Partitioning

The first thing we need to do is repartition your Mac’s hard drive. Of course, we would like to do this non-destructively (without wiping out the partition you have already). With Leopard, this is quite easy as Apple has provided a nifty little tool that will shrink your OSX partition and create a Windows partition in the freed space (which we can convert to Linux partitions later). BootCamp is probably the easiest way to accomplish what you need. AppleIntelInstallation?action=AttachFile&do=get&target=bootcamp-300x230.png Leopard’s Disk``Utility can also “add” partitions to the disc shrinking the OSX partition at the same time. It cannot create Linux partitions though, so if you choose this route, you should create “free space” or an “msdos” format partition for use to modify later. AppleIntelInstallation?action=AttachFile&do=get&target=diskutility-300x263.png At this point, we are really just allocating the space you want for Ubuntu. The actual Linux partitions will be created later during the installation. For pre-Leopard OSX, there are not such nice tools. BootCamp does not run, and Disk``Utility will only allow you to create more partitions if you wipe out all the current partitions. However, the underlying commandline utility still exists. Let’s say you want to resize your OS X partition to 200GB and leave the rest of the disk free (for Ubuntu of course).

sudo diskutil resizeVolume disk0s2 200G

You can read more on diskutil by typing 'diskutil help' in your OS X terminal.

rEFIt

INSTALL rEFIt! You don’t HAVE to use it once you get Ubuntu up and running, but until then, INSTALL rEFIt! You will need it after installing to sync partitions, once you have done that and Ubuntu works, then you can uninstall it. You can even burn a rEFIt CD if you prefer. If you do not see the rEFIt boot menu when starting your Mac, it is not installed properly!

The Ubuntu LiveCD

You can download the Ubuntu Desktop Edition iso from ubuntu.com. (You can choose 32-bit or 64-bit, the choice is yours. If you want to see the pros and cons, you can check out the sticky.) An iso is an “image” of a CD-ROM. You do not burn an iso onto a CD like you do your pictures or music. Instead you burn|the image onto a disc. You can do this with Disk``Utility or various Open Source Burning Apps. You should burn the CD as slow as you can to increase its “bootableness”.

Boot your Mac from the CD

Put the Ubuntu LiveCD in your Mac and reboot. When the rEFIt menu comes up You should get the option to boot from the Ubuntu CD. If you do not see this option, try pressing the Option key when your computer starts. On the Ubuntu CD’s boot menu, select your keyboard language, then choose to boot “without making changes to your system”. Booting into Ubuntu this way takes many minutes, including a minutes-long period where Ubuntu appears to have locked up on the boot menu. Once booted, you have a Ubuntu desktop with gparted, a partitioning tool. Start gparted by navigating to System > Adminstration > Partition Editor. If you previously created an “msdos” style partition used Boot Camp, you should use gparted to delete this partition. It will be located after an EFI partition (hidden in OSX) and an HFS+ partition (HFS+ is OS X's filesystem). Deleting the new partition leaves “free space” on the disk for the Ubuntu install. Click “Apply” before exiting!

Start Installing

Back on the Ubuntu LiveCD desktop, start the installer by double-clicking on the “Install” icon. The installer will prompt you for how you would like to partition your hard disk. Since you have already resized your OS X partition, you can select “install to the largest continuous free space”. Also, on the last dialog of the installer, just before it actually starts installing, be sure to click the “Advanced” button and choose to install grub to /dev/sda3. The system should now install and when finished, prompt you to reboot. AppleIntelInstallation?action=AttachFile&do=get&target=step7.png

Fix the Partition Tables

There is a bug in the installer that causes a problem on Macs. It can be fixed with rEFIt. After rebooting and you see the rEFIt menu, select the “partition tool”. rEFIt will ask to sync your partition tables. Say ‘yes’ and let it do it’s magic. (If you don't have an english keyboard, note that the keys "Z" and "Y" are swapped in the partition tool.) If you see the error "GPT partition of type 'Unknown' found, will not touch this disk" instead of the 'yes' prompt, follow the instructions in comment #6 of this thread and make sure to install gptsync_0.13-10 or higher. After it is done, SHUTDOWN your Mac (not reboot) and startup again. You should now be able to boot into Ubuntu. If you select the Linux Icon in rEFIt, and it freezes on the grey Tux logo, shutdown again and try one more time. AppleIntelInstallation?action=AttachFile&do=get&target=screen2-300x225.png

Other Partitioning Options Multi-booting

Most Intel macs will use the Mac OSX default GPT partitioning scheme to retain compatibility with OSX. The MBR/PC-BIOS compatibility of Intel Macs is limited and cannot provide all the disk/bios management features found in a PC. This is the reason why some extra attention is needed for partitioning layouts in Intel macs to get what you want. (The alternative msdos/MBR partitioning avoids many of these limitations, but Mac OSX support and utilities are lost, which is why it was recommended only for the single-boot section.) Additional partitions can be created for installation of an additional OS (Linux, Windows, BSD) or shared storage. Mac OSX can be installed on an external drive, and Linux on an external is possible with the installation of a small boot partition on the HD. If Windows is installed, rules apply to choice of partition, and this depends on windows version (Vista or XP). Some methods used for Vista will not work for XP. It is not intended to detail all the possible combinations here, but some general rules and examples of multi-booting partition arrangements and tools required are shown to help you choose. Some of these require extra enthusiasm, and the more complex, the more need for backup.

Triple Boot: Mac OSX, Windows, and Ubuntu

AppleIntelInstallation?action=AttachFile&do=get&target=OSX.png AppleIntelInstallation?action=AttachFile&do=get&target=Vista.png AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

  • Note, because this is likely the most popular scenario after dual-booting, it should be the first in the "multi-booting" section and deserves a full write up.

Multi linux

  • To Be Added

Mac OSX and multi Linux

  • To Be added

Manual partitioning using Disk Utility GUI

For a complete new installation with partitioning requirements known, it can be easier to set out the partitions initiallly using the Mac OSX installer DVD Disk Utility GUI, then using ubuntu gparted to finish off. This screen shot shows an example (OSX 10.4), the OSX partition is p2, initially unjournalled to allow write access for ubuntu. The external drive was partitioned the same way. (This method requires careful choice of partition formats if MS Windows is involved). AppleIntelInstallation?action=AttachFile&do=get&target=diskutility10-4.png The following screen shot shows the same partitoning and resizing options as seen in ubuntu desktop gparted. AppleIntelInstallation?action=AttachFile&do=get&target=gparted.png

Mac OSX, Vista, and Ubuntu

AppleIntelInstallation?action=AttachFile&do=get&target=OSX.png AppleIntelInstallation?action=AttachFile&do=get&target=Vista.png AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

This method won't work for XP because XP wants to be on the last MBR partition.
  1. Assuming that OS X is installed, use bootcamp to install Windows Vista. NOTE: MAKE ENOUGH SPACE FOR BOTH WINDOWS AND UBUNTU WITH BOOT CAMP!
  2. Install windows normally.
  3. Start your computer with the Ubuntu disk in the drive. Install Ubuntu by partitioning the boot camp drive that Windows is located on, and install both Ubuntu and GRUB bootloader onto the new partition. (There are programs that allow Mac OS X to write to ext2, you'll just have to mount your ext3 partition as ext2 in Mac OS X)
  4. Start the computer and boot back into Mac and install rEFIt. This will allow you to boot into every operating system on boot.

Partitioning Diagram

Install OSX (Note that 200MB EFI partition is hidden for MacOSX)
sda1, sda2=disk0s2
[EFI][OSX==================================================]

MacOSX Bootcamp or diskutil.
Shrink OSX to final size, make empty partition with room for ubuntu.
sda1, sda2------,sda3--------------------------------------
[EFI][OSX=======][===== empty =============================]

Install Vista.
sda1, sda2------,sda3--------------------------------------
[EFI][OSX=======][VISTA====================================]

Ubuntu installer - resize sda3 Vista.
sda1,sda2-------,sda3------,sda4 free
[EFI][OSX=======][VISTA====][free==========================]

Use free space for Ubuntu partitions
sda1, sda2------,sda3------, sda4----,sda5-,
[EFI][OSX=======][VISTA====][UBUNTU /][swap][Umallocated===]
Here sda4 is ubuntu /.
Use the Advanced option to select the ubuntu root /, (here sda4), for GRUB.

(Do not use the above method to install with XP, it will fail)

Mac OSX, XP, and Ubuntu

AppleIntelInstallation?action=AttachFile&do=get&target=OSX.png AppleIntelInstallation?action=AttachFile&do=get&target=Vista.png AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

Partitioning Diagram

OSX - 200MB EFI partition is hidden for MacOSX
sda1, sda2=disk0s2
[EFI][OSX===============================================]

(Bootcamp) Shrink OSX to make partition for XP
sda1, sda2-----------------------------------,sda3------
[EFI][OSX===================================][=====XP===]

(Disk Utility) split OSX (+1) (diskutil resizeVolume)
sda1, sda2-------------,sda3-----------------,sda4------
[EFI][OSX=============][=====(UBU)==========][XP========]

(Ubuntu partition editor)
Resize sda3 down for UBU /,
 XP retains sda4, new partition names start sda5
sda1, sda2-------------,sda3----------,sda5--,sda4------
[EFI][OSX=============][=====(UBU)===][=====][XP========]

If XP is installed before its partiton number changes, then its boot.ini will need editing to change the partition number. The alternative is to install XP after the OSX partition is split and the XP partiton number has changed. This has not been tested.

  1. Make sure you use Leopard and have it updated (10.5.2).
  2. Start Boot``Camp and create a partition for Windows XP (15G is enough).
  3. Don't install it through Bootcamp.
  4. Insert Windows CD and reboot holding C when you hear the beeping sound.
  5. Windows installation should start, follow the usual installation process of Windows.
  6. If it reboots during installation, you press ALT during reboot so that you can pick Windows installation.
  7. After Windows is installed, insert your Leopard DVD and it should install all your Apple drivers and stuff.
  8. Update your Apple Software (there will be an option on the start menu to do so).
  9. Update Windows XP.
  10. Now that Windows is installed, get back to MacOS, we are going to install Linux now.
  11. Start Disk Utility and create a new partition on Machintosh HD, name it Linux
  12. Insert Linux CD and reboot holding C
  13. On Linux installation, delete the partition you created (Linux) because its HFS, and set it as ext3 and mount /. Don't create swap (I know its going to warn you, but ignore it).
  14. At the last step of setup, click advanced because you need to change where GRUB is going to be installed, choose sdaX (which X is your Linux partition).
  15. Let it install Ubuntu.
  16. Get back to MacOS, install rEFIt, reboot and run the partition manager of rEFIt, which should take care of every detail of booting for each OS.
  17. If XP was installed before the partition change, it will need boot.ini to be edited to change its partition from 3 to 4.
  18. Reboot and that's it.

Mac OSX, Vista, XP, and Ubuntu

  1. Quad booting method and discussion.

FIXME: add summary.

Shared storage partitons

FIXME: add summary.

Installing ubuntu using wubi in vista and other complex systems

  • To Be Added

Other Info

Multiple Hard Drives (Mac Pro)

The basic single and dual system partitioning, tools, and installation method have been described above for a single, internal hard disk. Macs with multiple disks have the additional simple option of separate disk for each OS (with some traps such as refit being limited to gptsync the first disk). Some information on this can be found on the Mac|Pro page

GRUB2 / GRUB_EFI

Some Intel macs can use the EFI version of the grub bootloader (AKA GRUB2 or grub-efi) which enables external booting similar to the Mac OSX EFI bootloader.

Example Ubuntu Installation after Mac OSX and Vista

AppleIntelInstallation?action=AttachFile&do=get&target=OSX.png AppleIntelInstallation?action=AttachFile&do=get&target=Vista.png AppleIntelInstallation?action=AttachFile&do=get&target=Linux.png

You have already installed Mac OSX and Windows Vista, now to install Ubuntu.

  1. Startup your laptop with Ubuntu Desktop CD inserted into the drive.
  2. In rEFIt menu, choose to boot the Ubuntu CD.
  3. Select English as the language to be used.
  4. Select the 2nd option, the one that says : "Install Ubuntu"
  5. After the loading, on the install screen, select the O.S. Language (English) and hit "Forward" button, then select your country location.
  6. On the Keyboard layout, choose your keyboard language, and on the other window select the variant Macintosh (mine is Portugal - Macintosh), and test the typing if you want.
  7. On the "Prepare Disk Space" menu, select the 1st option: "Guided - Resize SCSI3 (0,1,0), Partition #3 (sda) and use Free Space", and with your mouse select the desired partition size (I set mine to 80% Windows Vista & 20% Ubuntu), and hit "Forward" button.
  8. On "Migrate Documents and Settings" menu, just hit "Forward".
  9. On "Ready to Install" menu, select "Advanced..." and select to install Grub boot loader to the last partition "/dev/sda4" and hit "OK" button, and then hit "Install" button to begin the installation process.
  10. After the installation has finished, hit "Restart Now" button, it will exit the installer and eject your CDROM, then press "Enter" key to restart.
  11. Use the refit Partitioning Tool to re sync the MBR, then restart again, select the Linux icon on rEFIt to boot into Ubuntu.

Troubleshooting

  1. In case you are stuck with a "No bootable device" message or a blank screen, a bug prevents booting after a successful install (a blank screen or blinking cursor) See information on the forum here to fix it.
  2. If you did not install rEFIt, hold down Alt/Option to choose whether to boot into OS X / Ubuntu. The Boot Camp-installed boot menu will recognize the Ubuntu installation as "Windows," but will boot Ubuntu normally regardless

Obtaining Help

For further assistance please refer to the Ubuntu Apple Users forum.

External Links


[[UbuntuHelp:]]|[[UbuntuHelp:]]


IconsPage?action=AttachFile&do=get&target=IconUsers.png> The MactelSupportTeam is restructuring and reorganizing the documentation for Intel-based Macs. If you are interested in helping, please visit our team|page for information. For all Mactel wikis, there is a starting place here.|There is also a thread about planning the Mactel docummentation going on.