首先准备一台macos系统的电脑,访问AppStore。 搜索mac系统并下载 以mac12.4 monterey 为例
1.创建DMG磁盘镜像
打开终端程序
输入指令
1
| hdiutil create -size 10g -volname "macOS Monterey" -fs HFS+J -fsargs "-c c=64,a=16,e=16" -format UDRW -srcfolder /Applications/Install\ macOS\ Monterey.app/Contents/SharedSupport/BaseSystem.dmg /Volumes/macOS\ Monterey/
|
-size 10g 表示创建一个10G的镜像文件
-volname “macOS Monterey” 表示创建的镜像文件名称
-fs HFS+J 表示文件系统格式
-fsargs “-c c=64,a=16,e=16” 表示文件系统参数
-format UDRW 表示镜像文件格式
-srcfolder /Applications/Install\ macOS\ Monterey.app/Contents/SharedSupport/BaseSystem.dmg 表示源文件路径
2.挂载DMG
1
| hdiutil attach /tmp/monterey.dmg -noverify -mountpoint /Volumes/monterey
|
3.将系统写入DMG文件
1
| sudo /Applications/Insatll\ macOS\ Monterey.app/Contents/Resourecs/createinstallmedia --volume /Volumes/monterey --nointeraction
|
4.将DMG文件转换为CDR文件
1
| hdiutil convert /tmp/monterey.dmg -format UDTO -o ~/Desktop/monterey.cdr
|
大功告成