man-pages/man8/blkdiscard.8.html
2021-03-31 01:06:50 +01:00

157 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of BLKDISCARD</TITLE>
</HEAD><BODY>
<H1>BLKDISCARD</H1>
Section: System Administration (8)<BR>Updated: July 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
blkdiscard - discard sectors on a device
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>blkdiscard</B>
[options]
[<B>-o</B>
<I>offset</I>]
[<B>-l</B>
<I>length</I>]
<I>device</I>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>blkdiscard</B>
is used to discard device sectors. This is useful for solid-state
drivers (SSDs) and thinly-provisioned storage. Unlike
<B><A HREF="/cgi-bin/man/man2html?8+fstrim">fstrim</A></B>(8),
this command is used directly on the block device.
<P>
By default,
<B>blkdiscard</B>
will discard all blocks on the device. Options may be used to modify
this behavior based on range or size, as explained below.
<P>
The
<I>device</I>
argument is the pathname of the block device.
<P>
<B>WARNING: All data in the discarded region on the device will be lost!</B>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
The
<I>offset</I>
and
<I>length</I>
arguments may be followed by the multiplicative suffixes KiB (=1024),
MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the &quot;iB&quot; is
optional, e.g., &quot;K&quot; has the same meaning as &quot;KiB&quot;) or the suffixes
KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
<DL COMPACT>
<DT id="1"><B>-o</B>,<B> --offset </B><I>offset</I>
<DD>
Byte offset into the device from which to start discarding. The provided value
will be aligned to the device sector size. The default value is zero.
<DT id="2"><B>-l</B>,<B> --length </B><I>length</I>
<DD>
The number of bytes to discard (counting from the starting point). The provided value
will be aligned to the device sector size. If the specified value extends past
the end of the device,
<B>blkdiscard</B>
will stop at the device size boundary. The default value extends to the end
of the device.
<DT id="3"><B>-p</B>,<B> --step </B><I>length</I>
<DD>
The number of bytes to discard within one iteration. The default is to discard
all by one ioctl call.
<DT id="4"><B>-s</B>,<B> --secure</B>
<DD>
Perform a secure discard. A secure discard is the same as a regular discard
except that all copies of the discarded blocks that were possibly created by
garbage collection must also be erased. This requires support from the device.
<DT id="5"><B>-z</B>,<B> --zeroout</B>
<DD>
Zero-fill rather than discard.
<DT id="6"><B>-v</B>,<B> --verbose</B>
<DD>
Display the aligned values of
<I>offset</I>
and
<I>length</I>.
If the <B>--step</B> option is specified, it prints the discard progress every second.
<DT id="7"><B>-V</B>,<B> --version</B>
<DD>
Display version information and exit.
<DT id="8"><B>-h</B>,<B> --help</B>
<DD>
Display help text and exit.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
Lukas Czerner
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+fstrim">fstrim</A></B>(8)
<A NAME="lbAH">&nbsp;</A>
<H2>AVAILABILITY</H2>
The blkdiscard command is part of the util-linux package and is available
Linux Kernel Archive
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
<DT id="10"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="11"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="12"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="13"><A HREF="#lbAF">AUTHOR</A><DD>
<DT id="14"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="15"><A HREF="#lbAH">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:11 GMT, March 31, 2021
</BODY>
</HTML>