]>
Commit | Line | Data |
---|---|---|
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 | 6 | wipefs \- 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 ] | |
0bb7e904 BIG |
14 | .B \-o |
15 | .I offset | |
d9921b2a KZ |
16 | .IR device ... |
17 | .sp | |
18 | .B wipefs | |
19 | .RB [ \-\-backup ] | |
0bb7e904 | 20 | .B \-a |
1faf44f0 | 21 | .IR device ... |
c49057d2 KZ |
22 | .SH DESCRIPTION |
23 | .B wipefs | |
1faf44f0 | 24 | can erase filesystem, raid or partition-table signatures (magic strings) from |
f126cd46 | 25 | the specified |
c49057d2 | 26 | .I device |
1faf44f0 | 27 | to make the signatures invisible for libblkid. |
c49057d2 | 28 | .B wipefs |
0791a058 | 29 | does not erase the filesystem itself nor any other data from the device. |
92296e9b | 30 | |
d9921b2a KZ |
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. | |
f126cd46 | 38 | |
081dc33b | 39 | .B wipefs |
92f1c5ab | 40 | calls the BLKRRPART ioctl when it has erased a partition-table signature |
921f6343 KZ |
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. | |
081dc33b | 43 | |
92f1c5ab | 44 | Note that some filesystems and some partition tables store more magic strings on |
eb024893 | 45 | the device (e.g., FAT, ZFS, GPT). The |
f126cd46 | 46 | .B wipefs |
92296e9b KZ |
47 | command (since v2.31) lists all the offset where a magic strings have been |
48 | detected. | |
f126cd46 | 49 | |
1c4c6024 | 50 | When option \fB\-a\fR is used, all magic strings that are visible for libblkid are |
5d217e6f KZ |
51 | erased. In this case the |
52 | .B wipefs | |
53 | scans the device again after each modification (erase) until no magic string is found. | |
f126cd46 | 54 | |
24ed0781 KZ |
55 | Note that by default |
56 | .B wipefs | |
92f1c5ab BS |
57 | does not erase nested partition tables on non-whole disk devices. |
58 | For this the option \fB\-\-force\fR is required. | |
24ed0781 | 59 | |
c49057d2 | 60 | .SH OPTIONS |
1faf44f0 BS |
61 | .TP |
62 | .BR \-a , " \-\-all" | |
63 | Erase all available signatures. The set of erased signatures can be | |
92f1c5ab | 64 | restricted with the \fB\-t\fR option. |
1faf44f0 | 65 | .TP |
7e658c15 OO |
66 | .BR \-b , " \-\-backup" |
67 | Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak. | |
bc281b09 | 68 | For more details see the \fBEXAMPLE\fR section. |
7e658c15 | 69 | .TP |
1faf44f0 | 70 | .BR \-f , " \-\-force" |
2968c3fc | 71 | Force erasure, even if the filesystem is mounted. This is required in |
92f1c5ab | 72 | order to erase a partition-table signature on a block device. |
1faf44f0 BS |
73 | .TP |
74 | .BR \-h , " \-\-help" | |
b4362b6f | 75 | Display help text and exit. |
1faf44f0 | 76 | .TP |
d9921b2a KZ |
77 | .BR \-J , " \-\-json" |
78 | Use JSON output format. | |
79 | .TP | |
921ceaca KZ |
80 | \fB\-\-lock\fR[=\fImode\fR] |
81 | Use exclusive BSD lock for device or file it operates. The optional argument | |
82 | \fImode\fP can be \fByes\fR, \fBno\fR (or 1 and 0) or \fBnonblock\fR. If the \fImode\fR | |
83 | argument is omitted, it defaults to \fB"yes"\fR. This option overwrites | |
84 | environment variable \fB$LOCK_BLOCK_DEVICE\fR. The default is not to use any | |
85 | lock at all, but it's recommended to avoid collisions with udevd or other | |
86 | tools. | |
87 | .TP | |
885336d9 | 88 | .BR \-i , " \-\-noheadings" |
d9921b2a KZ |
89 | Do not print a header line. |
90 | .TP | |
91 | .BR \-O , " \-\-output " \fIlist\fP | |
92 | Specify which output columns to print. Use \-\-help to | |
93 | get a list of all supported columns. | |
94 | .TP | |
1c4c6024 | 95 | .BR \-n , " \-\-no\-act" |
c49057d2 | 96 | Causes everything to be done except for the write() call. |
1faf44f0 BS |
97 | .TP |
98 | .BR \-o , " \-\-offset " \fIoffset\fP | |
0791a058 BS |
99 | Specify the location (in bytes) of the signature which should be erased from the |
100 | device. The \fIoffset\fR number may include a "0x" prefix; then the number will be | |
1c4c6024 | 101 | interpreted as a hex value. It is possible to specify multiple \fB\-o\fR options. |
92f1c5ab | 102 | .sp |
d636d6d8 | 103 | The \fIoffset\fR argument may be followed by the multiplicative |
1faf44f0 | 104 | suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB |
eb024893 | 105 | (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes |
1faf44f0 BS |
106 | KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. |
107 | .TP | |
108 | .BR \-p , " \-\-parsable" | |
11295cd1 | 109 | Print out in parsable instead of printable format. Encode all potentially unsafe |
c49057d2 | 110 | characters of a string to the corresponding hex value prefixed by '\\x'. |
1faf44f0 BS |
111 | .TP |
112 | .BR \-q , " \-\-quiet" | |
92f1c5ab | 113 | Suppress any messages after a successful signature wipe. |
1faf44f0 BS |
114 | .TP |
115 | .BR \-t , " \-\-types " \fIlist\fP | |
116 | Limit the set of printed or erased signatures. More than one type may | |
117 | be specified in a comma-separated list. The list or individual types | |
f126cd46 | 118 | can be prefixed with 'no' to specify the types on which no action should be |
1faf44f0 BS |
119 | taken. For more details see mount(8). |
120 | .TP | |
1c4c6024 | 121 | .BR \-V , " \-\-version" |
b4362b6f | 122 | Display version information and exit. |
ade04bb8 MK |
123 | .SH ENVIRONMENT |
124 | .IP LIBBLKID_DEBUG=all | |
125 | enables libblkid debug output. | |
921ceaca KZ |
126 | .IP LOCK_BLOCK_DEVICE=<mode> |
127 | use exclusive BSD lock. The mode is "1" or "0". See \fB\-\-lock\fR for more details. | |
bc281b09 | 128 | .SH EXAMPLE |
7e658c15 | 129 | .TP |
0bb7e904 | 130 | .B wipefs /dev/sda* |
fcf841f8 | 131 | Prints information about sda and all partitions on sda. |
d9921b2a | 132 | .TP |
1c4c6024 | 133 | .B wipefs \-\-all \-\-backup /dev/sdb |
7e658c15 OO |
134 | Erases all signatures from the device /dev/sdb and creates a signature backup |
135 | file ~/wipefs-sdb-<offset>.bak for each signature. | |
136 | .TP | |
0bb7e904 | 137 | .B dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc |
92f1c5ab | 138 | Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak. |
a8d0d330 | 139 | .SH AUTHORS |
1faf44f0 | 140 | Karel Zak <kzak@redhat.com> |
c49057d2 | 141 | .SH SEE ALSO |
66083665 | 142 | .BR blkid (8), |
c49057d2 | 143 | .BR findfs (8) |
9c91fc03 BS |
144 | .SH AVAILABILITY |
145 | The wipefs command is part of the util-linux package and is available from | |
d673b74e | 146 | https://www.kernel.org/pub/linux/utils/util-linux/. |