From owner-freebsd-hackers@freebsd.org Fri Nov 23 22:42:00 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4947411333DA for ; Fri, 23 Nov 2018 22:42:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0597F77DC6 for ; Fri, 23 Nov 2018 22:41:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd32.google.com with SMTP id l14so9587683ioj.5 for ; Fri, 23 Nov 2018 14:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GsPYOcyxa1pH3/7XpC4OeJUByDW0kXPz2zx0fyHu+oA=; b=AGx/3n0fLWXX2sHj3HTM4JPI+CMevIOyx5PRjbe4h5s+El5uNN7OMcYUsABvQ+ae8T cK8rJrDOGOuBqL2j99EdsIPXWRsXag2e/g1HIWqxo5EUdZzQBQKQhzrB67jUPaQSkfYN CGDYrPT6QSFuSFMjdUPKTqh1FNRb7jSPX1QeZ8MDALBa2qk9oHeNkbqOQC4Y0ZKPdKLl g7nFqhLhaxItC9JFxYilbCvM7hQcHbDEFkZPFWjoE00grRPTfTfjCWwj7j+WLuZ8N8Bp tFfsz2qZdkoI8pti4Td6cR0sGagz6f7TYqJaqNuN0tmkh1Z0gl9IwNssRKwH9HgHN6+V L4Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GsPYOcyxa1pH3/7XpC4OeJUByDW0kXPz2zx0fyHu+oA=; b=FCmgyAZ7jR9fwGA4gGqb5g65AbjPxnx9hxU7oJHFHan0VoaipmFwtRxXu35g9m4ldK 4KkyN2E3VVLzn4l2V1IbARxh07s7kshOXrS+iCi/7r2uIkWxMdFTvKVGcjmAosAFY/uh 1t+ap5v/eJ7F1Uc3/Z46H0XUlVoCXl5420rsVEu3o3L/LiDfQOiKQH9dHVVWcv01Ju4O PbBPHPv4PNLQ2SeLrvVJs5+ZjSNweA/1x+CN/qiTGK3j6u4tIFLWTad8Q945KGDpLcZY MIxTRo7LwfQSjwxqy8gWNx6pKvtI5Lc6HDV/WNjSkyS/TuXlIZP5xVnOZQoDXDDjb7l2 iytw== X-Gm-Message-State: AA+aEWYxNLYzxCIeLo4/jHwSLVAwVoAo5q+3F4+ZjZsrHDODZ1J84dju +zS3j6uwh14ZrRlWoJLyPWapZfeRf+ha+EwvEiJiMQ== X-Google-Smtp-Source: AFSGD/Us+lGDorAA9J7tThFiJeqmX8gFrNtBoyyin4AxEudrafFnEf1VtBZkCBKQZn1KTC7W6e9reUPkZ1GWqQU4IFo= X-Received: by 2002:a5e:d808:: with SMTP id l8mr3054314iok.299.1543012918187; Fri, 23 Nov 2018 14:41:58 -0800 (PST) MIME-Version: 1.0 References: <201811231600.wANG0wHc083199@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811231600.wANG0wHc083199@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 23 Nov 2018 15:41:46 -0700 Message-ID: Subject: Re: TRIM utility To: "Rodney W. Grimes" Cc: Lev Serebryakov , FreeBSD Hackers , Poul-Henning Kamp , Eugene Grosbein X-Rspamd-Queue-Id: 0597F77DC6 X-Spamd-Result: default: False [-3.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.984,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.72)[ipnet: 2607:f8b0::/32(-2.02), asn: 15169(-1.48), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:42:00 -0000 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" >