How to check TRIM

ext4fstrimssdstoragetrim

I have Linux installed on a Dell XPS 9343 with an Samsung PM851 SSD.
I recently read that many SSDs don't support TRIM operations.
So I'd like to check if discard option effectively works on my system.

At first step, I tried to simply run sudo fstrim --verbose --all and it reported 41GB trimmed; this makes me fear because I was expecting a really little value because I have the continuously TRIM enabled (see above); in fact, if I re-run that command again I get O bytes trimmed. Is it normal? even if I have the discard option in the /etc/fstab?

PS: I tried to follow the proposed solution here but it stucks on the second command due to trim.test: FIBMAP unsupported.
PS2: it's a flat SSD (no LVM or RAID) with GPT and EXT4 filesystem

Best Answer

Try lsblk -D

TRIM/discard is available, if the DISC-MAX column is not 0B

Example (SSD/trim available)

[root@foo bar]# lsblk -D
NAME   DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda           0        4K       1G         0

Example (HDD/trim not available)

[root@foo bar]# lsblk -D
NAME   DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda           0        0B       0B         0
Related Question