1WIPEFS(8)                    System Administration                   WIPEFS(8)
2
3
4

NAME

6       wipefs - wipe a signature from a device
7

SYNOPSIS

9       wipefs [options] device...
10
11       wipefs [--backup] -o offset device...
12
13       wipefs [--backup] -a device...
14

DESCRIPTION

16       wipefs can erase filesystem, raid or partition-table signatures (magic
17       strings) from the specified device to make the signatures invisible for
18       libblkid. wipefs does not erase the filesystem itself nor any other
19       data from the device.
20
21       When used without any options, wipefs lists all visible filesystems and
22       the offsets of their basic signatures. The default output is subject to
23       change. So whenever possible, you should avoid using default outputs in
24       your scripts. Always explicitly define expected columns by using
25       --output columns-list in environments where a stable output is
26       required.
27
28       wipefs calls the BLKRRPART ioctl when it has erased a partition-table
29       signature to inform the kernel about the change. The ioctl is called as
30       the last step and when all specified signatures from all specified
31       devices are already erased. This feature can be used to wipe content on
32       partitions devices as well as partition table on a disk device, for
33       example by wipefs -a /dev/sdc1 /dev/sdc2 /dev/sdc.
34
35       Note that some filesystems and some partition tables store more magic
36       strings on the device (e.g., FAT, ZFS, GPT). The wipefs command (since
37       v2.31) lists all the offset where a magic strings have been detected.
38
39       When option -a is used, all magic strings that are visible for
40       libblkid(3) are erased. In this case the wipefs scans the device again
41       after each modification (erase) until no magic string is found.
42
43       Note that by default wipefs does not erase nested partition tables on
44       non-whole disk devices. For this the option --force is required.
45

OPTIONS

47       -a, --all
48           Erase all available signatures. The set of erased signatures can be
49           restricted with the -t option.
50
51       -b, --backup
52           Create a signature backup to the file
53           $HOME/wipefs-<devname>-<offset>.bak. For more details see the
54           EXAMPLE section.
55
56       -f, --force
57           Force erasure, even if the filesystem is mounted. This is required
58           in order to erase a partition-table signature on a block device.
59
60       -J, --json
61           Use JSON output format.
62
63       --lock[=mode]
64           Use exclusive BSD lock for device or file it operates. The optional
65           argument mode can be yes, no (or 1 and 0) or nonblock. If the mode
66           argument is omitted, it defaults to "yes". This option overwrites
67           environment variable $LOCK_BLOCK_DEVICE. The default is not to use
68           any lock at all, but it’s recommended to avoid collisions with
69           udevd or other tools.
70
71       -i, --noheadings
72           Do not print a header line.
73
74       -O, --output list
75           Specify which output columns to print. Use --help to get a list of
76           all supported columns.
77
78       -n, --no-act
79           Causes everything to be done except for the write(2) call.
80
81       -o, --offset offset
82           Specify the location (in bytes) of the signature which should be
83           erased from the device. The offset number may include a "0x"
84           prefix; then the number will be interpreted as a hex value. It is
85           possible to specify multiple -o options.
86
87           The offset argument may be followed by the multiplicative suffixes
88           KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB,
89           ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning
90           as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on
91           for GB, TB, PB, EB, ZB and YB.
92
93       -p, --parsable
94           Print out in parsable instead of printable format. Encode all
95           potentially unsafe characters of a string to the corresponding hex
96           value prefixed by '\x'.
97
98       -q, --quiet
99           Suppress any messages after a successful signature wipe.
100
101       -t, --types list
102           Limit the set of printed or erased signatures. More than one type
103           may be specified in a comma-separated list. The list or individual
104           types can be prefixed with 'no' to specify the types on which no
105           action should be taken. For more details see mount(8).
106
107       -h, --help
108           Display help text and exit.
109
110       -V, --version
111           Print version and exit.
112

ENVIRONMENT

114       LIBBLKID_DEBUG=all
115           enables libblkid(3) debug output.
116
117       LOCK_BLOCK_DEVICE=<mode>
118           use exclusive BSD lock. The mode is "1" or "0". See --lock for more
119           details.
120

EXAMPLES

122       wipefs /dev/sda*
123           Prints information about sda and all partitions on sda.
124
125       wipefs --all --backup /dev/sdb
126           Erases all signatures from the device /dev/sdb and creates a
127           signature backup file ~/wipefs-sdb-<offset>.bak for each signature.
128
129       dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1
130       conv=notrunc
131           Restores an ext2 signature from the backup file
132           ~/wipefs-sdb-0x00000438.bak.
133

AUTHORS

135       Karel Zak <kzak@redhat.com>
136

SEE ALSO

138       blkid(8), findfs(8)
139

REPORTING BUGS

141       For bug reports, use the issue tracker at
142       https://github.com/util-linux/util-linux/issues.
143

AVAILABILITY

145       The wipefs command is part of the util-linux package which can be
146       downloaded from Linux Kernel Archive
147       <https://www.kernel.org/pub/linux/utils/util-linux/>.
148
149
150
151util-linux 2.38                   2022-02-17                         WIPEFS(8)
Impressum