I'd like to understand some technical details about how fstrim, file systems, and block devices work.
Do ext4 and btrfs keep a list of blocks that have already been reported as unused or do they have to report all unused blocks to the block device layer everytime the fstrim command is issued? Does LVM keep information on every block about its usage or does it always have to pass trim operations to the lower layer? And does software RAID, i.e. /dev/md* keep this information on every block? Can RAID skip unused blocks from syncing in a RAID-1 array when I replace a disk? Steve