1BLKDISCARD(8)                System Administration               BLKDISCARD(8)
2
3
4

NAME

6       blkdiscard - discard sectors on a device
7

SYNOPSIS

9       blkdiscard [options] [-o offset] [-l length] device
10

DESCRIPTION

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

OPTIONS

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,
27       EiB,  ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning
28       as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and  so  on  for
29       GB, TB, PB, EB, ZB and YB.
30
31       -o, --offset offset
32              Byte offset into the device from which to start discarding.  The
33              provided value will be aligned to the device sector  size.   The
34              default value is zero.
35
36       -l, --length length
37              The  number  of  bytes  to  discard  (counting from the starting
38              point).  The provided value will be aligned to the device sector
39              size.   If  the  specified  value  extends  past  the end of the
40              device, blkdiscard will stop at the device size  boundary.   The
41              default value extends to the end of the device.
42
43       -p, --step length
44              The number of bytes to discard within one iteration. The default
45              is to discard all by one ioctl call.
46
47       -s, --secure
48              Perform a secure discard.  A secure discard is  the  same  as  a
49              regular  discard  except that all copies of the discarded blocks
50              that were possibly created by garbage collection  must  also  be
51              erased.  This requires support from the device.
52
53       -z, --zeroout
54              Zero-fill rather than discard.
55
56       -v, --verbose
57              Display  the aligned values of offset and length.  If the --step
58              option is specified, it prints the discard progress  every  sec‐
59              ond.
60
61       -V, --version
62              Display version information and exit.
63
64       -h, --help
65              Display help text and exit.
66

AUTHOR

68       Lukas Czerner ⟨lczerner@redhat.com⟩
69

SEE ALSO

71       fstrim(8)
72

AVAILABILITY

74       The  blkdiscard command is part of the util-linux package and is avail‐
75       able Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
76       linux/⟩.
77
78
79
80util-linux                         July 2014                     BLKDISCARD(8)
Impressum