util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Questions concerning fstrim and online discard.
@ 2012-10-04  4:47 Andreas Hartmann
       [not found] ` <alpine.LFD.2.00.1210151649540.15261@dhcp-1-104.brq.redhat.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Hartmann @ 2012-10-04  4:47 UTC (permalink / raw)
  To: util-linux

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-17 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04  4:47 Questions concerning fstrim and online discard Andreas Hartmann
     [not found] ` <alpine.LFD.2.00.1210151649540.15261@dhcp-1-104.brq.redhat.com>
2012-10-16 16:28   ` Andreas Hartmann
2012-10-16 19:07     ` Lukáš Czerner
2012-10-17 17:28       ` Andreas Hartmann
2012-10-17 19:23         ` Milan Broz

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).