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