On Thu, Apr 10, 2014 at 11:17:04AM +0200, Ruediger Meier wrote: > Thanks, maybe we could add another minor change to "fstrim -a" itself. > If possible it would be IMO useful to skip bind mounts to avoid > trimming the same filesystem several times in a row like this: > > $ grep "tmp" /etc/fstab > /dev/vg0/tmpdirs /mnt/tmpdirs ext4 acl,user_xattr 1 2 > /mnt/tmpdirs/tmp /tmp none bind 0 0 > /mnt/tmpdirs/var/tmp /var/tmp none bind 0 0 > > $ ./fstrim -av > /tmp: 392 KiB (401408 bytes) trimmed > /var/tmp: 0 B (0 bytes) trimmed > /mnt/tmpdirs: 0 B (0 bytes) trimmed > > Skipping bind mounts should still trim all mounted filesytems. Good idea point, but what about systems where the original mountpoint is umounted? /dev/sda1 /foo ext4 default /foo /bar none bind # mount /foo # mount /bar # umount /foo the another story is that we use /proc/self/mountinfo where is nothing about "bind". It would be probably better to de-duplicate the list of the filesystems according to filesystem UUID or so. I'll think about it. Note all this is probably no problema for ext4 where according to Lukas is optimization to not call device trim command when there is nothing to trim. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html