New mount option "bind"

Christopher Faylor
Wed Aug 11 13:52:00 GMT 2010

On Wed, Aug 11, 2010 at 01:36:59PM +0200, Corinna Vinschen wrote:
>Hi guys,
>I added a new mount option "bind" which I took from Linux.  It allows to
>remount an existing POSIX directory into another POSIX directory.  So
>the path on the left side of the fstab line can be a POSIX path as well.
>At Cygwin startup, when its added to the mount table, it's converted to
>a Win32 path using the already existing entries in the mount table to
>evaluate the path.  So, the path is either relative to a path which
>preceeds the "bind" path in /etc/fstab, or it's eventually relative to
>the root dir.
>The motivation for this was that this allows to specify mount points
>while retaining relocatability of the Cygwin install tree.  So, even if
>you don't know in which path the Cygwin installation has been installed,
>you can do stuff like this now:
>  $ cat /etc/fstab
>  /var /usr/var none bind
>  $ mount
>  C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
>  C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
>  C:/cygwin/var on /usr/var type ntfs (binary,bind)  <<<<<<<<<<
>  C:/cygwin on / type ntfs (binary,auto)
>  C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
>I also updated the docs to describe this new option.  If you find a
>problem with this option, or if the documentation is not good enough,
>please feel free to send patches.

If the mount for /var changes then is that reflected by /usr/var?  I
believe that's how it works for linux.


More information about the Cygwin-developers mailing list