BLKDISCARD(8) | System Manager's Manual | BLKDISCARD(8) |
blkdiscard
—
blkdiscard |
[-h ] [-l
length] [-p
chunksize] [-n ]
[-o firstbyte]
[-R ] [-s ]
[-V ] [-v ]
[-z ] file |
fdiscard |
[-f firstbyte]
[-h ] [-l
length] [-m
chunksize] [-n ]
[-R ] [-s ]
[-V ] [-v ]
[-z ] file |
blkdiscard
program can be used to discard portions
of storage, and works on either device files directly or upon files inside of
a mounted file-system. It provides access to the
fdiscard(2) system call, and
relies upon the backing device to have support in both the
blkdiscard
driver and in the hardware itself.
The fdiscard
interface defaults to the
“no-run” mode and requires the -R
option to perform any actions.
-f
firstbyte-h
-l
length-m
chunksize-n
-o
firstbyte-f
flag.-p
chunksize-m
flag.-R
-s
-V
-v
-z
# blkdiscard -n -v filename # blkdiscard -n -v /dev/rwd0b
To discard all the blocks on a swap device:
# blkdiscard -v /dev/rwd0b
To discard all but the first 256MiB of a device, using 128MiB increments:
# blkdiscard -v -f 256m -m 128m /dev/rwd0c
To zero out the contents of a file or device:
# blkdiscard -v -z filename # blkdiscard -v -z /dev/device
blkdiscard
command first appeared linux-util. This
implementation was originally called fdiscard-stuff and has been converted to
be blkdiscard(8) compatible
and appeared in NetBSD 10.0.
blkdiscard
command was written by
Matthew R. Green ⟨mrg@eterna23.net⟩.
-s
option is not
yet implemented.
January 13, 2024 | NetBSD 10.1 |