TRIM Support: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→ext4) |
||
Line 8: | Line 8: | ||
fstrim -v /somewhere | fstrim -v /somewhere | ||
</pre> | </pre> | ||
The resulting amount of space trimmed may not be the same as the actual space freed on the disk | The resulting amount of space trimmed may not be the same as the actual space freed on the disk. It is safe to repeat this, for example in a cronjob. | ||
<pre> | <pre> | ||
/somewhere: 3 GiB (3267461120 bytes) trimmed | /somewhere: 3 GiB (3267461120 bytes) trimmed |
Revision as of 12:47, 2 September 2022
ext4
TRIM support is available on ext4. It is activated by adding discard to the list of mount options. So in /etc/fstab it says something like:
/dev/sdx1 /somewhere ext4 defaults,discard 1 1
You can also discard the unused blocks manually by using:
fstrim -v /somewhere
The resulting amount of space trimmed may not be the same as the actual space freed on the disk. It is safe to repeat this, for example in a cronjob.
/somewhere: 3 GiB (3267461120 bytes) trimmed
ntfs on windows
TRIM support is available on ntfs and refs. You can check if it's active by using the following command:
fsutil behavior query disabledeletenotify
The response will be like this:
NTFS DisableDeleteNotify = 0 (Disabled) ReFS DisableDeleteNotify = 0 (Disabled)
A value of 0 means that it's not disabled, so that TRIM support is active.