A compact guide to using blkdiscard to tell block devices to release unused blocks and reclaim capacity. 08.07.2026 | reading time: 3 min When an SSD or a thin-provisioned block device holds blocks that the OS no longer uses, the kernel can issue discard (TRIM) commands; `blkdiscard` is the low-level utility that sends those commands to a device to mark blocks as free at the device level, helping reclaim space and improve performance. Practical cleanup Inspect discard capability and run a targeted discard with two simple commands shown below; the first checks whether the device supports discard and the second issues the discard: ```lsblk -D /dev/sdb; sudo blkdiscard -v /dev/sdb```; you should run this as root and will see a confirmation or progress output when the device accepts discard requests. Where blkdiscard shines Use `blkdiscard` on whole devices or on device ranges when you control the block device directly, for example when preparing an image, reclaiming space on a detached cloud volume, or trimming a thin LVM volume; prefer unmounting the filesystem or using filesystem-aware tools for live systems, because filesystem-level operations may be required to avoid data loss and to ensure consistency. Things to watch out for Not every device honors discard: some virtual disks or older SSD firmware treat discard as a no-op, and some cloud providers require special steps; also, secure deletion is different from discard on many devices, so verify behavior before relying on blkdiscard for sanitization. Complementary commands Combine `blkdiscard` with filesystem and device inspection tools for safe workflows: use `lsblk -D` to view discard info, prefer `fstrim` for mounted filesystems, and use vendor utilities like `nvme-cli` for NVMe-specific features and diagnostics. Final perspective `blkdiscard` is a focused tool: simple to use, powerful when device support exists, and part of a broader toolbox for storage maintenance; learn to choose between device-level discards and filesystem-level trimming to work safely and effectively, and keep exploring Linux storage tools to deepen practical skills and prepare for certifications such as CompTIA Linux+ or LPIC-1 with intensive study at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. storage filesystem utilities virtualization This page was created with the help of AI.