How to use trim command ?

Eugene Grosbein eugen at grosbein.net
Fri Nov 30 20:32:54 UTC 2018


30.11.2018 23:14, Masachika ISHIZUKA wrote:

>   I'm using FreeBSD 13.0-CURRENT r341327.
>   I want to use trim command.
> 
> # trim /dev/gpt/fbroot-current
> trim `/dev/gpt/fbroot-current' offset 0 length 60568829952
> dry run: add -f to actually perform the operation
> # trim -f /dev/gpt/fbroot-current
> trim `/dev/gpt/fbroot-current' offset 0 length 60568829952
> trim: `/dev/gpt/fbroot-current': Operation not permitted
> carrot# echo $status
> 66
> 
>   How can I use /usr/sbin/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.




More information about the freebsd-hackers mailing list