This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bind mounts in fstab


On Jun  8 14:53, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 
> > > //server/some/directory /mnt/server-share none binary 0 0
> > > #bind mounts
> > > /mnt/server-share/some/other/directory /mnt/task1 none binary,bind
> > > 
> > > That works well until I try to add another such bind mount and activate it
> > > via 'mount -a' without starting a new Cygwin session.  Cygwin tries to
> > > create a mount to the underlying local directory of /mnt/task1 instead of
> > > binding, which doesn't work of course.
> > 
> > How does your second bind mount look like?
> 
> # new bind mount
> /mnt/server-share/some/other/directory /mnt/task2 none binary,bind
> 
> Which tries to mount to 
> 
> %CYGWIN_ROOT%/mnt/server-share/some/other/directory
> 
> when I do a 'mount -a' in the same session.  If I instead put in
> 
> //server/some/directory/some/other/directory none binary 0 0
> 
> then everything works OK, AFAICS.  This might be related to the fact that
> some bind mounts appear before the physical mounts in the mount table (not
> in fstab!), at least if the mounts are processed in the same order.

Easily reproducible, thank you.  I think I found the culprit.  mount(1)
always converts the mnt_fsname field to backslash notation.  That breaks
converting the bind mount from the expected POSIX notation to a valid
Win32 path.

I fixed mount(1) in git.  If you're set up to build Cygwin yourself, you
want to give the patch a try.  No new DLL, just call the new mount(1)
tool.  Otherwise I'll build a new snapshot today or tomorrow (I'm hacking
on something else right now).


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgp4KJpI7Vz57.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]