On 08/10/14 23:24, Chad Seys wrote: > Hi Martin, > You might also be interested to know about 'lsblk' which looks like it can > detect whether discard is supported on device-mapper devices:
Indeed. I use the following script that automatically detects and trims devices that support it. Drop it under /etc/cron.daily or weekly: #!/bin/bash # # To find which FS support trim, we check that DISC-MAX (discard max bytes) # is great than zero. Check discard_max_bytes documentation at # https://www.kernel.org/doc/Documentation/block/queue-sysfs.txt # for fs in $(lsblk -o MOUNTPOINT,DISC-MAX,FSTYPE|grep -E '^/.* [1-9]+.* '|awk '{print $1}'); do fstrim "$fs" done
signature.asc
Description: OpenPGP digital signature