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
23       to change.  So whenever possible, you should avoid using  default  out‐
24       puts  in  your  scripts.   Always explicitly define expected columns by
25       using --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
32       on  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 libblkid
40       are  erased.  In this case the wipefs scans the device again after each
41       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
46

OPTIONS

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

ENVIRONMENT

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

EXAMPLE

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

AUTHORS

138       Karel Zak <kzak@redhat.com>
139

SEE ALSO

141       blkid(8), findfs(8)
142

AVAILABILITY

144       The  wipefs  command is part of the util-linux package and is available
145       from https://www.kernel.org/pub/linux/utils/util-linux/.
146
147
148
149util-linux                       December 2014                       WIPEFS(8)
Impressum