I wish to mount a volume/filesystem at a non-empty directory, yet still retain access to the directory's contents. Is this possible?

I know that a filesystem can be mounted at a non-empty directory with no issues -- the data will remain when the filesystem is unmounted. What I do want to know is how to access that data while the filesystem is mounted.

I tried creating a hard link to the directory, but even the new directory essentially becomes a second mountpoint. I could verify this by running ls -i and noting that the inode for the hard link changed to match the inode of the mounted volume. Is there something happening at the VFS layer here?

Could I potentially keep some handle on the directory open before mounting and it would remain useful? Any other ideas would be much appreciated.

link|improve this question

25% accept rate
Search for "union mount" - I think that's what you're trying to do. – pjc50 Feb 20 at 16:45
feedback

1 Answer

What you may be looking for is a way to do Linux's mount --bind on OS X. You can try bindfs and see if it works for you.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.