I've got shared hosting with a few thousand Wordpress installs and I've wanted for ages to have a nice way of removing all the duplicate files in a sensible and secure way. I'm looking for better disk cache hit ratios and simpler backups.
I'm just using standard Ext4, not something like ZFS which has it built in (at a cost).
I'm familiar with tools like rdfind is almost perfect. It can scan over all the files, find the duplicates and hard link them together. I could run it on a weekly cron at off peak times thus making the cost virtually zero.
The problem is I want a single account changing a file to destroy the hard link and give it's own copy of the file again. This way one site updating Wordpress or a plugin wouldn't mess with any other sites. That would also remove potential security issues as well since no account would be able to tamper with another account's files. Sort of Copy-on-write for links.
Is anything like this possible? I've tried doing some searches but I haven't been able to find anything.