How to use trim command ?

Allan Jude allanjude at freebsd.org
Sat Dec 1 03:11:14 UTC 2018


On 2018-11-30 19:31, Masachika ISHIZUKA wrote:
>>>   I'm using FreeBSD 13.0-CURRENT r341327.
>>>   I want to use trim command.
>>
>> It seems this partition is in use (mounted?) and GEOM won't allow to write
>> to opened partition, you need to close it first (unmount).
>> Be warned: trim will destroy all data in the partition.
> 
>   Thank you for reply.
> 
>   I misunderstood trim was equivalent to fstrim in linux.
>   I undotstood that the trim command is the SSD bulk erase tool.
> 

If you want to enable TRIM on a UFS filesystem, tunefs is the command
you are looking for.

The equivalent to fstrim for UFS is fsck_ffs -E:

Clear unallocated blocks, notifying the underlying device that they are
not used and that their contents may be discarded.  This is useful for
filesystems which have been mounted on systems without TRIM support, or
with TRIM support disabled, as well as filesystems which have been
copied from one device to another.

See also the -E and -t flags of newfs(8), and the -t flag of tunefs(8).


-- 
Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20181130/9632f3ae/attachment.sig>


More information about the freebsd-hackers mailing list