Overwriting the partition table on a Mac


  • Mon 28 January 2019
  • misc

Unlike most parts of MacOS, er, sorry, macOS... Disk Utility has gotten worse over time instead of better. Things that it used to be easy to do through the gui are now missing.

In most cases it's still possible to get where you need to be via the command line. A case in point is stomping on the partition table records. It's really easy to format a thumb drive to FAT32 and think you're done, only to discover when you hook it up to a geriatric Windows box that you've created a FAT32 partion on a GPT-labeled disk and Windows is looking at it like a pig staring at a wrist watch. Great.

The magic incantation is:

{% highlight bash %} diskutil list

to figure out which drive is the thumb or external drive, and then:

{% highlight bash %} sudo diskutil eraseDisk FAT32 UNTITLED MBRFormat /dev/diskN

where diskN is the physical (not the partition) device you just identified.