public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Mount Windows C drive as POSIX root?
@ 2012-10-17 22:24 Buchbinder, Barry (NIH/NIAID) [E]
  0 siblings, 0 replies; 6+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2012-10-17 22:24 UTC (permalink / raw)
  To: cygwin; +Cc: Gary Oberbrunner

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-18 12:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <139630876.289726.1350497632770.JavaMail.root@genarts.com>
2012-10-17 18:21 ` Mount Windows C drive as POSIX root? Gary Oberbrunner
2012-10-18  0:04   ` Andrey Repin
2012-10-18  0:18     ` Daniel Colascione
2012-10-18  1:44     ` Gary Oberbrunner
2012-10-18 12:04       ` Andrey Repin
2012-10-17 22:24 Buchbinder, Barry (NIH/NIAID) [E]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).