5

I have a symlink:

/test

Which is pointing at a directory:

/source

I want to do a bind mount to mount /new over /test

mount -o bind /new /test

However this binds /new over /source (with /test pointing at /source - showing the files from /new, but not what I want). How do I stop mount following the symlink and get it to mount at /test.

engie
  • 153
  • 3

1 Answers1

0

Since /test is not a real directory, this won't work.
Unlink it, create it as a real directory, then do the bind mount.

adaptr
  • 16,479
  • 21
  • 33
  • 1
    You can use bind mounts to replace one file with another, but it appears that when the target is a symlink, the kernel expands it before doing the bind mount :( – Cheetah Sep 24 '14 at 23:27