Monthly Archives: November 2019

too smart for it’s own good, can’t format a USB drive, device is busy error

One of those simple things that you assumed will work but you hit a snag on the last minute.

Last week, we’re on the process of exporting a few virtual machine images and database data for a proof-of-concept/benchmarking activity with a partner. The data is ready, all that needs to be done is copy it over a USB HDD.

The disk was already partitioned using parted, next step is to format it.

$ mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
/dev/sdb1 is mounted; will not make a filesystem here!

We’re dumbfounded on why this fails. We didn’t mount the filesystem!

After a few minutes of googling around and figuring out what /dev/dm-X, we stumbled on this article

These simple steps is just what we need to do:
$ multipath -ll
$ multipath -f XXXXXXXXXXXXX

Thanks for nothing multipath!