util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Hartmann <andihartmann@01019freenet.de>
To: util-linux@vger.kernel.org
Subject: Questions concerning fstrim and online discard.
Date: Thu, 4 Oct 2012 06:47:36 +0200	[thread overview]
Message-ID: <20121004064736.64caef77@dualc.maya.org> (raw)

Hello!

Please, may I ask you some questions because I'm a little bit confused
about the behaviour of fstrim and online discard (ext4)?


I'm using the following configuration / partitioning with a SSD
(Controller: SF-2281; Corsair Force GT 240GB):

- dm_crypt: cryptsetup luksOpen - version 1.4.1, device-mapper
  version 1.02.75
- lvm version 2.02.96
- ext4, option discard; kernel version 3.4.11

All seems to work fine, I can't see any errors in messages or in dmesg
according trim / discard.

Now, I tested fstrim from util-linux version 2.19, and surprisingly got
this unexpected error:

fstrim: /: FITRIM ioctl failed: Operation not supported

Why do I get this error? Online discard always seemed to work fine (= I
didn't get any error).

I detected, that there is another necessary option to get a
working fstrim:
cryptsetup luksOpen must be run with option --allow-discards.


Now my questions:
- Did online discard work without --allow-discards? If not, why didn't I
  get any error message?
- Is there a difference between online discard and fstrim, means,
  fstrim doesn't work without --allow-discards, but online discard does?
- fstrim / always says after each reboot:
  /: 1701429248 bytes was trimmed
  This can't be true as the root partition contains mainly root and
  nothing else (no /var or /usr or even /opt). There has been no
  changes in fs since last power on / off cycle and fstrim during the
  last cycle.
  Doesn't fstrim remember the already trimmed regions? Does it trim
  always the complete unused regions?
- Which trim should be used with a SF-2281 controller concerning
  endurance? fstrim or online discard?


Thank you very much for your advice!
Kind regards,
Andreas

             reply	other threads:[~2012-10-04  4:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04  4:47 Andreas Hartmann [this message]
     [not found] ` <alpine.LFD.2.00.1210151649540.15261@dhcp-1-104.brq.redhat.com>
2012-10-16 16:28   ` Questions concerning fstrim and online discard Andreas Hartmann
2012-10-16 19:07     ` Lukáš Czerner
2012-10-17 17:28       ` Andreas Hartmann
2012-10-17 19:23         ` Milan Broz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121004064736.64caef77@dualc.maya.org \
    --to=andihartmann@01019freenet.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).