How can I see how much space was freed by trim on an SSD?
1
vote
1
answer
52
views
In my current setup, I have three different filesystems on two different SSDs: A FAT partition and a BTRFS partition on one drive, and ext4 on a second drive. When running
fstrim
, [the output is apparently](https://www.reddit.com/r/linuxquestions/comments/vaahg7/comment/ic1es8n/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) [not very usable](https://superuser.com/a/1251947/277646) and basically each of those filesystems reports some meaningless value for the amount that got trimmed.
Since truly [free space on an SSD contributes to its performance](https://cdn.mos.cms.futurecdn.net/3XW98AqWgfM956j5FGcodL.png) , at least for QLC NAND modules that use an SLC cache, I wanted to see if I could determine the impact of running fstrim
.
I know that utilities like df
and duf
, as well as lsblk
provide usage information based on the filesystem, but are there any utilities that can show the drive sectors that are in use vs free?
If my understanding of how TRIM on an SSD works is correct, then the filesystem will show reduced space immediately upon deleting a file, but those sectors are still considered in use by the SSD controller. After TRIM, those sectors would be freed. I'm hoping for a way to see the extent of that
Asked by Hari
(130 rep)
Jul 27, 2025, 05:24 AM
Last activity: Jul 29, 2025, 09:28 AM
Last activity: Jul 29, 2025, 09:28 AM