public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bind mounts in fstab
@ 2015-06-08 10:39 Achim Gratz
  2015-06-08 12:45 ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Achim Gratz @ 2015-06-08 10:39 UTC (permalink / raw)
  To: cygwin

I've been using bind mounts to provide alternative paths into the same file
system.

//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.  I can manually mount the directory
the way I want if I simply use the full external path (that's what happens
anyway if I restart the session).

Is there something wrong with the way bind mounts currently work or should I
just not use them and mount the same external share multiple times (that is
the result anyway)?


Regards,
Achim.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 10:39 bind mounts in fstab Achim Gratz
@ 2015-06-08 12:45 ` Corinna Vinschen
  2015-06-08 14:54   ` Achim Gratz
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2015-06-08 12:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On Jun  8 10:39, Achim Gratz wrote:
> I've been using bind mounts to provide alternative paths into the same file
> system.
> 
> //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?


Corinna

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 12:45 ` Corinna Vinschen
@ 2015-06-08 14:54   ` Achim Gratz
  2015-06-08 15:48     ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Achim Gratz @ 2015-06-08 14:54 UTC (permalink / raw)
  To: cygwin

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.


Regards,
Achim.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 14:54   ` Achim Gratz
@ 2015-06-08 15:48     ` Corinna Vinschen
  2015-06-08 16:05       ` Achim Gratz
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2015-06-08 15:48 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 15:48     ` Corinna Vinschen
@ 2015-06-08 16:05       ` Achim Gratz
  2015-06-08 20:08         ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Achim Gratz @ 2015-06-08 16:05 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 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).

I had to repurpose the local disk space that the Cygwin build environment
took up and haven't had time to move this to a server yet.  So I'll have to
wait for the snapshot...


Regards,
Achim.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 16:05       ` Achim Gratz
@ 2015-06-08 20:08         ` Corinna Vinschen
  2015-06-09  6:53           ` Achim Gratz
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2015-06-08 20:08 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

On Jun  8 16:04, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > 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).
> 
> I had to repurpose the local disk space that the Cygwin build environment
> took up and haven't had time to move this to a server yet.  So I'll have to
> wait for the snapshot...

I uploaded a new developer snapshot.  Please give it a try:
https://cygwin.com/snapshots/


Thanks,
Corinna

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-08 20:08         ` Corinna Vinschen
@ 2015-06-09  6:53           ` Achim Gratz
  2015-06-09  9:59             ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Achim Gratz @ 2015-06-09  6:53 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> I uploaded a new developer snapshot.  Please give it a try:
> https://cygwin.com/snapshots/

Fix confirmed.  Thanks!


Regards,
Achim.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bind mounts in fstab
  2015-06-09  6:53           ` Achim Gratz
@ 2015-06-09  9:59             ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2015-06-09  9:59 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

On Jun  9 06:53, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > I uploaded a new developer snapshot.  Please give it a try:
> > https://cygwin.com/snapshots/
> 
> Fix confirmed.  Thanks!

Cool, thank you!


Corinna

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-09  9:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-08 10:39 bind mounts in fstab Achim Gratz
2015-06-08 12:45 ` Corinna Vinschen
2015-06-08 14:54   ` Achim Gratz
2015-06-08 15:48     ` Corinna Vinschen
2015-06-08 16:05       ` Achim Gratz
2015-06-08 20:08         ` Corinna Vinschen
2015-06-09  6:53           ` Achim Gratz
2015-06-09  9:59             ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).