linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fstrim has no effect on a just-mounted filesystem
@ 2014-03-11 21:39 Richard W.M. Jones
  2014-03-11 21:47 ` Eric Sandeen
  0 siblings, 1 reply; 13+ messages in thread
From: Richard W.M. Jones @ 2014-03-11 21:39 UTC (permalink / raw)
  To: linux-ext4


Here's a problem I can't work out:

I have a filesystem (in a VM) that I know has at least 100MB of
deleted files on it.  Doing this in a script:

  mount -o discard /dev/sda1 /mnt
  fstrim /mnt

... does nothing.  Also the fstrim is almost instantaneous -- there's
no way it could be scanning the disk.

However, if I start with the same filesystem, mounted with -o discard,
and create and rm large files, while observing the size of the
underlying virtual disk, then discard is obviously working fine.  'rm'
of large files makes the underlying disk shrink.

Any ideas here?

Rich.

kernel: 3.12.5-302.fc20.x86_64
qemu: 1.7.0
virtio-scsi with discard=unmap

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

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

end of thread, other threads:[~2014-03-12 18:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 21:39 fstrim has no effect on a just-mounted filesystem Richard W.M. Jones
2014-03-11 21:47 ` Eric Sandeen
2014-03-11 22:00   ` Richard W.M. Jones
2014-03-11 22:04     ` Richard W.M. Jones
2014-03-11 22:08     ` Eric Sandeen
2014-03-11 22:59       ` Richard W.M. Jones
2014-03-11 23:07         ` Richard W.M. Jones
2014-03-11 23:09           ` Eric Sandeen
2014-03-11 23:30             ` Richard W.M. Jones
2014-03-12 10:17               ` Richard W.M. Jones
2014-03-12 13:42                 ` Richard W.M. Jones
2014-03-12 18:10                 ` Paolo Bonzini
2014-03-12 18:24                   ` Richard W.M. Jones

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