util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Debugging why fstrim doesn't work
@ 2014-08-29  9:35 Matthias Schniedermeyer
  2014-09-01  6:34 ` Bernhard Voelker
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Schniedermeyer @ 2014-08-29  9:35 UTC (permalink / raw)
  To: util-linux

Hi


All of my computers have a SSD for the root-filesystem.
But on none fstrim works. I only get this:

$ fstrim -v /
fstrim: /: discard operation not supported.

How can i debug why fstrim/the kernel thinks discard isn't supported?

All my root-filesystems are XFS.
kernel differs by computer, currently between 3.15.2 and 3.16.1
(Same self-compiled kernel on all machines)
util-linux is version 2.25 (Experimental Package from Debian SID)

The mount-output for the root-filesystem of one my compters looks like 
this:
/dev/sda2 on / type xfs (rw,noatime,attr2,inode64,allocsize=64k,noquota)

I DO NOT use an initrd/initramfs, so the root-filesystem is still the 
original mount from the kernel itself (i case that matters)




-- 

Matthias

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

* Re: Debugging why fstrim doesn't work
  2014-08-29  9:35 Debugging why fstrim doesn't work Matthias Schniedermeyer
@ 2014-09-01  6:34 ` Bernhard Voelker
  2014-09-01  7:16   ` Matthias Schniedermeyer
  0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Voelker @ 2014-09-01  6:34 UTC (permalink / raw)
  To: Matthias Schniedermeyer, util-linux

On 08/29/2014 11:35 AM, Matthias Schniedermeyer wrote:
> $ fstrim -v /
> fstrim: /: discard operation not supported.
> 
> How can i debug why fstrim/the kernel thinks discard isn't supported?

  $ strace -v fstrim -v /
  ...
  ioctl(3, FITRIM, 0x7fff4d693590)        = -1 EOPNOTSUPP (Operation not supported)
  ...

Interestingly, fstrim's error message has changed from the more precise

  fstrim: /: FITRIM ioctl failed: Operation not supported

(e.g. in 2.23.2) to a probably more user-friendly

  fstrim: /: the discard operation is not supported

(in the current git version).

Have a nice day,
Berny


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

* Re: Debugging why fstrim doesn't work
  2014-09-01  6:34 ` Bernhard Voelker
@ 2014-09-01  7:16   ` Matthias Schniedermeyer
  2014-09-01  7:57     ` Matthias Schniedermeyer
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Schniedermeyer @ 2014-09-01  7:16 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux

On 01.09.2014 08:34, Bernhard Voelker wrote:
> On 08/29/2014 11:35 AM, Matthias Schniedermeyer wrote:
> > $ fstrim -v /
> > fstrim: /: discard operation not supported.
> > 
> > How can i debug why fstrim/the kernel thinks discard isn't supported?
> 
>   $ strace -v fstrim -v /
>   ...
>   ioctl(3, FITRIM, 0x7fff4d693590)        = -1 EOPNOTSUPP (Operation not supported)
>   ...
> 
> Interestingly, fstrim's error message has changed from the more precise
> 
>   fstrim: /: FITRIM ioctl failed: Operation not supported
> 
> (e.g. in 2.23.2) to a probably more user-friendly
> 
>   fstrim: /: the discard operation is not supported
> 
> (in the current git version).

I don't get 'Operation not supported".

I get this error:
open("/", O_RDONLY|O_LARGEFILE)         = 3
fstat64(3, {st_dev=makedev(8, 2), st_ino=192, st_mode=S_IFDIR|0755, st_nlink=25, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2014/07/02-21:06:38, st_mtime=2014/07/19-23:54:25, st_ctime=2014/07/19-23:54:25}) = 0
ioctl(3, FITRIM, 0xfffa6198)            = -1 ENOTTY (Inappropriate ioctl for device)
close(3)                                = 0





-- 

Matthias

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

* Re: Debugging why fstrim doesn't work
  2014-09-01  7:16   ` Matthias Schniedermeyer
@ 2014-09-01  7:57     ` Matthias Schniedermeyer
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Schniedermeyer @ 2014-09-01  7:57 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux

On 01.09.2014 09:16, Matthias Schniedermeyer wrote:
> On 01.09.2014 08:34, Bernhard Voelker wrote:
> > On 08/29/2014 11:35 AM, Matthias Schniedermeyer wrote:
> > > $ fstrim -v /
> > > fstrim: /: discard operation not supported.
> > > 
> > > How can i debug why fstrim/the kernel thinks discard isn't supported?
> > 
> >   $ strace -v fstrim -v /
> >   ...
> >   ioctl(3, FITRIM, 0x7fff4d693590)        = -1 EOPNOTSUPP (Operation not supported)
> >   ...
> > 
> > Interestingly, fstrim's error message has changed from the more precise
> > 
> >   fstrim: /: FITRIM ioctl failed: Operation not supported
> > 
> > (e.g. in 2.23.2) to a probably more user-friendly
> > 
> >   fstrim: /: the discard operation is not supported
> > 
> > (in the current git version).
> 
> I don't get 'Operation not supported".
> 
> I get this error:
> open("/", O_RDONLY|O_LARGEFILE)         = 3
> fstat64(3, {st_dev=makedev(8, 2), st_ino=192, st_mode=S_IFDIR|0755, st_nlink=25, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2014/07/02-21:06:38, st_mtime=2014/07/19-23:54:25, st_ctime=2014/07/19-23:54:25}) = 0
> ioctl(3, FITRIM, 0xfffa6198)            = -1 ENOTTY (Inappropriate ioctl for device)
> close(3)                                = 0

And the answer is:
32bit userspace and 64bit kernels don't mix (in this case).

I've tested the 64bit version of fstrim and it worked.




-- 

Matthias

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

end of thread, other threads:[~2014-09-01  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29  9:35 Debugging why fstrim doesn't work Matthias Schniedermeyer
2014-09-01  6:34 ` Bernhard Voelker
2014-09-01  7:16   ` Matthias Schniedermeyer
2014-09-01  7:57     ` Matthias Schniedermeyer

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