wipefs
Overview
wipefs probes and can erase filesystem, RAID, or partition-table signatures from a device without zeroing the entire disk. Useful before re-initializing disks that still claim to be members of LVM/MD/crypto volumes.
From util-linux.
Syntax
wipefs [options] device
sudo wipefs -a deviceCommon Options
| Option | Description |
|---|---|
-a |
Erase all magic strings |
-o offset |
Erase specific offset |
-n |
Dry-run / no probe write (see man for version) |
-p |
From partition table probe |
-t type |
Limit to type |
-f |
Force |
Safety
- This makes existing data hard to mount; it is destructive even though it is not a full shred.
- Confirm the device with
lsblk -fandblkid.
- Prefer undoing LVM/MD membership with proper tools when the array is still healthy.
Examples with Explanations
Probe signatures
sudo wipefs /dev/sdb
sudo wipefs -p /dev/sdbErase all signatures
sudo wipefs -a /dev/sdb
sudo blkid /dev/sdb # should be emptyAfter wipe — new filesystem
sudo parted -s /dev/sdb mklabel gpt
sudo parted -s /dev/sdb mkpart primary 1MiB 100%
sudo mkfs.xfs /dev/sdb1Additional Resources
man wipefs