Forrest logo
tool overview
On this page you find all important commands for the CLI tool blkdiscard. If the command you are looking for is missing please ask our AI.


  1. Blkdiscard is a command line tool used in Linux systems to discard blocks on a specified block device.
  2. It is part of the util-linux package, which provides various utilities for managing Linux systems.
  3. The blkdiscard command is mainly used for securely erasing data on SSDs (Solid State Drives) or other storage devices that support the discard command.
  4. By discarding blocks, the command informs the underlying storage device that the specified blocks are no longer in use and can be erased.
  5. This helps in maintaining the performance and longevity of SSDs by allowing the device to efficiently manage the available space.
  6. Blkdiscard can discard all blocks in a block device or can be limited to a specific range using the start and length parameters.
  7. It works on block devices, such as hard disk drives (HDDs), solid-state drives (SSDs), or even virtual disk images used in virtual machines.
  8. The command requires root privileges or superuser access to execute successfully.
  9. Blkdiscard is commonly used in conjunction with other utilities, such as shred or dd, to securely erase the content of a disk before disposal or repurposing.
  10. When used correctly, blkdiscard ensures that sensitive data cannot be easily recovered from a storage device, enhancing data privacy and security.

List of commands for blkdiscard:

  • blkdiscard:tldr:1ae1e blkdiscard: Securely discard all blocks on a device, removing all data.
    $ blkdiscard --secure /dev/${device}
    try on your machine
    explain this command
  • blkdiscard:tldr:a2605 blkdiscard: Discard the first 100 MB of a device.
    $ blkdiscard --length ${100MB} /dev/${device}
    try on your machine
    explain this command
  • blkdiscard:tldr:d54bb blkdiscard: Discard all sectors on a device, removing all data.
    $ blkdiscard /dev/${device}
    try on your machine
    explain this command
tool overview