From owner-freebsd-hackers@freebsd.org Fri Nov 30 23:57:14 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 5EAED1153C6A for ; Fri, 30 Nov 2018 23:57:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E1BE77D44F for ; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A4FAD1153C69; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) Delivered-To: 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 8256A1153C68 for ; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2D727D44D for ; Fri, 30 Nov 2018 23:57:12 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1543622214; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=r1eLDrWGSJxAEihZhfO6+27gHUARIUiQDds+A+vJKesOAsHuaqwIy+MLpiU0r7Ech8xM+l07GlR/D 7xjAL4jiH2wtbh7HvgzG2eiZ7+r8L4NMy1p9GPvldRXgEpzkxNMHJ60FOLXZQpZ/zJvIPOAFCLGVSm XtFvpSM2tBUncxze68Q1SkBmFEfzi/LwoylOlDP/oeIppNJwNsYj3x8tgUwXGcWA0vxZ/V3fXn/mov PcOSy2a16Zu0R5t3RlpOCmv8hsQAeBu4lzYdhR+4eSy4f+sMgxxSxwloI/zalwB5z0QSerif1BewtQ XehL5ArnIXdEO4Sf+q82gOrPUeEr8pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=QYMc44axdUGBiJIZ4eWxRNzccQTcKk9l/aGzzTBSq4I=; b=VrAcgD5UL86KtKVvXodxCqKb/wTsAjMF0v3wlNi336XhZIyAlFVQbBpZleMwDWIB/yvzSblKs4E1A WJUml0e5TNtqUPArdyw5Bo51JGZlzzOySwIq480/qISqTzJ7JWw8FdOA/sd7Lrz8J2VoS64DLesWgL zDCpM51P+pil9bbiyfJCDsJvuHm1/Sg/UUgnuJcLk/DATSjyJAxJCrWHSUuhaHkMvxLwVfsAlBxCWB au99m8VKV6RJCgzCeRLPlMzPVY1PsMN8oCcxgr7jFy0lu86/wokI6nicY7jHE/SjIqQSY9F18EtxTh GOXOvBcBLppvSwfsSP4h5ra8AOdDV2Q== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=QYMc44axdUGBiJIZ4eWxRNzccQTcKk9l/aGzzTBSq4I=; b=l9k/dcIqAmAOqmr4aGhbrz9jY6+vGN1d2QpvLUVouCCKAHywm7D0i8/2rZxe4TKGGQF3G1wUZ+2KS PcYwZs5RqM/qzMw/mra2tnler8zJcaW87Hl/Bq2fp4TJAoA2XcjGtQijnL0it3UjPWuieNlyx8XDEj Ptg9QSyuGp5RYDmx77oabQPnRcS7dNvQGq/3ynMp1KX3JAudXcbaoa0E8C0wO34Xn+/9Gh2ve66hVm yPd+PQTlZQe3soUmp/q0jHYMDpWjGN7EQHurq+IGGfeLi9Fs3/YbVT3sLKu68Xops8bSNiW9rnTlOJ a+Al22XNt4U04Uet4+ncxmp1Tl7KtYw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9a392ab1-f4fb-11e8-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 9a392ab1-f4fb-11e8-a59a-7b143e15dabc; Fri, 30 Nov 2018 23:56:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAUNuwD5045243; Fri, 30 Nov 2018 16:57:00 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1543622218.1860.169.camel@freebsd.org> Subject: Re: How to use trim command ? From: Ian Lepore To: Eugene Grosbein , Masachika ISHIZUKA , hackers@freebsd.org Date: Fri, 30 Nov 2018 16:56:58 -0700 In-Reply-To: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1BE77D44F X-Spamd-Result: default: False [0.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.12)[0.124,0]; NEURAL_SPAM_MEDIUM(0.49)[0.494,0]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.051,0] X-Rspamd-Server: mx1.freebsd.org 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, 30 Nov 2018 23:57:14 -0000 On Sat, 2018-12-01 at 03:32 +0700, Eugene Grosbein wrote: > 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. And therein lies yet another reason why trim is such a horrible name for this tool: nothing about the word trim implies destroying live useful information. In idiomatic English, the word drips with overtones of removing only the unneeded excess from something. Truly, dd (with its 30+ years of association of being THE tool that operates on disk devices or specified sub-ranges of blocks within them) is the place for such functionality. -- Ian