]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/wipefs.8
Merge branch 'meson-more-build-options' of https://github.com/jwillikers/util-linux
[thirdparty/util-linux.git] / misc-utils / wipefs.8
1 .\" Copyright 2009 by Karel Zak. All Rights Reserved.
2 .\" This file may be copied under the terms of the GNU Public License.
3 .\"
4 .TH WIPEFS 8 "December 2014" "util-linux" "System Administration"
5 .SH NAME
6 wipefs \- wipe a signature from a device
7 .SH SYNOPSIS
8 .B wipefs
9 .RB [ options ]
10 .IR device ...
11 .sp
12 .B wipefs
13 .RB [ \-\-backup ]
14 .B \-o
15 .I offset
16 .IR device ...
17 .sp
18 .B wipefs
19 .RB [ \-\-backup ]
20 .B \-a
21 .IR device ...
22 .SH DESCRIPTION
23 .B wipefs
24 can erase filesystem, raid or partition-table signatures (magic strings) from
25 the specified
26 .I device
27 to make the signatures invisible for libblkid.
28 .B wipefs
29 does not erase the filesystem itself nor any other data from the device.
30
31 When used without any options, wipefs lists all visible filesystems and the
32 offsets of their basic signatures. The default output is subject to change.
33 So whenever possible, you should avoid using default outputs in your scripts.
34 Always explicitly define expected columns by using
35 .B \-\-output
36 .I columns-list
37 in environments where a stable output is required.
38
39 .B wipefs
40 calls the BLKRRPART ioctl when it has erased a partition-table signature
41 to inform the kernel about the change. The ioctl is called as the last step
42 and when all specified signatures from all specified devices are already erased.
43
44 Note that some filesystems and some partition tables store more magic strings on
45 the device (e.g. FAT, ZFS, GPT). The
46 .B wipefs
47 command (since v2.31) lists all the offset where a magic strings have been
48 detected.
49
50 When option \fB-a\fR is used, all magic strings that are visible for libblkid are
51 erased. In this case the
52 .B wipefs
53 scans the device again after each modification (erase) until no magic string is found.
54
55 Note that by default
56 .B wipefs
57 does not erase nested partition tables on non-whole disk devices.
58 For this the option \fB\-\-force\fR is required.
59
60 .SH OPTIONS
61 .TP
62 .BR \-a , " \-\-all"
63 Erase all available signatures. The set of erased signatures can be
64 restricted with the \fB\-t\fR option.
65 .TP
66 .BR \-b , " \-\-backup"
67 Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak.
68 For more details see the \fBEXAMPLES\fR section.
69 .TP
70 .BR \-f , " \-\-force"
71 Force erasure, even if the filesystem is mounted. This is required in
72 order to erase a partition-table signature on a block device.
73 .TP
74 .BR \-h , " \-\-help"
75 Display help text and exit.
76 .TP
77 .BR \-J , " \-\-json"
78 Use JSON output format.
79 .TP
80 .BR \-n , " \-\-noheadings"
81 Do not print a header line.
82 .TP
83 .BR \-O , " \-\-output " \fIlist\fP
84 Specify which output columns to print. Use \-\-help to
85 get a list of all supported columns.
86 .TP
87 .BR -n , " \-\-no\-act"
88 Causes everything to be done except for the write() call.
89 .TP
90 .BR \-o , " \-\-offset " \fIoffset\fP
91 Specify the location (in bytes) of the signature which should be erased from the
92 device. The \fIoffset\fR number may include a "0x" prefix; then the number will be
93 interpreted as a hex value. It is possible to specify multiple \fB-o\fR options.
94 .sp
95 The \fIoffset\fR argument may be followed by the multiplicative
96 suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
97 (the "iB" is optional, e.g. "K" has the same meaning as "KiB"), or the suffixes
98 KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
99 .TP
100 .BR \-p , " \-\-parsable"
101 Print out in parsable instead of printable format. Encode all potentially unsafe
102 characters of a string to the corresponding hex value prefixed by '\\x'.
103 .TP
104 .BR \-q , " \-\-quiet"
105 Suppress any messages after a successful signature wipe.
106 .TP
107 .BR \-t , " \-\-types " \fIlist\fP
108 Limit the set of printed or erased signatures. More than one type may
109 be specified in a comma-separated list. The list or individual types
110 can be prefixed with 'no' to specify the types on which no action should be
111 taken. For more details see mount(8).
112 .TP
113 .BR -V , " \-\-version"
114 Display version information and exit.
115 .SH EXAMPLES
116 .TP
117 .B wipefs /dev/sda*
118 Prints information about sda and all partitions on sda.
119 .TP
120 .B wipefs --all --backup /dev/sdb
121 Erases all signatures from the device /dev/sdb and creates a signature backup
122 file ~/wipefs-sdb-<offset>.bak for each signature.
123 .TP
124 .B dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc
125 Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak.
126 .SH AUTHOR
127 Karel Zak <kzak@redhat.com>
128 .SH ENVIRONMENT
129 .IP LIBBLKID_DEBUG=all
130 enables libblkid debug output.
131 .SH SEE ALSO
132 .BR blkid (8),
133 .BR findfs (8)
134 .SH AVAILABILITY
135 The wipefs command is part of the util-linux package and is available from
136 https://www.kernel.org/pub/linux/utils/util-linux/.