Formatting a USB Flash Drive on Mac OS X

Fed up with Kubuntu on my laptop at home, I decided to try and install Mint via a USB Flash Drive.

Except, I couldn’t get either KDE Partition Manager on my laptop, or Disk Utility on my work MacBook to erase and format the flash drive. I wanted to do this, so that dd would have a pristine flash drive to burn the Mint ISO to.

Disk Utility was giving errors of the form:

Name invalid.
Operation invalid...

Turns out this was something to do with the fact the the USB Flash Drive already had a bootable Linux partition on it from the last Kubuntu install I did. Luckily I found this page on the Apple website, that contained the solution, you’ll need to scroll all the way to the Helpful answers section at the bottom to find the answer.

In short though, find the id of the USB flash drive using the Info button in Disk Utility, then open a Terminal and issue:

$ diskutil eraseVolume HFS+ NAME disk3
Started erase on disk3 Kubuntu 16.04 LT
Unmounting disk
Initialized /dev/rdisk3 as a 7 GB case-insensitive HFS Plus volume
Mounting disk
Finished erase on disk3 NAME

Then pop back into Disk Utility and click the Erase button and format the disk to FAT32. You should now be able to use dd to copy the ISO to the flash drive.


I’ve been neglecting this blog of late, it’s not that I haven’t had stuff to put up on it, I have, I’ve just not got my finger out. Since I’ve been fiddling with some NoSQL and MapReduce stuff lately, I thought I should extract said finger and write some blogs in case someone find any of it useful. So there maybe a small surge of blogs in the next week or so…


I’ve finally succumbed and created a github account. I have no idea how to use github or git, other than cloning a repository. I have some ideas of what to put on there, I’m just not sure how I should lay it all out yet. Suppose I should really dust off a couple of old projects that have fallen by the wayside and finish them off.