<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Paul Stevens</title>
    <description>The latest articles on DEV Community by Paul Stevens (@pstoken).</description>
    <link>https://dev.to/pstoken</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F351358%2F93eefa26-f79c-45d1-a60f-9168a27b69be.jpeg</url>
      <title>DEV Community: Paul Stevens</title>
      <link>https://dev.to/pstoken</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pstoken"/>
    <language>en</language>
    <item>
      <title>Bootable Win10 USB from macOS</title>
      <dc:creator>Paul Stevens</dc:creator>
      <pubDate>Fri, 20 Mar 2020 13:09:32 +0000</pubDate>
      <link>https://dev.to/pstoken/bootable-win10-usb-from-macos-5b1k</link>
      <guid>https://dev.to/pstoken/bootable-win10-usb-from-macos-5b1k</guid>
      <description>&lt;p&gt;I recently needed to build a new bootable USB to get Windows 10 back onto my desktop PC. Having not done this in quite some time, I didn't realise just how difficult this was going to be.&lt;/p&gt;

&lt;p&gt;Starting from Microsoft's website, I download the latest ISO for Windows 10, created a bootable USB, mounted the USO, copied the contents and then tried to install my OS. It didn't work, as a PC will not boot an exFAT partition. I then wasted £32 on uuBYTEISOEditor, which also didn't work. UNetBootIn didn't work either.&lt;/p&gt;

&lt;p&gt;The issue with a lot of these tools is that while the USB will boot, the moment you click the Install Now option, you'll run into "media not found" errors, which no amount of USB port switching will fix.&lt;/p&gt;

&lt;p&gt;What I ended up doing to get a bootable USB was the following:&lt;/p&gt;

&lt;p&gt;Format your USB drive from the command line:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ diskutil eraseDisk MS-DOS "WINDOWS10" MBR disk2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This pops the FAT32 filesystem on your USB, which is what Windows wants for a bootable USB. Ironically, this also means that a very particular file will not fit on that particular filesystem. That file is located at &lt;code&gt;sources/install.wim&lt;/code&gt; and needs to be fixed before we can use it, as its over 4GB in size and cannot be copied to a FAT32 file system.&lt;/p&gt;

&lt;p&gt;Mount your ISO file to access the contents (it's just an archive):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ hdiutil mount ~/Downloads/Win10_1909_English_x64.iso&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will mount the ISO image as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/Volumes/CCCOMA_X64FRE_EN-US_DV9&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now copy everything except &lt;code&gt;install.wim&lt;/code&gt; to your USB:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$rsync -avh --progress --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/ /Volumes/WINDOWS10&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once that's done, install the tool you'll need to deal with the oversize file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ brew install wimlib&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Instead of splitting &lt;code&gt;install.wim&lt;/code&gt;, we're going to compress it, which takes a little longer but was the solution I went for first and found to work:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
$ cd ~/Downloads&lt;br&gt;
$ cp /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim .&lt;br&gt;
$ chmod u+x install.wim&lt;br&gt;
$ wimlib-imagex optimize install.wim --solid&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On my 2018 15" MacBook Pro, this took about 18 minutes to complete.&lt;/p&gt;

&lt;p&gt;The file compressed some more, you can copy it off to your USB:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cp install.vim /Volumes/WINDOWS10/sources/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Unmount the USB:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ diskutil unmount /dev/disk2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now slot the USB into your Windows machine and install Windows. I'm just left wondering why this had to be so difficult.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
