]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/wipefs.8.adoc
flock: initialize timevals [-Werror=maybe-uninitialized]
[thirdparty/util-linux.git] / misc-utils / wipefs.8.adoc
CommitLineData
295b3979 1//po4a: entry man manual
6c64d12d
MB
2// Copyright 2009 by Karel Zak. All Rights Reserved.
3// This file may be copied under the terms of the GNU Public License.
4= wipefs(8)
5:doctype: manpage
6:man manual: System Administration
7:man source: util-linux {release-version}
8:page-layout: base
9:command: wipefs
10
11== NAME
12
13wipefs - wipe a signature from a device
14
15== SYNOPSIS
16
17*wipefs* [options] _device_...
18
19*wipefs* [*--backup*] *-o* _offset device_...
20
21*wipefs* [*--backup*] *-a* _device_...
22
23
24== DESCRIPTION
25
26*wipefs* can erase filesystem, raid or partition-table signatures (magic strings) from the specified _device_ to make the signatures invisible for libblkid. *wipefs* does not erase the filesystem itself nor any other data from the device.
27
28When used without any options, *wipefs* lists all visible filesystems and the offsets of their basic signatures. The default output is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using *--output* _columns-list_ in environments where a stable output is required.
29
e6743239 30*wipefs* calls the *BLKRRPART* ioctl when it has erased a partition-table signature to inform the kernel about the change. The ioctl is called as the last step and when all specified signatures from all specified devices are already erased. This feature can be used to wipe content on partitions devices as well as partition table on a disk device, for example by *wipefs -a /dev/sdc1 /dev/sdc2 /dev/sdc*.
6c64d12d
MB
31
32Note that some filesystems and some partition tables store more magic strings on the device (e.g., FAT, ZFS, GPT). The *wipefs* command (since v2.31) lists all the offset where a magic strings have been detected.
33
34When option *-a* is used, all magic strings that are visible for *libblkid*(3) are erased. In this case the *wipefs* scans the device again after each modification (erase) until no magic string is found.
35
36Note that by default *wipefs* does not erase nested partition tables on non-whole disk devices. For this the option *--force* is required.
37
38== OPTIONS
39
40*-a*, *--all*::
2c646c80 41Erase all available signatures. The set of erased signatures can be restricted with the *-t* option.
6c64d12d 42
2295e663
TW
43*-b*, *--backup*[=_dir_]::
44Create a signature backup to the file _wipefs-<devname>-<offset>.bak_ in _$HOME_ or the directory specified as the optional argument. For more details see the *EXAMPLE* section.
6c64d12d
MB
45
46*-f*, *--force*::
2c646c80 47Force erasure, even if the filesystem is mounted. This is required in order to erase a partition-table signature on a block device.
6c64d12d 48
6c64d12d 49*-J*, *--json*::
2c646c80 50Use JSON output format.
6c64d12d
MB
51
52*--lock*[=_mode_]::
2c646c80 53Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
6c64d12d
MB
54
55*-i*, *--noheadings*::
2c646c80 56Do not print a header line.
6c64d12d
MB
57
58*-O*, *--output* _list_::
2c646c80 59Specify which output columns to print. Use *--help* to get a list of all supported columns.
6c64d12d
MB
60
61*-n*, *--no-act*::
2c646c80 62Causes everything to be done except for the *write*(2) call.
6c64d12d
MB
63
64*-o*, *--offset* _offset_::
2c646c80
MB
65Specify the location (in bytes) of the signature which should be erased from the device. The _offset_ number may include a "0x" prefix; then the number will be interpreted as a hex value. It is possible to specify multiple *-o* options.
66+
67The _offset_ argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
6c64d12d
MB
68
69*-p*, *--parsable*::
2c646c80 70Print out in parsable instead of printable format. Encode all potentially unsafe characters of a string to the corresponding hex value prefixed by '\x'.
6c64d12d
MB
71
72*-q*, *--quiet*::
2c646c80 73Suppress any messages after a successful signature wipe.
6c64d12d
MB
74
75*-t*, *--types* _list_::
2c646c80 76Limit the set of printed or erased signatures. More than one type may be specified in a comma-separated list. The list or individual types can be prefixed with 'no' to specify the types on which no action should be taken. For more details see *mount*(8).
6c64d12d 77
2b2d3172 78include::man-common/help-version.adoc[]
6c64d12d
MB
79
80== ENVIRONMENT
81
82LIBBLKID_DEBUG=all::
2c646c80 83enables *libblkid*(3) debug output.
6c64d12d
MB
84
85LOCK_BLOCK_DEVICE=<mode>::
2c646c80 86use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
6c64d12d
MB
87
88== EXAMPLES
89
90*wipefs /dev/sda**::
2c646c80 91Prints information about sda and all partitions on sda.
6c64d12d
MB
92
93*wipefs --all --backup /dev/sdb*::
2c646c80 94Erases all signatures from the device _/dev/sdb_ and creates a signature backup file _~/wipefs-sdb-<offset>.bak_ for each signature.
6c64d12d 95
3819419e 96*dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$\((0x00000438)) bs=1 conv=notrunc*::
2c646c80 97Restores an ext2 signature from the backup file _~/wipefs-sdb-0x00000438.bak_.
6c64d12d
MB
98
99== AUTHORS
100
101mailto:kzak@redhat.com[Karel Zak]
102
103== SEE ALSO
104
105*blkid*(8),
106*findfs*(8)
107
625e9c61 108include::man-common/bugreports.adoc[]
6c64d12d 109
625e9c61 110include::man-common/footer.adoc[]
6c64d12d
MB
111
112ifdef::translation[]
625e9c61 113include::man-common/translation.adoc[]
6c64d12d 114endif::[]