]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/wipefs.8
wipefs: add note about no-act to the man page
[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 [ \-ahnpqtV ]
10 .RB [ \-o
11 .IR offset ]
12 .IR device ...
13 .SH DESCRIPTION
14 .B wipefs
15 can erase filesystem, raid or partition-table signatures (magic strings) from
16 the specified
17 .I device
18 to make the signatures invisible for libblkid.
19
20 .B wipefs
21 does not erase the filesystem itself nor any other data from the device.
22 When used without any options, \fBwipefs\fR lists all visible filesystems
23 and the offsets of their basic signatures.
24
25 .B wipefs
26 calls the BLKRRPART ioctl when it has erased a partition-table signature
27 to inform the kernel about the change.
28
29 Note that some filesystems and some partition tables store more magic strings on
30 the device. The
31 .B wipefs
32 command lists only the first offset where a magic string has been detected. The device
33 is not scanned for additional magic strings for the same filesystem. It is possible
34 that after a \fBwipefs -o \fIoffset\fR the same filesystem or partition
35 table will still be visible because of another magic string on another offset. The
36 option \fB\-\-no\-act\fR is also affected by this behavior and only the first
37 magic string for the filesystem is reported.
38
39 When option \fB-a\fR is used, all magic strings that are visible for libblkid are
40 erased. In this case the
41 .B wipefs
42 scans the device again after each modification (erase) until no magic string is found.
43
44 Note that by default
45 .B wipefs
46 does not erase nested partition tables on non-whole disk devices.
47 For this the option \fB\-\-force\fR is required.
48
49 .SH OPTIONS
50 .TP
51 .BR \-a , " \-\-all"
52 Erase all available signatures. The set of erased signatures can be
53 restricted with the \fB\-t\fR option.
54 .TP
55 .BR \-b , " \-\-backup"
56 Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak.
57 For more details see the \fBEXAMPLES\fR section.
58 .TP
59 .BR \-f , " \-\-force"
60 Force erasure, even if the filesystem is mounted. This is required in
61 order to erase a partition-table signature on a block device.
62 .TP
63 .BR \-h , " \-\-help"
64 Display help text and exit.
65 .TP
66 .BR -n , " \-\-no\-act"
67 Causes everything to be done except for the write() call.
68 .TP
69 .BR \-o , " \-\-offset " \fIoffset\fP
70 Specify the location (in bytes) of the signature which should be erased from the
71 device. The \fIoffset\fR number may include a "0x" prefix; then the number will be
72 interpreted as a hex value. It is possible to specify multiple \fB-o\fR options.
73 .sp
74 The \fIoffset\fR argument may be followed by the multiplicative
75 suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
76 (the "iB" is optional, e.g. "K" has the same meaning as "KiB"), or the suffixes
77 KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
78 .TP
79 .BR \-p , " \-\-parsable"
80 Print out in parsable instead of printable format. Encode all potentially unsafe
81 characters of a string to the corresponding hex value prefixed by '\\x'.
82 .TP
83 .BR \-q , " \-\-quiet"
84 Suppress any messages after a successful signature wipe.
85 .TP
86 .BR \-t , " \-\-types " \fIlist\fP
87 Limit the set of printed or erased signatures. More than one type may
88 be specified in a comma-separated list. The list or individual types
89 can be prefixed with 'no' to specify the types on which no action should be
90 taken. For more details see mount(8).
91 .TP
92 .BR -V , " \-\-version"
93 Display version information and exit.
94 .SH EXAMPLES
95 .TP
96 .BR "wipefs --all --backup /dev/sdb"
97 Erases all signatures from the device /dev/sdb and creates a signature backup
98 file ~/wipefs-sdb-<offset>.bak for each signature.
99 .TP
100 .BR "dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc"
101 Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak.
102 .SH AUTHOR
103 Karel Zak <kzak@redhat.com>
104 .SH ENVIRONMENT
105 .IP LIBBLKID_DEBUG=all
106 enables libblkid debug output.
107 .SH SEE ALSO
108 .BR blkid (8),
109 .BR findfs (8)
110 .SH AVAILABILITY
111 The wipefs command is part of the util-linux package and is available from
112 https://www.kernel.org/pub/linux/utils/util-linux/.