blkdiscard

Discards device sectors on storage devices. Useful for SSDs. More information: <https://manned.org/blkdiscard>.

Install

All systems
curl cmd.cat/blkdiscard.sh
Debian Debian
apt-get install util-linux
Ubuntu
apt-get install util-linux
Alpine
apk add util-linux
Arch Arch Linux
pacman -S util-linux
image/svg+xml Kali Linux
apt-get install util-linux
CentOS
yum install util-linux
Fedora
dnf install util-linux
Windows (WSL2)
sudo apt-get update sudo apt-get install util-linux
OS X
brew install util-linux
Raspbian
apt-get install util-linux
Docker
docker run cmd.cat/blkdiscard blkdiscard powered by Commando

Discards device sectors on storage devices. Useful for SSDs. More information: <https://manned.org/blkdiscard>.

  • Discard all sectors on a device, removing all data:
    blkdiscard /dev/device
  • Securely discard all blocks on a device, removing all data:
    blkdiscard --secure /dev/device
  • Discard the first 100 MB of a device:
    blkdiscard --length 100MB /dev/device

© tl;dr; authors and contributors