MinGW mount

Giles Orr gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Mar 5 17:42:59 UTC 2014

This is mildly OT and a long shot, but I'm hoping someone has dealt with
MinGW's or Git Bash's mount/msysmnt commands on Windows.

I'm using Git Bash (essentially MinGW from what I read, with GIT added) at
work.  Due to some Windows 7 Group Policy pushed down by our IT department,
we can't run Cygwin binaries in Git Bash unless they're part of the Git
Bash directory structure.  We can run stuff (including these binaries) as
Administrator, but another policy enforces authentication, and we're
expecting to use this enough that authentication every time would be a
pain.  We can't run cmd.exe or the Cygwin console without Administrator
privileges, but for some reason Git Bash will run ... with strange

Git Bash starts with C:\Program Files (x86)\Git\bin\ "mounted" as /bin/ and
the entire C: drive as /c/ - but bizarrely, if you do an "ls /" the /c/
doesn't show and isn't available for tab completion.  I have the Cygwin
binaries in /c/cygwin/ , their default location.  If I try to run them as a
regular user in Git Bash, I get:

   sh.exe": /c/cygwin/bin/ls: Bad file number

That applies to pretty much any Cygwin binary: I haven't tried all of them,
but every one I've tried has responded that way.  (Googling "Bad file
number" was unproductive, at least for me.)  However, if the Cygwin binary
is moved to /bin/ in the Git Bash environment, it runs fine.
Unfortunately, there's quite a structure of files we need to run Vagrant ...

So what I'm hoping is that we can graft the required tree structure onto
the pseudo-file-system Git Bash has constructed for itself.  There's a
mount command that's actually a bash script, that ultimately calls
msysmnt.exe .  "--help" gets some information out of the latter binary, but
I can find no documentation and the help isn't enough to actually make it
work.  What little I can get from it suggests that the correct command form
is this:

   $ mount "C:\HashiCorp\Vagrant\embedded" /embedded

This finishes silently, after which you have a /embedded/ folder, but
nothing under it.  Errors I've seen at other times suggest that another
parameter is needed.

Is anyone familiar with this?

$ msysmnt.exe --help
Usage: msysmnt.exe [OPTION] [<win32path> <posixpath>]
  -b, --binary                  text files are equivalent to binary files
                                (newline = \n)
  -c, --change-cygdrive-prefix  change the cygdrive path prefix to
  -f, --force                   force mount, don't warn about missing mount
                                point directories
  -i, --import-old-mounts copy  old registry mount table mounts into the
                                mount areas
  -p, --show-cygdrive-prefix    show user and/or system cygdrive path prefix
  -s, --system                  add mount point to system-wide registry
  -t, --text       (default)    text files get \r\n line endings
  -u, --user       (default)    add mount point to user registry location
  -x, --executable              treat all files under mount point as
  -X, --cygwin-executable       treat all files under mount point as cygwin
  -m, --mount-commands          write mount commands to replace user and
                                system mount points and cygdrive prefixes

gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20140305/a944c665/attachment.html>

More information about the Legacy mailing list