Site icon New Generation Enterprise Linux

Force your SSD to actually clear out its deleted blocks

Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)

Force your SSD to actually clear out its deleted blocks

đź§© The Challenge

You delete a massive log directory on a virtual machine, but the host still thinks the disk is full and refuses to provision more space. It is beyond annoying watching your hypervisor throw out-of-space alerts when you know for a fact the file is gone.

đź’ˇ The Fix

Manually invoke a discard operation to tell the SSD controller which blocks are ready for garbage collection. This clears the deck for the underlying hardware to reclaim space the OS thinks is still “in use”.

fstrim -av

⚙️ Why It Works

Running this tells the filesystem to walk through all the unallocated blocks and send a trim command to the underlying storage hardware. Without this, your thin-provisioned disks stay bloated even if they have plenty of empty room.

🚀 Pro-Tip: Stick it in a weekly cron job if your distribution’s default systemd timer keeps failing.

Linux Tips & Tricks | © ngelinux.com | 10/13/2026

0 0 votes
Article Rating
Exit mobile version