如果您的 PC 出现严重问题并且无法完全启动到Windows 10,您必须修复或重新安装操作系统才能让一切恢复正常。为此,您需要一个可启动的Windows 10 USB记忆棒,而使用另一台 PC 是从头开始创建的最佳方法。
但是,如果您手头只有一台 Mac(Mac)怎么办?您可能已经发现,Microsoft 的媒体创建工具(Media Creation Tool)不适用于 macOS。
在这种情况下,为Mac创建Windows 10可启动USB的最佳方法是手动格式化闪存驱动器并使用Mac的终端(Terminal)将相关文件复制到其中。有一个与存储相关的因素在起作用,因此整个过程最终可能会有些复杂。
在Mac上创建可启动的(Mac)Windows 10 USB需要什么
要开始使用,您的Mac上必须有Windows 10的(Windows 10)ISO映像。这是一个文件,其中包含您将要创建的可启动Windows 10 USB记忆棒中的所有内容。(USB)您可以使用Safari(Safari)或第三方网络浏览器前往 Microsoft 的下载 Windows 10(Download Windows 10)页面,安全地下载最新版本的Windows 10 。
您还必须有一个至少有 8GB 存储空间的U盘。(USB)您将丢失驱动器上的所有数据,因此请务必在继续之前备份其中的所有重要文件。
此外,您必须在Mac上安装(Mac)HomeBrew。它是一个开源软件包管理器,然后您必须使用它来添加一个名为wimlib的命令行工具。但为什么?
较新的 Windows 10 (Newer Windows 10) ISO映像包含一个名为“install.wim”的文件,其大小超过 4 GB。FAT32存储格式(这是Windows和 macOS 唯一共有的格式)的文件大小限制为 4GB 。使用 wimlib,您可以通过拆分或压缩“install.wim”文件来绕过限制。
提示:(Tip:)要检查“install.wim”文件的大小,请挂载ISO映像(只需双击它),在弹出窗口中打开Sources文件夹,选择(Sources)install.wim,然后按Space。
如果您有 Windows 10 的较旧ISO(Windows 10)映像(ISO)(例如Windows 10版本 1903 或更早版本),它可能有一个 4GB 以下的“install.wim”文件。在这种情况下,您不必安装HomeBrew和 wimlib,因为您可以正常将文件复制到U(USB)盘。
但是,Microsoft不会以ISO格式提供旧版本的Windows 10可供下载。如果您确实有一个副本,请随意使用它。
先试试(Try First)新兵训练营助手(Boot Camp Assistant)
在继续之前,您可能想先尝试一下Mac的Boot Camp 助手(Boot Camp Assistant)。它带有在一些Mac型号上创建可启动(Mac)Windows 10 USB驱动器的选项,但通常在格式化或将文件复制到闪存驱动器时遇到问题。不过,它仍然值得一试。
注意:(Note:)您不能在带有 Apple M1 芯片组的 Mac 上使用Boot Camp(Mac’s with Apple M1 chipsets)助理(Boot Camp Assistant)。
1. 前往Finder > Applications > Utilities并启动Boot Camp Assistant。
2.在简介屏幕上选择继续。(Continue)
3. 选中创建 Windows 10 或更高版本安装磁盘(Create a Windows 10 or later install disk)旁边的框。然后,取消选中安装 Windows 10 或更高版本(Install Windows 10 or later version)旁边的框,然后选择继续(Continue)。
4.从 Mac 的内部存储中选择Windows 10 ISO映像,然后选择(ISO)继续(Continue)。
5.等到(Wait)Boot Camp 助理(Boot Camp Assistant)完成创建可引导的Windows 10 (Windows 10) USB。然后,从桌面上卸载闪存驱动器(右键单击并选择Eject )。
(Continue)如果遇到以下任何问题,请继续阅读并改用 Mac终端:(Terminal)
- 缺少创建 Windows 10 或更高版本安装磁盘(Create a Windows 10 or later install disk)选项。
- 格式化磁盘消息时出现错误。(An error occurred while formatting the disk)
- 您会收到磁盘消息上没有足够的可用空间(There is not enough space available on the disk message)。
- 您不能使用U(USB)盘启动 PC。
(Install HomeBrew)在Mac上(Mac)安装 HomeBrew和 wimlib
(Install HomeBrew)通过在Mac(Mac)的终端(Terminal)中运行以下命令,在Mac上(Mac)安装 HomeBrew和 wimlib 。如果您计划使用具有 4GB 以下“install.wim”文件的旧版 Windows 10 ISO文件,请跳至下一部分。
1. 前往Finder >应用程序(Applications )并启动终端。
2. 复制并粘贴以下命令,然后按Enter。
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
输入您的Mac用户密码,然后再次按Enter以安装HomeBrew。可能需要几分钟。
3 、输入brew install wimlib,回车(Enter )安装wimlib。
使用终端(Terminal)创建Windows 10 可启动 USB(Bootable USB)
完成HomeBrew和 wimlib 的安装后,请使用以下步骤在Mac上创建可启动的(Mac)Windows 10 USB。如果您选择不安装它们,请在步骤7中使用替代命令并跳过步骤8。
1. 将U(USB)盘连接到您的Mac。
2. 打开终端。
3. 键入diskutil list并按Enter以显示(Enter)Mac上所有驱动器的列表。
4. 记下U(USB)盘的磁盘标识符——disk2、disk3、disk4等。它应该出现在(external,physical)的左侧。
如果您连接了多个外部驱动器,请使用SIZE列来识别 U 盘。
5.在下面的命令末尾替换磁盘标识符 ( disk2 ) 并使用它来格式化闪存驱动器。(disk2)
diskutil eraseDisk MS-DOS “WINDOWS10” MBR /dev/disk2
注意:如果您稍后在使用(Note:)GPT(GUID 分区表(GUID Partition Table))分区方案的驱动器上设置 Windows 10 时遇到问题,请改用以下命令来格式化USB记忆棒并再次执行其余步骤。
diskutil eraseDisk MS-DOS “WINDOWS10” GPT /dev/disk2
6.从Mac的Downloads文件夹中挂载(Mount)ISO。确保根据需要在以下命令中替换(Make)ISO映像的文件名(包括其文件路径)。
hdiutil mount ~/Downloads/Win10_20H2_v2_English_x64.iso
7. 使用以下命令将ISO映像的内容(不包括“install.wim”文件)复制到U 盘中(USB)。
rsync -vha –exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10
如果您使用不超过 4GB 的“install.wim”文件安装ISO映像,请使用以下命令将所有内容复制到闪存驱动器。(ISO)另外,跳过下一步。
rsync -vha /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10
8. 使用以下命令将 install.wim 文件拆分并复制到U(USB)盘。
wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WINDOWS10/sources/install.swm 3000
或者,您可以使用以下两个命令将 install.wim 文件压缩并复制到驱动器。但是,此方法可能需要很长时间(最多一个小时)才能完成。
sudo wimlib-imagex 优化 install.wim –solid(sudo wimlib-imagex optimize install.wim –solid)
cp install.wim /Volumes/WINDOWS10/sources/install.wim
9. 终端复制完所有文件后,从桌面卸载USB或使用以下命令(替换为正确的磁盘标识符)。
diskutil unmountDisk /dev/disk2
您现在可以断开USB驱动器并使用它启动您的 PC。如果您还没有这样做,请记住更改引导顺序。(change the boot order)USB记忆棒还应该用作Mac上的可启动设备。
启动(Boot)到您的计算机(Your Computer)并开始修复(Start Repairing)
您(Did)是否设法使用USB记忆棒启动计算机?你可能做到了。如果不是,您的 PC 可能使用更旧的BIOS(Basic Input/Output System)而不是UEFI(统一可扩展固件接口)(UEFI (Unified Extensible Firmware Interface))。那么最好的办法是将 Windows 10 安装到 Mac(install Windows 10 onto your Mac)上,并使用 Microsoft 的媒体创建工具(Media Creation Tool)或第三方实用程序(如Rufus)创建兼容的可启动 Windows 10 USB记忆棒。
How to Create a Windows 10 Bootable USB on Mac
If you have serious issues with your PC and can’t fully boot into Windows 10, you must either repair or reinstall the operating system to get things working again. You need a bootable Windows 10 USB stick for that, and using another PC is the best way to create one from scratch.
But what if you only have a Mac at hand? As you may’ve already found out, Microsoft’s Media Creation Tool does not work on macOS.
In that case, the best way to create a Windows 10 bootable USB for Mac is to manually format a flash drive and copy the relevant files into it using the Mac’s Terminal. There’s a storage-related factor at play, so the entire process can end up being somewhat complicated.
What You Need to Create a Bootable Windows 10 USB on Mac
To get started, you must have an ISO image of Windows 10 on your Mac. It’s a file that contains all the stuff that goes into the bootable Windows 10 USB stick that you’re about to create. You can safely download the latest version of Windows 10 by heading over to Microsoft’s Download Windows 10 page using Safari or a third-party web browser.
You must also have a USB stick with at least 8GB of storage space. You will lose all data on the drive, so do be sure to back up any important files inside it before you go ahead.
Additionally, you must install HomeBrew on your Mac. It’s an open-source software package manager that you must then use to add a command line tool called wimlib. But why?
Newer Windows 10 ISO images contain a file called “install.wim” that weighs in at over four gigabytes. The FAT32 storage format—which is the only format that Windows and macOS has in common—has a file size limitation of 4GB. With wimlib, you can get around the limitation by splitting or compressing the “install.wim” file.
Tip: To check the size of the “install.wim” file, mount the ISO image (just double-click it), open the Sources folder on the pop-up window, select install.wim, and press Space.
If you have an older ISO image of Windows 10 (such as Windows 10 version 1903 or earlier), it may have an “install.wim” file under 4GB. In that case, you don’t have to install HomeBrew and wimlib since you can copy the file to the USB stick normally.
However, Microsoft does not make older versions of Windows 10 available for download in ISO format. If you do have a copy lying around, feel free to use it.
Give the Boot Camp Assistant a Try First
Before you go ahead, you may want to give the Mac’s Boot Camp Assistant a try first. It comes with an option to create bootable Windows 10 USB drives on a few Mac models, but it usually ends up running into issues while formatting or copying files to the flash drive. It’s still worth a shot, though.
Note: You can’t use Boot Camp Assistant on Mac’s with Apple M1 chipsets.
1. Go to Finder > Applications > Utilities and launch Boot Camp Assistant.
2. Select Continue on the Introduction screen.
3. Check the box next to Create a Windows 10 or later install disk. Then, uncheck the box next to Install Windows 10 or later version and select Continue.
4. Select the Windows 10 ISO image from your Mac’s internal storage and select Continue.
5. Wait until the Boot Camp Assistant finishes creating the bootable Windows 10 USB. Then, unmount the flash drive (right-click and select Eject) from the desktop.
Continue reading and use the Mac’s Terminal instead if you run into any of the problems below:
- The Create a Windows 10 or later install disk option is missing.
- You get An error occurred while formatting the disk message.
- You get a There is not enough space available on the disk message.
- You can’t use the USB stick to boot into a PC.
Install HomeBrew and wimlib on the Mac
Install HomeBrew and wimlib on your Mac by running the following commands in the Mac’s Terminal. If you plan to use an older Windows 10 ISO file with an “install.wim” file under 4GB, skip ahead to the next section.
1. Go to Finder > Applications and launch Terminal.
2. Copy and paste the following command and press Enter.
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
Type in your Mac user password and press Enter again to install HomeBrew. It may take several minutes.
3. Type brew install wimlib and press Enter to install wimlib.
Create a Windows 10 Bootable USB With Terminal
Once you’ve finished installing HomeBrew and wimlib, use the steps that follow to create the bootable Windows 10 USB on your Mac. If you chose not to install them, then use the alternative command in step 7 and skip step 8.
1. Connect the USB stick to your Mac.
2. Open Terminal.
3. Type diskutil list and press Enter to bring up a list of all drives on your Mac.
4. Note down the USB stick’s disk identifier—disk2, disk3, disk4, etc. It should appear to the left of (external, physical).
If you have multiple external drives attached, use the SIZE column to identify the USB stick.
5. Substitute the disk identifier (disk2) at the end of the command below and use it to format the flash drive.
diskutil eraseDisk MS-DOS “WINDOWS10” MBR /dev/disk2
Note: If you run into issues later while setting up Windows 10 on a drive with a GPT (GUID Partition Table) partition scheme, use the following command instead to format the USB stick and go through the rest of the steps again.
diskutil eraseDisk MS-DOS “WINDOWS10” GPT /dev/disk2
6. Mount the ISO from the Downloads folder of your Mac. Make sure to substitute the file name of the ISO image—including its file path—in the command below as needed.
hdiutil mount ~/Downloads/Win10_20H2_v2_English_x64.iso
7. Copy the contents of the ISO image—excluding the “install.wim” file—into the USB stick with the command below.
rsync -vha –exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10
If you mounted an ISO image with an “install.wim” file that doesn’t exceed 4GB, use the following command instead to copy all the contents to the flash drive. Also, skip the next step.
rsync -vha /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10
8. Use the following command to split and copy the install.wim file to the USB stick.
wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WINDOWS10/sources/install.swm 3000
Alternatively, you can use the two commands below to compress and copy the install.wim file to the drive. However, this method can take a lot of time (up to an hour) to complete.
sudo wimlib-imagex optimize install.wim –solid
cp install.wim /Volumes/WINDOWS10/sources/install.wim
9. After Terminal finishes copying all files, unmount the USB from the desktop or use the following command (replace with correct disk identifier) instead.
diskutil unmountDisk /dev/disk2
You can now disconnect the USB drive and use it to boot into your PC. Do remember to change the boot order if you haven’t done that already already. The USB stick should also function as a bootable device on your Mac.
Boot into Your Computer and Start Repairing
Did you manage to boot into your computer with the USB stick? You probably did. If not, it’s likely that your PC uses the much older BIOS (Basic Input/Output System) instead of UEFI (Unified Extensible Firmware Interface). Your best bet then is to install Windows 10 onto your Mac itself and use Microsoft’s Media Creation Tool or a third-party utility such as Rufus to create a compatible bootable Windows 10 USB stick.