How do I format a device that already contains a filesystem?

Solution Verified - Updated -

Issue

  • When formatting a device that already contains a filesystem the mkfs command will fail out stating the filesystem cannot be formatted as it already contains a filesystem:
/dev/vdb2 appears to contain an existing filesystem (xfs).
Use the -f option to force overwrite.

Environment

  • Red Hat Enterprise Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.