macOS 15 系统 U 盘制作指南:使用终端344


随着 macOS 15 的发布,用户可能需要为他们的 Mac 创建可启动的 U 盘,用于安装、故障排除或恢复目的。使用终端可以通过命令行创建 U 盘,这是 macOS 中的一个强大工具,它提供了比图形用户界面 (GUI) 更高级别的系统控制。

系统要求
8GB 或更大 U 盘
macOS 15 或更高版本
终端应用程序(可在应用程序 > 实用工具中找到)

步骤
格式化 U 盘:在终端中输入以下命令(确保将 /dev/diskN 替换为 U 盘的设备名称):
```
diskutil eraseDisk FAT32 MBRFormat /dev/diskN
```

创建 macOS 15 安装器磁盘映像:下载 macOS 15 安装器应用程序(可在 App Store 中找到),然后在终端中输入以下命令将安装器转换为磁盘映像(DMG):
```
hdiutil convert /Applications/Install macOS /Contents/SharedSupport/ -format UDRW -o ~/
```

挂载磁盘映像:输入以下命令挂载 macOS 15 磁盘映像:
```
hdiutil attach ~/
```

搜索 :切换到磁盘映像的安装文件夹:
```
cd /Volumes/macOS\ Install/
```
并找到 文件:
```
find . -name
```

下载 :使用以下命令从 Apple 服务器下载 文件(替换 DEVICEID,MACIDENTIFIER 和 PRODUCTNAME):
```
softwareupdate -fetch-full-installer -full-installer-format UDRW -product Retail\ Product%20PRODUCTNAME -device DEVICEID -arch x86_64 -version ACTUALVERSION
```

挂载 :输入以下命令挂载 文件:
```
hdiutil attach ~/
```

复制 :将 文件从磁盘映像安装文件夹复制到 的根目录:
```
cp /Volumes/macOS\ Install/System/Installation/ /Volumes/BaseSystem/
```

卸载 和磁盘映像:输入以下命令卸载磁盘映像:
```
hdiutil detach /Volumes/BaseSystem
```
```
hdiutil detach /Volumes/macOS\ Install
```

将 转换为 :使用以下命令将 转换为 :
```
hdiutil convert ~/ -format UDRW -o ~/
```

拷贝 到 U 盘:将 从用户文件夹复制到 U 盘:
```
cp ~/ /Volumes/(U\ 盘名称)
```

重命名 :更名为 :
```
mv /Volumes/(U\ 盘名称)/ /Volumes/(U\ 盘名称)/
```

创建可启动 U 盘:输入以下命令创建可启动 U 盘:
```
sudo bless --folder /Volumes/(U\ 盘名称)/System/Library/CoreServices --bootable --create-snapshot
```


完成这些步骤后,您将拥有一个可启动的 macOS 15 系统 U 盘。您可以使用此 U 盘在任何兼容的 Mac 上安装或恢复 macOS 15 操作系统。

2025-02-12


上一篇:华为鸿蒙系统:蓬勃发展,迈向智能互联时代

下一篇:Android 系统架构解析