$linuxjunkies
>

wipefs(8)

Wipe filesystem, raid, and partition-table signatures from a device.

UbuntuDebianFedoraArch

Synopsis

wipefs [options] device...

Description

wipefs erases filesystem, raid, and partition-table signatures (magic bytes) from the specified device(s) to make filesystems invisible to libblkid. It does not erase the filesystem data itself, only the identifying headers that allow the system to recognize what type of filesystem exists.

This is useful for removing stale or duplicate filesystem signatures before creating new partitions, or for preventing a device from being auto-mounted based on old signatures. By default, wipefs shows what would be erased without making changes.

Use the -a flag to actually wipe the signatures, or -o to target specific offsets.

Common options

FlagWhat it does
-a, --allErase all recognized signatures (default is dry-run, shows what would be wiped)
-b, --backupCreate backup files of erased signatures in the current directory
-f, --forceForce erasure even if device is mounted or in use
-n, --no-actShow what would be erased without actually wiping (default behavior)
-o, --offset offsetWipe only the signature at the specified offset in bytes
-p, --parsableOutput in machine-readable (parsable) format
-q, --quietSuppress output (useful for scripts)
-t, --types listLimit wiping to specified signature types (e.g., filesystem,raid,partitiontable)

Examples

Show all signatures found on /dev/sda1 without erasing them (dry-run)

wipefs /dev/sda1

Erase all filesystem signatures from /dev/sda1 to make it invisible to libblkid

wipefs -a /dev/sda1

Wipe all signatures from /dev/sdb and backup erased data to current directory

wipefs -b -a /dev/sdb

Show only filesystem signatures on /dev/sdc1, ignoring raid and partition table signatures

wipefs -t filesystem /dev/sdc1

Erase the signature at offset 0 bytes on /dev/sdd

wipefs -o 0 -a /dev/sdd

Force wipe signatures on /dev/sde1 even if it's mounted

wipefs -f -a /dev/sde1

Related commands