TRIM utility

Warner Losh imp at bsdimp.com
Fri Nov 23 22:42:00 UTC 2018


On Fri, Nov 23, 2018, 9:04 AM Rodney W. Grimes <
freebsd-rwg at pdx.rh.cn85.dnsmgr.net wrote:

> > On 23.11.2018 14:19, Poul-Henning Kamp wrote:
> >
> > >>> Currently it has four options, all of them are, hmm, optional:
> > > Isn't this the kind of thing that dd(1) should learn about instead ?
> >  One utility to done one thing very well? :-)
> >
> >  dd(1) is way overloaded, IMHO.
>
> I agree here, we do too much of trying to shoe horn things
> into existing utilities then we end up with a command parser
> that only a mother could love.
>
> trim, hdtrim, blktrim, camtrim, any of them
> are fine, fstrim is bad, this is not a filesystem op,
> too bad the next thing that comes
> along that is "trim" like well have to pick
> something other than trim.
>

Actually, you can now do the disk delete ioctl on a file range, and the
putative trim program does that... but we've settled on trim I think.

I might ask would it be horribly hard to access the
> "secure erase" feature from this utility?


Yes. It would. That's hard with the current storage stack to do via the
disk interface. And often the underlying protocols do not support partial
ranges. There is no good way to do this with buf/bio interface we have. So
it is a really bad match all the way around.

Or do we
> have another that can easily get at that function,
> that is usually the prefered vendor specific method
> to "trim" the complete drive, often restoring badly
> leveled SSD's to a performant and usable state.
>

Camcontrol already supports secure erase for both SCSI and ATA drives. And
sanitize for SCSI (an alternative way to do the same thing to reset the
ssd's FLT). It bypasses the disk interface and sends raw protocol commands
via the pass interface. I do this all the time to rehab drives, do
diagnosis of vendor issues or scrub ssds I'm sending to third parties.

Warner

-- 
> Rod Grimes
> rgrimes at freebsd.org
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list