New mount option "bind"

Corinna Vinschen
Wed Aug 11 11:37:00 GMT 2010

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.


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

More information about the Cygwin-developers mailing list