ubuntu-16.10-desktop-amd64.iso
。我假设您已经创建了一个可引导的Ubuntu USB闪存驱动器安装程序,并验证了其内容。我还假设您已经通过成功启动Ubuntu的实时版本来验证了硬件兼容性。以下是将这些说明分为三个主要部分的列表:diskutil list disk0
命令的输出结果。/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *256.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 180.7 GB disk0s2
3: Microsoft Reserved 16.8 MB disk0s3
4: Microsoft Basic Data BOOTCAMP 70.1 GB disk0s4
sudo gpt -r show /dev/disk0
命令的输出结果。 start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 352968704 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
353378344 4056
353382400 32768 3 GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
353415168 136818688 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856 9766151
500000007 32 Sec GPT table
500000039 1 Sec GPT header
sudo fdisk /dev/disk0
命令的输出结果。Disk: /dev/disk0 geometry: 31123/255/63 [500000040 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 500000039] <Unknown ID>
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
140G
)。此外,我使用了800MB(800M
)作为新Swap分区的大小。如果您需要更大的大小,则需要进行相应的替换。注意:两个200MB(200M
)的值是任意选择的,这些值稍后会更改。diskutil resizevolume disk0s2 140G 3 jhfs+ part1 800M jhfs+ part2 200M jhfs+ part3 200M
Started partitioning on disk0s2 Macintosh HD
Verifying the disk
Verifying file system
Checking Journaled HFS Plus volume
Checking extents overflow file
Checking catalog file
Checking multi-linked files
Checking catalog hierarchy
Checking extended attributes file
Checking volume bitmap
Checking volume information
The volume Macintosh HD appears to be OK
File system check exit code is 0
Resizing
Waiting for the disks to reappear
Formatting disk0s3 as Mac OS Extended (Journaled) with name part1
Initialized /dev/rdisk0s3 as a 763 MB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Formatting disk0s4 as Mac OS Extended (Journaled) with name part2
Initialized /dev/rdisk0s4 as a 191 MB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Formatting disk0s5 as Mac OS Extended (Journaled) with name part3
Initialized /dev/rdisk0s5 as a 37 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Finished partitioning on disk0s2 Macintosh HD
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *256.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 140.0 GB disk0s2
3: Apple_HFS part1 800.0 MB disk0s3
4: Apple_HFS part2 200.0 MB disk0s4
5: Apple_HFS part3 39.5 GB disk0s5
6: Microsoft Reserved 16.8 MB disk0s6
7: Microsoft Basic Data BOOTCAMP 70.1 GB disk0s7
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 273437496 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
273847136 262144
274109280 1562496 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
275671776 390616 4 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
276062392 77057864 5 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
353120256 262144
353382400 32768 6 GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
353415168 136818688 7 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856 9766151
500000007 32 Sec GPT table
500000039 1 Sec GPT header
sudo fdisk /dev/disk0
的输出结果没有发生变化。插入Ubuntu闪存驱动器并重新启动Mac。按住 option键以调用启动管理器。选择从USB闪存驱动器启动EFI。 提示时,选择下面显示的选项。
注意:为了更好地查看,请单击图像或在新窗口中打开图像。
选择语言。
我选择同时选择下面两个选项。
选择下面显示的选项。
选择下面显示的分区。此分区应与之前在输入diskutil resize volume
命令时指定的交换分区大小相同。
点击“更改…”并在弹出窗口中选择“交换区”,如下所示。不要更改分区大小。然后,点击“确定”。
选择下面显示的分区。然后,点击“-”删除此分区。
选择下面显示的空闲空间。
点击“+”打开“创建分区”弹出窗口。选择“EFI系统分区”。同时,将大小更改为500 MB,并点击“此空间的末尾”按钮。然后,点击“确定”。
选择下面显示的分区。然后,点击“-”删除此分区。
选择下面显示的空闲空间。
点击“+”打开“创建分区”弹出窗口。选择“Ext4日志文件系统”。同时,选择“/”作为“挂载点”。不要更改分区大小。然后,点击“确定”。
点击下面显示的“立即安装”按钮。
点击下面显示的“继续”按钮。
选择您所需的位置。
选择您的键盘。
{{link16:命令
sudo gpt -r show /dev/disk0
生成了以下输出。
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 273437496 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
273847136 262144
274109280 1562496 3 GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
275671776 1312
275673088 76732416 4 GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4
352405504 976896 5 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
353382400 32768 6 GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
353415168 136818688 7 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856 9766151
500000007 32 Sec GPT table
500000039 1 Sec GPT header
输入以下命令来挂载EFI系统分区。
diskutil mount disk0s1
diskutil mount disk0s5
使用Finder应用程序将EFI
文件夹从卷EFI
复制到卷NO NAME
。
删除在Ubuntu安装过程中添加到EFI
卷中的文件夹和文件。为此,将EFI/Ubuntu
文件夹移动到垃圾桶中。
从NO NAME
卷中删除与Microsoft相关的文件。为此,将EFI/Microsoft
文件夹和EFI/Boot/bootx64.efi
文件移动到垃圾桶中。
清空垃圾桶。
复制文件grubx64.efi
从文件夹/EFI/ubuntu
到文件夹/EFI/Boot
中的NO NAME
卷。
将NO NAME
卷上/EFI/Boot
文件夹中的文件grubx64.efi
重命名为bootx64.efi
。
(可选)从sourceforge网站Mac icns下载一组图标。使用Finder应用程序打开下载的文件mac-ices.dmg
,然后输入以下命令将Ubuntu图标文件os_ubuntu.icns
复制到NO NAME
卷中。
cp /Volumes/mac-icns/OSX10.11.6/os_ubuntu.icns "/Volumes/NO NAME/.VolumeIcon.icns"
这将在启动菜单中添加以下Ubuntu图标。
注意:完成后,您可以使用Finder应用程序弹出
mac-icns
卷。
使用Finder应用程序或输入以下命令来卸载标记为EFI
和NO NAME
的EFI系统分区。
diskutil unmount disk0s1
diskutil unmount disk0s5