[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using bind mount



On 12/01/16 09:17 AM, Steve Matzura wrote:
I am trying to get around the restriction of symlinks not resolving in
FTP when the account is DefaultRoot'ed and CHRoot'ed. I mounted a NAS
volume, some directories of which I want to appear as being rooted
elsewhere, thus:

# mkdir -p /mnt/nas
# mount.cifs //ds1/vol1 /mnt/nas -o [various options]

When I 'ls -l /mnt/nas', I see all the directories at the top level of
//ds1/vol1. Fine.

Now, according to everything I've read about bind mount, I should be
able to:

# mount -o bind /mnt/nas/doc /home/steve/doc

where `doc' is a directory on /mnt/nas as described above, and
`/home/steve/doc' is where I want it to appear in my own directory
structure. Therefore, if I FTP into the steve account, while I cannot
escape up the tree past /home/steve, the path /home/steve/doc should
have been able to be created, and I should be able to access it in the
normal FTP way. However, the above mount with bind command yields:

mount special device /mnt/nas/doc does not exist

While that path exist but isn't a special device, the documentation
(mount manpages and
http://backdrift.org/how-to-use-bind-mounts-in-linux) says this should
work. What am I missing about mount with the bind option?

I just tried something similar with an NFS share and was able to do it. My situation was I have //<computer>/mnt mounted in ~/mnt. I was then able to (as root) mount -o bind ./mnt/archives ./mnt1 while in my normal ~ folder.

You could also try mounting the share locally or sharing the "doc" folder in addition to sharing the entire volume.


Reply to: