Skip to content

Creating Windows bootable USB in MacOS #44

Description

@blackchestnut

Step 1

Download iso from https://www.microsoft.com/en-us/software-download/

Step 2

Insert USB stick an run diskutil list

$ diskutil list

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI ⁨EFI⁩                     314.6 MB   disk0s1
   2:                 Apple_APFS ⁨Container disk1⁩         250.7 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.7 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume ⁨Macintosh HD - Data⁩     124.0 GB   disk1s1
   2:                APFS Volume ⁨Preboot⁩                 314.7 MB   disk1s2
   3:                APFS Volume ⁨Recovery⁩                1.1 GB     disk1s3
   4:                APFS Volume ⁨VM⁩                      4.3 GB     disk1s4
   5:                APFS Volume ⁨Macintosh HD⁩            15.8 GB    disk1s5
   6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.8 GB    disk1s5s1

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.0 GB    disk2
   1:             Windows_FAT_32 ⁨KINGSTON⁩                31.0 GB    disk2s1

Chances are, your USB stick has a PC standard FAT16/FAT32 filesytem, and will be mounted automatically. Let’s check:

$ df -h | grep disk2

/dev/disk2s1     29Gi  2.0Mi   29Gi     1%       0          0  100%   /Volumes/KINGSTON

Step 3

This single command will erase the USB stick, make it bootable by adding a Master Boot Record (MBR) and create a Windows-friendly filesystem (FAT) on it:

$ diskutil eraseDisk MS-DOS "WIN81" MBR disk2

Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s1 as MS-DOS (FAT) with name WIN81
512 bytes per physical sector
/dev/rdisk2s1: 60523616 sectors in 1891363 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2048 drv=0x80 bsec=60553216 bspf=14777 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk2

Step 4

Mount the iso image

$ hdiutil mount ~/Downloads/Win8.1_Russian_x64.iso

/dev/disk3          	                               	/Volumes/IR5_CCSA_X64FRE_RU-RU_DV9

Step 5

Copy Windows files onto USB stick

$ cd /Volumes/IR5_CCSA_X64FRE_RU-RU_DV9
$ sudo cp -r . /Volumes/WIN81/

password:

The copy will take good 10-15 min.

There should be no errors returned.

Done

Boot USB stick on your PC.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions