I have a client whose site has an absolutely massive directory of images; some dozens of gigabytes. (No, it's not that kind of site.)
I'd like to come up with a good way for the staging copy of the site to have access to the files in this directory in a safe way. Namely, any new deletions or uploads that using the staging site may trigger should not effect the image directory as accessible by the live site. The easiest approach to this would be to simply create a copy of the directory that the staging site can play in, but the absolutely massive site of this directory makes it impractical. (My current approach is to just copy over small subdirectories of the main directory from time to time, which works if my client and her employees only tests things in small parts of the site.)
I figure I could make this partially work by creating an empty directory to use as the file directory which new files can be uploaded to and configure Nginx to check for files in that directory first and then fall back to the "live" image directory next when requests for files in that directory come in. However, those files in the live directory would not be readable by the PHP site code itself and we wouldn't be able to "delete" existing files.
So I guess what I'm hoping for is a file-system-level trick which would allow me to mirror the contents of a directory while allowing for effective new file creation or existing file deletion from that directory but without actually affecting the original directory as would happen with a symlink. But any other ideas on how to handle this sort of situation would also be greatly appreciated.