如何创建 Windows 可启动 USB 介质以在基于 UEFI 的系统上部署
从 USB 驱动器安装 Windows 可能比从光盘介质安装 Windows 更快。这还允许将操作系统 (OS) 安装在不支持光学介质的平板电脑等设备上。
创建 UEFI 可引导 USB 驱动器需要以下各项:
- USB 驱动器
- 用于创建可引导的驱动器的系统管理权限
- 操作系统安装介质
以下步骤详细说明了如何使 USB 驱动器可引导并将操作系统安装介质复制到驱动器。
提醒:Diskpart 工具中的许多命令可以缩写,如下面的屏幕截图所示。
1.插入 USB 驱动器。
2.使用“以管理员身份运行”选项打开命令提示符。
3.通过键入以下命令启动 Diskpart 工具
diskpart
。
4.列出系统识别的所有磁盘,方法是键入
list disk
.
图 1:“list disk”命令
的输出 5.从返回的列表中选择您的 USB 驱动器(本示例中为磁盘 4),方法是键入
select disk 4
。
图 2:“select disk 4”命令
的输出 6.通过键入以下命令从磁盘中删除所有数据
clean
。
注意:此命令会销毁 USB 驱动器上的所有数据。
图 3:“clean”命令
的输出 7.通过键入以下命令将磁盘转换为 GPT:
convert gpt
。这是 UEFI 的要求。
图 4:“convert gpt”命令
的输出 8.通过键入以下命令创建主分区:
create partition primary
。
图 5:“create partition primary”命令
的输出 9.通过键入以下命令格式化新创建的分区
format fs=fat32 quick
。
图 6:“format fs=fat32 quick”命令
的输出 10.列出与系统关联的卷,方法是键入
list volume
。记下新卷的驱动器盘符。(卷 6,本例中为驱动器 I:。)
图 7:“list volume”命令
的输出 11.通过键入以下命令退出 DiskPart
exit
并按 ENTER 键。
图 8:退出磁盘第 12 部分
。在命令提示符下,键入以下命令,使用 BootSect 更新 GPT 分区上的引导码:
bootsect /nt60 I:
。
图 9:Successfully running “bootsect /nt60 I:”
13.插入操作系统介质或装载适用的 ISO 映像。
14.将安装介质的全部内容复制到 USB 驱动器。
提醒:FAT32 文件系统只允许最大 4 GB 的文件大小。如果安装映像包含大于此值的
install.wim 文件,则尝试将其复制到 USB 驱动器会导致错误。要解决此问题,请将
install.wim 文件拆分为多个文件。请参阅
此 Microsoft Learn 文章
,了解拆分文件所涉及的步骤以及其他选项。将生成的
.swm 文件复制到 USB 驱动器,以代替
install.wim 文件。
USB 驱动器现在可用作操作系统安装介质。启动至 USB 驱动器以开始安装。要对正在运行的操作系统执行就地升级,请插入 USB 驱动器并允许
setup.exe 自动运行或从文件资源管理器启动它。