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