Erase a Windows-formatted USB stick on macOS

Disk Utility often cannot erase a USB stick that held a Windows installer or uses an MBR layout. diskutil eraseDisk in Terminal wipes and reformats it in one step.

Contents

Sometimes a USB stick plugged into a Mac does not show up properly in Disk Utility, or it shows a strange layout such as FDisk_partition_scheme. This usually means the stick was used as a Windows installer, or has an NTFS or FAT32 partition, and Disk Utility cannot format it cleanly. The command line can.

The problem

Disk Utility struggles with drives that:

  • were used as a Windows installation drive,
  • use MBR (FDisk_partition_scheme) instead of GPT, or
  • have NTFS or hybrid partitions.

Typical symptoms are:

  • only part of the space is shown, such as 34 GB on a 64 GB drive;
  • the erase options are greyed out;
  • the drive does not mount, or is not fully visible.

Step 1: find the disk in Terminal

Terminal usually sees the disk even when Disk Utility does not:

diskutil list
/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *61.5 GB    disk4
   1:             Windows_FAT_32 ESD-USB                 34.4 GB    disk4s1
                    (free space)                         27.2 GB    -

This 64 GB stick uses an MBR (FDisk) layout with a single Windows FAT32 partition and unallocated space. macOS can read the layout but cannot manage it properly.

Step 2: erase the whole disk

diskutil eraseDisk HFS+ MyUSB GPT /dev/disk4

Replace /dev/disk4 with the identifier from step 1, and check it twice: this erases the entire disk.

  • HFS+ formats the disk as Mac OS Extended (Journaled).
  • MyUSB is the volume name; choose your own.
  • GPT creates a GUID partition table.

The stick now has a single macOS volume using all of its space.

Making a bootable stick

To write an installer image to the stick afterwards, I suggest balenaEtcher. If you need help with installers or USB tools, leave a comment below.

Join the discussion

Comments are hosted on comments.vciso.ch, a server I run myself. Nothing is loaded from it until you press the button below. Loading comments connects your browser to that server, and signing in with GitHub sets a cookie there. See the privacy page for details.

Type to search.

↑ ↓ to move, Enter to open, Esc to close