Running ntfs-3g 2017.3.23 on Arch Linux. fstrim (util-linux) 2.33. I see ntfs-3g gained discard support quite some time ago, but haven't been able to get it to work.
I initially wanted to trim a virtual machine's partition, so ran: # kpartx -a /dev/lvm/windows7extra # mount /dev/mapper/lvm-windows7extra1 /mnt # fstrim -v /mnt fstrim: /mnt: the discard operation is not supported To determine if "kpartx" was to blame, I tried without it: # umount /mnt # lvcreate --virtualsize 10G --thin lvm/thinpool --name ntfs # mkfs.ntfs /dev/lvm/ntfs # mount /dev/lvm/ntfs /mnt # fstrim -v /mnt/ntfs fstrim: /mnt: the discard operation is not supported strace shows it's running ioctl(3, FITRIM...) and getting "-1 EOPNOTSUPP (Operation not supported)". You can see one of the straces I ran here: https://termbin.com/zhzu It's because of this ioctl that I'm starting here rather than util-linux. It makes me think "fstrim" is at least attempting to give "ntfs-3g" the trim command. I saw that ntfs-3g doesn't support old Windows (before ~2008) partitions. This is a fresh Windows 7 installation, that created an NTFS volume on this additional LVM volume I'm giving it. I routinely "fstrim" btrfs volumes running through LVM, never having a problem with those. # fdisk -l /dev/lvm/windows7extra Disk /dev/lvm/windows7extra: 100 GiB, 107374182400 bytes, 209715200 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 65536 bytes / 65536 bytes Disklabel type: dos Disk identifier: 0xcfc33fd9 Device Boot Start End Sectors Size Id Type /dev/lvm/windows7extra1 2048 209711103 209709056 100G 7 HPFS/NTFS/exFAT # mount | grep mnt /dev/mapper/lvm-windows7extra1 /mnt fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096) _______________________________________________ ntfs-3g-devel mailing list ntfs-3g-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel