This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Mount Windows C drive as POSIX root?


Gary Oberbrunner sent the following at Wednesday, October 17, 2012 2:22 PM
>I understand about not installing cygwin in c:\. But I really want a
>single filesystem, so cygwin's / is Windows c:/, and cygwin /Program\
>Files is Windows /Program Files and so on. I have an environment with
>lots of non-cygwin tools and translating paths between them is not
>workable.
>
>I'm not really doing cygwin-based software development (not using gcc
>etc.); I just want cygwin for its utilities, so "ls /Windows" works the
>same as "dir \Windows".
>
>For years I've done this by installing cygwin into c:\cygwin, and
>adjusting the /etc/fstab mount points so everything works. My fstab
>looks like this:
>
>c:/               /           ntfs    binary,override
>c:/cygwin/etc     /etc        ntfs    binary,override
>c:/cygwin/usr     /usr        ntfs    binary,override
>c:/cygwin/bin     /usr/bin    ntfs    binary,override
>c:/cygwin/lib     /usr/lib    ntfs    binary,override
>c:/cygwin/var     /var        ntfs    binary,override
>c:/cygwin/dev     /dev        ntfs    binary,override
>c:/cygwin/lib     /lib        ntfs    binary,override
>c:/cygwin/proc    /proc       ntfs    binary,override
>c:/cygwin/srv     /srv        ntfs    binary,override
>
>But as I'm installing a new machine with a fresh cygwin, this no longer
>works. The mounts in fstab don't take effect (though interestingly c:/
>-> / does work), and it then can't find /etc and many things then don't
>work.
>
>I can manually mount it from a bash shell, but putting it in fstab
>doesn't work as it used to.
>
>Is this still a plausible setup for 1.7? Is there a better way?

Yes.  Sort of.  Not ~exactly~ the same thing.

The cygdrive prefix gives you a "single filesystem".  To save typing,
you could change the cygdrive prefix to /.

In /etc/fstab:
    none / cygdrive binary 0 0
(and get rid of all the other C:/cygwin/ lines in fstab.)

Then C:\Windows becomes /c/Windows and "C:\Program Files" becomes
/c/Program\ Files.  I, too, have a lot of non-cygwin tools/files;
I find that prefixing paths with "/c" is not inconvenient.

Another thing that you could do is to set up bash functions with cygstart
if it is a GUI, posix paths to your windows apps, and cygpath to convert any
posix paths given as arguments to Windows paths.  Something like this
(untested):
    function name ( ) { cygstart /path/program args "$(cygpath -w "$1")" }

Good luck,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]