Date: Fri, 23 Nov 2018 15:41:46 -0700 From: Warner Losh <imp@bsdimp.com> To: "Rodney W. Grimes" <freebsd-rwg@pdx.rh.cn85.dnsmgr.net> Cc: Lev Serebryakov <lev@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Eugene Grosbein <eugen@grosbein.net> Subject: Re: TRIM utility Message-ID: <CANCZdfrnSw=06NfkwnowjJpiqbd3BN882nyFi%2ByWrsuYthEKoQ@mail.gmail.com> In-Reply-To: <201811231600.wANG0wHc083199@pdx.rh.CN85.dnsmgr.net> References: <ca200443-f997-4d84-cbd5-592243714898@FreeBSD.org> <201811231600.wANG0wHc083199@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 23, 2018, 9:04 AM Rodney W. Grimes < freebsd-rwg@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@freebsd.org > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrnSw=06NfkwnowjJpiqbd3BN882nyFi%2ByWrsuYthEKoQ>