1BLKDISCARD(8) System Administration BLKDISCARD(8)
2
3
4
6 blkdiscard - discard sectors on a device
7
9 blkdiscard [-o offset] [-l length] [-s] [-v] device
10
12 blkdiscard is used to discard device sectors. This is useful for
13 solid-state drivers (SSDs) and thinly-provisioned storage. Unlike
14 fstrim(8) this command is used directly on the block device.
15
16 By default, blkdiscard will discard all blocks on the device. Options
17 may be used to modify this behavior based on range or size, as
18 explained below.
19
20 The device argument is the pathname of the block device.
21
22 WARNING: All data in the discarded region on the device will be lost!
23
25 The offset and length arguments may be followed by the multiplicative
26 suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB
27 and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB")
28 or the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB
29 and YB.
30
31 -h, --help
32 Print help and exit.
33
34 -o, --offset offset
35 Byte offset in the device from which to discard. Provided value
36 will be aligned to the device sector size. Default value is
37 zero.
38
39 -l, --length length
40 Number of bytes after starting point to discard. Provided value
41 will be aligned to the device sector size. If the specified
42 value extends past the end of the device, blkdiscard will stop
43 at the device size boundary. Default value extends to the end
44 of the device.
45
46 -s, --secure
47 Perform secure discard. Secure discard is the same as regular
48 discard except all copies of the discarded blocks possibly cre‐
49 ated by garbage collection must also be erased. It has to be
50 supported by the device.
51
52 -v, --verbose
53 Print aligned offset and length arguments.
54
56 Lukas Czerner ⟨lczerner@redhat.com⟩
57
59 fstrim(8)
60
62 The blkdiscard command is part of the util-linux package and is avail‐
63 able Linux Kernel Archive ⟨ftp://ftp.kernel.org/pub/linux/utils/util-
64 linux/⟩.
65
66
67
68util-linux October 2012 BLKDISCARD(8)