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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.