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