Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
1  
Search for "union mount" - I think that's what you're trying to do. –  pjc50 Feb 20 '12 at 16:45

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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