6

I use Cygwin as a POSIX environment, and I have a bunch of mapped network drives on my windows computer (set up by a sysadmin, not by me). I have found that all the network drives which are mapped on windows are automatically mounted in Cygwin. I can use df to see all the drives, and their mount points on /cygdrive. What I don't know is how. I looked at /etc/fstab and I didn't find anything there.

When and by whom is mount called?

Currently I'm having unrelated problems with permissions on certain data on these network drives and the Internet told me to change how it is mounted, but I can't seem to find that information.

  • 1
    possible duplicate of change directory to network drive in Cygwin – Valentin Jun 29 '15 at 15:04
  • 1
    @Valentin I get the impression that the Xavier already understands that mapped drives are mounted but wants to understand the mechanism by which they are mounted. – Anthony G - justice for Monica Jun 29 '15 at 15:13
  • 1
    @Valentin is exactly right. In fact I have access to the network drives already, but why I do is a little mysterious to me. I tried to edit the question to be a little more clear – xaviersjs Jun 29 '15 at 15:33
  • Ha ha, I actually meant to say that @Anthony is correct :-/ – xaviersjs Jun 29 '15 at 16:21
5

How does cygwin mount mapped network drives

The mount table is set up somewhere in the bowels of cygwin.dll during cygwin startup.

Without looking at the source code I can't give a more precise answer.

You can unmount and then remount using mount with different options if you need to change the default options.

mount will display the current mount table (with the mount options used).

Note:

The mount program is used to map your drives and shares onto Cygwin's simulated POSIX directory tree, much like as is done by mount commands on typical UNIX systems. However, in contrast to mount points given in /etc/fstab, mount points created or changed with mount are not persistent. They disappear immediately after the last process of the current user exited.

Edit /etc/fstab or /etc/fstab.d/$USER to make permanent changes.


Further reading

  • fstab for examples.

  • mount for more information about mount.

  • Special filenames for a list of filename that are read by Cygwin before the mount table has been established.

  • 1
    Thanks for that info. I ended up just mounting the same drive again in /mnt and setting up some symlinks to the /mnt mount instead of the /cygdrive mount – xaviersjs Jul 8 '15 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.