写在前面:
需要在mac系统里进行,并在商店里下载好需要的镜像文件,这里以montery12.6.6为例。
1、利用磁盘工具建立空白镜像,大小15GB,格式为扩展日志格式。
【资料图】
在终端里输入:diskutil list
kai@kaideair ~ % diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *300.1 GB disk0
1: EFI NO NAME 104.9 MB disk0s1
2: Microsoft Reserved 16.8 MB disk0s2
3: Microsoft Basic Data 192.0 GB disk0s3
4: Apple_APFS Container disk1 108.0 GB disk0s4
/dev/disk2 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme +15.0 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS mi 14.7 GB disk2s2
由上面可见建立的新的空白镜像文件disk2分为两部分:EFI分区和苹果镜像分区。将苹果镜像分区进行分区(一般包含PE分区和OC引导分区,即所谓双分区),这里只制作OC引导单分区。在终端里输入以下命令
kai@kaideair ~ % sudo diskutil splitPartition disk2s2 JHFS+ macOS 14.7GB
Password:
Started partitioning on disk2s2 (mi)
Splitting
Unmounting disk
Waiting for partitions to activate
Formatting disk2s2 as Mac OS Extended (Journaled) with name macOS
Initialized /dev/rdisk2s2 as a 14 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Finished partitioning on disk2s2 (mi)
kai@kaideair ~ % diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *300.1 GB disk0
1: EFI NO NAME 104.9 MB disk0s1
2: Microsoft Reserved 16.8 MB disk0s2
3: Microsoft Basic Data 192.0 GB disk0s3
4: Apple_APFS Container disk1 108.0 GB disk0s4
/dev/disk2 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme +15.0 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS macOS 14.7 GB disk2s2
2、将下载好的苹果镜像写入空白镜像
在终端里输入以下命令:
sudo
/Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia #在访达里的程序里打开montery里的Contents/Resources/createinstallmedia
--volume
/Volumes/macOS\ 1 /Applications/Install\ macOS\ Monterey.app #将步骤1里在桌面生成的macOS拖入终端里
--nointeraction
kai@kaideair ~ % sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS\ 1 /Applications/Install\ macOS\ Monterey.app --nointeraction
Password:
Erasing disk: 0%... 10%... 20%... 30%... 100%
Making disk bootable...
Copying to disk: 0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%
Install media now available at "/Volumes/Install macOS Monterey"
kai@kaideair ~ %
3、至此,单OC引导黑苹果镜像制作完成。