From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RDkUT-0004ik-EC for garchives@archives.gentoo.org; Tue, 11 Oct 2011 22:08:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE27621C09A; Tue, 11 Oct 2011 22:07:42 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id B69A921C059 for ; Tue, 11 Oct 2011 22:05:52 +0000 (UTC) Received: by wyf19 with SMTP id 19so72493wyf.40 for ; Tue, 11 Oct 2011 15:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:organization :x-mailer:mime-version:content-type:content-transfer-encoding; bh=rdN5KgZtqdiDTRQRwz++z1slZKtVEo2R15d8oBEM9oc=; b=dlZElZDwlf4iQhEPCXqtTwMcffNZW4EztcyKV2mUKwNqGppcQwTFeM0zWIT3wz/p2m EBPwb3cR1qz4lEdkHC7CCWf7S5sBTNYUb+ZykQmQTSmwN6u3g0QZvz4m+GgcTsIeqWUt iNxTcUc+ZJ02JAzC04x2NIYM0ZUiA85ui4/Rw= Received: by 10.227.10.206 with SMTP id q14mr1288767wbq.32.1318370750090; Tue, 11 Oct 2011 15:05:50 -0700 (PDT) Received: from rohan.example.com ([196.215.144.38]) by mx.google.com with ESMTPS id fo7sm32113wbb.20.2011.10.11.15.05.47 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 15:05:48 -0700 (PDT) Date: Wed, 12 Oct 2011 00:05:38 +0200 From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] SSDs, ext4, fstrim, discard ... Message-ID: <20111012000538.2ee0d7de@rohan.example.com> In-Reply-To: <4E94AD7F.7050405@xunil.at> References: <4E94AD7F.7050405@xunil.at> Organization: Internet Solutions X-Mailer: Claws Mail 3.7.8 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: X-Archives-Hash: cd0e99b18f0b213febee4181b53414ed On Tue, 11 Oct 2011 22:56:31 +0200 "Stefan G. Weichinger" wrote: > > As mentioned in the systemd-posting I migrated back to an SSD today > (on my main rig, the thinkpad uses an SSD happily for a long time > now). > > A feature in a local magazine updated my knowledge of how to make use > of the TRIM-command. > > It told me not to use the mount-option "discard" anymore, but run > fstrim on the mountpoint frequently. > > OK, I learn ;-) > > But, AFAI understand, after trimming sectors/bytes on the > filesystem/partition, they should be trimmed. I expect X bytes to be > trimmed at first and if I repeat the command, I expect 0 (or something > pretty low) bytes to be trimmed then, ok? > > This is what I wonder about: > > ~ # fstrim -v / > /: 6195433472 bytes were trimmed > ~ # fstrim -v / > /: 6195433472 bytes were trimmed > ~ # fstrim -v / > /: 6195433472 bytes were trimmed > > > I tested it with "discard" on and off. > > / is ext4, yes, and on an SSD, yup. > > Do I misunderstand things here? Yes, you misunderstand how fstrim works. It's not up to you to say what it does exactly, it's up to the drive firmware and possibly the kernel. It's actually fully described in the man page right there in the part for option -v :-) A convenient on-line copy of the man page: http://www.vdmeulen.net/cgi-bin/man/man2html?fstrim+8 -- Alan McKinnnon alan.mckinnon@gmail.com