TRIM utility

Wojciech Puchar wojtek at puchar.net
Fri Nov 23 08:34:32 UTC 2018


thanks. very useful tool

On Fri, 23 Nov 2018, Eugene Grosbein wrote:

> Hi!
>
> I found we have no utility capable to perform TRIM for the whole SSD device
> or arbitrary part of it, so I wrote simple one. I can't think of nice name
> for it, so proposal are welcome! Draft name is "erase".
>
> I ask for pre-commit code review, too.
> The code is tested with TRIM-capable SSD and non-capable other devices.
>
> Currently it has four options, all of them are, hmm, optional:
>
> -b: to specify offset from the beginning of the device for trimmed region instead of default 0;
> -l: to specify offset from the "-b" margin - length - for trimmed region instead of whole device;
> -r rfile: for alternative way to specify length as length of referenced file;
> -v: for verbose mode that shows final values for the beginning offset and length.
>
> Later options override previous ones. Then it expects a list of device names as arguments:
>
> erase ada0
> erase /dev/ada0s1
> erase -b 4096 -r file.img -v /dev/da0 /dev/da1 /dev/da2
>
> The code:
>
> http://www.grosbein.net/freebsd/erase.c
> http://www.grosbein.net/freebsd/Makefile.erase
>
> My "mandoc" skills are very poor and English is not my native language,
> so any help with manual page creation will be appreciated.
>
> Eugene Grosbein
>
> P.S. I realized that our kernel-level TRIM support has no connection to cam(4) nor to geom(4),
> so distinct utility instead of addition to camcontrol(8) or geom(8).
>
>


More information about the freebsd-hackers mailing list