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       -f, --force
32              Disable  all  checking.  Since v2.36 the block device is open in
33              exclusive mode (O_EXCL)  by  default  to  avoid  collision  with
34              mounted  filesystem  or  another  kernel  subsystem.   The force
35              option disables the exclusive access mode.
36
37       -o, --offset offset
38              Byte offset into the device from which to start discarding.  The
39              provided  value  must be aligned to the device sector size.  The
40              default value is zero.
41
42       -l, --length length
43              The number of bytes  to  discard  (counting  from  the  starting
44              point).  The provided value must be aligned to the device sector
45              size.  If the specified  value  extends  past  the  end  of  the
46              device,  blkdiscard  will stop at the device size boundary.  The
47              default value extends to the end of the device.
48
49       -p, --step length
50              The number of bytes to discard within one iteration. The default
51              is to discard all by one ioctl call.
52
53       -s, --secure
54              Perform  a  secure  discard.   A secure discard is the same as a
55              regular discard except that all copies of the  discarded  blocks
56              that  were  possibly  created by garbage collection must also be
57              erased.  This requires support from the device.
58
59       -z, --zeroout
60              Zero-fill rather than discard.
61
62       -v, --verbose
63              Display the aligned values of offset and length.  If the  --step
64              option  is  specified, it prints the discard progress every sec‐
65              ond.
66
67       -V, --version
68              Display version information and exit.
69
70       -h, --help
71              Display help text and exit.
72

AUTHORS

74       Lukas Czerner ⟨lczerner@redhat.com⟩
75

SEE ALSO

77       fstrim(8)
78

AVAILABILITY

80       The blkdiscard command is part of the util-linux package and is  avail‐
81       able Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
82       linux/⟩.
83
84
85
86util-linux                         July 2014                     BLKDISCARD(8)
Impressum