]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/blkdiscard.8
wipefs: use O_EXCL
[thirdparty/util-linux.git] / sys-utils / blkdiscard.8
CommitLineData
d964b669
LC
1.\" -*- nroff -*-
2.TH BLKDISCARD 8 "September 2012" "util-linux" "System Administration"
3.SH NAME
4blkdiscard \- discard sectors on a device
5.SH SYNOPSIS
6.B blkdiscard
7.RB [ \-o
8.IR offset ]
9.RB [ \-l
10.IR length ]
11.RB [ \-s ]
12.RB [ \-v ]
13.I device
14
15.SH DESCRIPTION
16.B blkdiscard
17is used to discard device sectors. This is useful for solid-state
18drivers (SSDs) and thinly-provisioned storage. Unlike
19.BR fstrim (8)
20this command is used directly on the block device.
21.PP
22By default,
23.B blkdiscard
24will discard all blocks on the device. Options may be used to
25modify this behavior based on range or size, as explained below.
26.PP
27The
28.I device
29argument is the pathname of the block device.
30
31.B WARNING: All data in the discarded region on the device will be lost!
32
33.SH OPTIONS
34The \fIoffset\fR and \fIlength\fR arguments may be
35followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for
36GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same
37meaning as "KiB") or the suffixes KB=1000, MB=1000*1000, and so on for GB, PB,
38EB, ZB and YB.
39.IP "\fB\-h, \-\-help\fP"
40Print help and exit.
41.IP "\fB\-o, \-\-offset\fP \fIoffset\fP"
42Byte offset in the device from which to discard. Provided value will be
43aligned to the device sector size. Default value is zero.
44.IP "\fB\-l, \-\-length\fP \fIlength\fP"
45Number of bytes after starting point to discard. Provided value will be
46aligned to the device sector size. If the specified value extends past the
47end of the device,
48.B blkdiscard
49will stop at the device size boundary. Default value extends to the end
50of the device.
51.IP "\fB\-s, \-\-secure\fP"
52Perform secure discard. Secure discard is the same as regular discard except
53all copies of the discarded blocks possibly created by garbage collection must
54also be erased. It has to be supported by the device.
55.IP "\fB\-v, \-\-verbose\fP"
56Print aligned \fIoffset\fR and \fIlength\fR arguments.
57
58.SH AUTHOR
59.nf
60Lukas Czerner <lczerner@redhat.com>
61.fi
62.SH SEE ALSO
63.BR fstrim (8)
64.SH AVAILABILITY
65The blkdiscard command is part of the util-linux package and is available
66from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.