Hi,

Richard W.M. Jones wrote:
> When you run the 'fstrim' command on an ntfs-3g 2014.2.15 mountpoint
> it says:
>
>    fstrim: fstrim: /sysroot/: discard operation not supported.
>
> I wonder if anyone has looked at how hard it would be to support this?
> In the virt application I am writing it would make a massive
> difference in performance if we are able to tell the hypervisor which
> sectors are used and which are free.
>
> fstrim is an ioctl (FITRIM).  I guess this ioctl would have to be
> passed through fuse.  Latest fuse code doesn't mention fstrim or
> FSTRIM at all, and the fuse FAQ mentions that ioctl() is not generally
> supported (but maybe it's OK for specific cases?)

Currently no ioctl is supported by ntfs-3g.
AFAIK, fuse just forwards ioctls so that each file
system can support those which are found useful.

>
> Then the ntfs-3g module would have to do something with that.  Does
> ntfs-3g "know" precisely which sectors contain data and which are
> unused, or is there some uncertainty about this because of the
> undocumented nature of the disk format?

ntfs-3g known precisely which clusters are in use
(there is a global bitmap telling which ones are
allocated). The unitary trimming unit may be bigger
than a cluster, and some read-trim-write procedure may
be needed to trim properly. Also note that there
is nothing to record which sectors have already been
trimmed, and just relying on the bitmap will imply
trimming the unused sectors multiple times.

Trimming while deallocating clusters is probably a
better way to go (unless this would imply too many
read-trim-write sequences).

> If this is not too hard I might have a go at it, but I don't want to
> start something that you already know is not going to be possible for
> some reason :-)

Please do, I will give a hand if needed.

Regards

Jean-Pierre

>
> Rich.
>


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to