It should be possible to union mount annexes. So if multiple drives have content, an annex mounting them both would have available all the content from all the drives.
This could be done by just making .git/annex/KEY link to the actual content on the mounted annex.
(Need to make sure the copy tracking code does not confused and think the symlink is a copy of the content.. Also need to make sure that code that writes to .git/annex does not follow symlinks.))
Until this feature is available in git annex proper, here is a small shell script that uses lndir to create a merged view of the .git/annex/objects areas of multiple git-annex repositories.
Demo:
git-annex
on the resulting directory (and if there's any danger of it, you might want to consider whiteing out the git configuration in an additional top layer), but only inside one of the supplying repositories.Linux's in-tree union-mounting option overlayfs does not support modifications to underlying filesystems while an overlayfs mount is active:
I.e., it's great for the LiveCD case of combining a read-only squashfs and a private tmpfs into something that behaves just like a normal filesystem, but it cannot be used to export a read-only view of multiple mutable resources.
I can report that aufs also doesn't work for this use case, at least as of 2014 when I last tried it. Writes to underlying filesystems cause kernel panics that bring the whole machine down.
I can also report that hanwen/go-fuse's unionfs doesn't work for this use case. Example problem: Growing files' sizes get stuck at the size they were the first time they were viewed through the union mount.