Linux
Storage
Metadata
wipefs — erase filesystem signatures from a device
wipefs removes filesystem, RAID, or partition-table signatures from a block device. It does not wipe all data — only the identifying metadata.
What wipefs is good for
- Preparing disks before reuse
- Removing old RAID/LVM signatures
- Fixing “device busy” or “already contains a filesystem” errors
Incorrect device selection can destroy critical metadata. Always verify with lsblk before wiping.
wipefs removes signatures only — it is not a secure erase tool.
10 Practical Examples
1) List detected signatures
2) Show detailed output
-n = no write (dry run)
4) Remove specific offset
sudo wipefs -o 0x00000100 /dev/sdX
5) Force removal
sudo wipefs -a -f /dev/sdX
6) Wipe partition signature
7) Clear leftover LVM metadata
sudo wipefs -a /dev/sdX
sudo pvcreate /dev/sdX
8) Clear RAID signature
Useful before re-adding disk to mdadm array.
9) Combine with dd (stronger wipe of first blocks)
sudo dd if=/dev/zero of=/dev/sdX bs=1M count=10
Overwrites initial blocks (more destructive).
10) Verify clean device
sudo wipefs /dev/sdX
lsblk -f
Notes & Gotchas
- Does not erase full disk contents.
- Often used before creating new partitions or LVM volumes.
- Check device carefully — especially in multi-disk systems.
- Use
-n (dry run) first when unsure.