Force wipe, even if the filesystem is mounted

wipefs

  • Wipe filesystem, raid, or partition-table signatures from a device.
    More information: <https://manned.org/wipefs>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

sudo wipefs --all --force {{/dev/sdX}}

click the source code to copy install wipefs on any operating system with command-not-found.com