public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Mount Windows C drive as POSIX root?
       [not found] <139630876.289726.1350497632770.JavaMail.root@genarts.com>
@ 2012-10-17 18:21 ` Gary Oberbrunner
  2012-10-18  0:04   ` Andrey Repin
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Oberbrunner @ 2012-10-17 18:21 UTC (permalink / raw)
  To: cygwin

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?

-- Gary Oberbrunner

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Mount Windows C drive as POSIX root?
  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
  0 siblings, 2 replies; 6+ messages in thread
From: Andrey Repin @ 2012-10-18  0:04 UTC (permalink / raw)
  To: Gary Oberbrunner, cygwin

Greetings, Gary Oberbrunner!

> 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.

Having single filesystem, and having cygwin mounted on root is not the same.

> I have an environment with lots of non-cygwin tools and translating paths
> between them is not workable. 

Especially not the same, when you start to interoperate with non-cygwin
applications, and when you start to update your Cygwin installation.

Heed my suggestion, don't do it.

> 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?

First, it just wrong. And were causing infinite grief in the past. So, Cygwin
maintainers changed scheme to force some mounts off of cygwin1.dll location.

If this is any help for you, I was intent to use something similar to what you
want, back in the days... well, back into over ten years ago.
I've tried, first on NT4, then on W2k, to setup a *NIX-like single-root
filesystem, where C:\ is the only root, and every other device is a [sub]folder
somewhere out there.
Guess, what? It didn't worked well past the HDD mounts. You can't reliably use
CD/DVD drives, when they are not represented as disk letters, you can't
unconnect removable drives without first breaking the mount point... it's just
too much trouble to maintain.
So far, I've stopped at the following configuration:
1. All partitions of all fixed drives are letter-less, except C:\. Various
disks or selected folders on them are propagated as junctions from folders on
C:\, like C:\Games -> \\?\Volume{4aee6480-972b-11de-b8ca-0015f2ef1bb5}\Games
(root of that volume don't have the mount point at all, by the way)
2. USBDLM handle USB stuff. Linky: http://www.uwe-sieber.de/usbdlm_e.html
3. CD/DVD drives left as is.
4. Cygwin happily living in C:\Programs\Cygwin (really it is in
\\?\Volume{907c2c4e-c109-11dd-a36b-806d6172696f}\Programs\CygWin, but that's a
different topic.)
5. You can make junctions back to C:\ from Cygwin\* folders, if switching root
is working for you. But I long since dropped that practice. (Been using it in
the past, but it pose more issues, than fix.)

[C:\Programs]$ mount
C:/Programs/CygWin/bin on /usr/bin type ntfs (binary,auto)
C:/Programs/CygWin/lib on /usr/lib type ntfs (binary,auto)
C:/Programs/CygWin on / type ntfs (binary,auto)
C:/home on /home type ntfs (binary,noacl,posix=0,user)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type udf (binary,noacl,posix=0,user,noumount,auto)
Y: on /y type nfs (binary,noacl,posix=0,user,noumount,auto)
Z: on /z type nfs (binary,noacl,posix=0,user,noumount,auto)

C:\home -> C:\Documents and Settings -> \\?\Volume{907c2c4e-c109-11dd-a36b-806d6172696f}\Profiles
(Yep, i'm jumping in loops here, but this was much easier, than to alter Windows
installation script to install profiles into a different directory.
I'm using C:\home base for most scripts, only programs native for Windows and
not involved in scripting look into D&S directory.)


--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 18.10.2012, <03:40>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Mount Windows C drive as POSIX root?
  2012-10-18  0:04   ` Andrey Repin
@ 2012-10-18  0:18     ` Daniel Colascione
  2012-10-18  1:44     ` Gary Oberbrunner
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Colascione @ 2012-10-18  0:18 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

On 10/17/2012 4:58 PM, Andrey Repin wrote:
> Greetings, Gary Oberbrunner!
> 
>> 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.
> 
> Having single filesystem, and having cygwin mounted on root is not the same.

It's awfully close.

>> I have an environment with lots of non-cygwin tools and translating paths
>> between them is not workable. 
> 
> Especially not the same, when you start to interoperate with non-cygwin
> applications, and when you start to update your Cygwin installation.
> 
> Heed my suggestion, don't do it.

It works fine for me. I just use c:\bin as /bin, c:\etc as /etc, and so on.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

* Re: Mount Windows C drive as POSIX root?
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Gary Oberbrunner @ 2012-10-18  1:44 UTC (permalink / raw)
  To: cygwin

Thanks for the replies, cygwin people!

----- Original Message -----
> From: "Andrey Repin" <anrdaemon@freemail.ru>
...
> 
> > 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.
> 
> Having single filesystem, and having cygwin mounted on root is not
> the same.

Sorry, I was not clear -- I mean the same filesystem between cygwin and Windows.  And I only care about the C drive (I've learned to keep everything there).

> > I have an environment with lots of non-cygwin tools and translating
> > paths between them is not workable.
> 
> Especially not the same, when you start to interoperate with
> non-cygwin applications, and when you start to update your Cygwin installation.
> 
> Heed my suggestion, don't do it.

Well, it's worked pretty well for me for the last 10 years. :-)
Of course I've also learned not to update my cygwin. :-)

> First, it just wrong. And were causing infinite grief in the past.
> So, Cygwin
> maintainers changed scheme to force some mounts off of cygwin1.dll
> location.

Can you say more about this?

...
> Guess, what? It didn't worked well past the HDD mounts. 

Correct -- I don't care about that (D drive etc.).  What I do care about is being able to mix cygwin command line tools with non-cygwin.  For example, Intel compiler.  Or (non-cygwin) python.  I'm really used to being able to say

  # ls /my/path/foo.py
  # python !$
or
  # vim /my/path/foo.cc   (cygwin)
  # icl -c !$             (non-cygwin)

and have it just work, like on Linux.  Not have to translate paths around and remember which utility is cygwin-based and which isn't. (I'm old, and seem to have become a serious command-line Windows hacker, but I'm still really a Unix guy.)

...
> in fstab:
> C:/Programs/CygWin on / type ntfs (binary,auto)
The above is the big problem for me.  But I guess I'm learning that cygwin 1.7 can't do what I want, at least how I used to do it.  

> Sorry for my terrible english...
You are quite easy to understand, actually!

Also, Barry Buchbinder replied:
> 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.)

This is almost nice, but that annoying /c/ is just as bad as anything else.  If I can't cut and paste paths around, or use my shell history, I will go crazy. :-/

I now think I have to experiment with installing cygwin in the root of the C drive, despite all the warnings to the contrary.  I can be pretty careful about those special root folders (etc, usr, bin, and so on).

-- 
Gary Oberbrunner

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Mount Windows C drive as POSIX root?
  2012-10-18  1:44     ` Gary Oberbrunner
@ 2012-10-18 12:04       ` Andrey Repin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2012-10-18 12:04 UTC (permalink / raw)
  To: Gary Oberbrunner, cygwin

Greetings, Gary Oberbrunner!

> Thanks for the replies, cygwin people!

> ----- Original Message -----
>> From: "Andrey Repin" <anrdaemon@freemail.ru>
> ...
>> 
>> > 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.
>> 
>> Having single filesystem, and having cygwin mounted on root is not
>> the same.

> Sorry, I was not clear -- I mean the same filesystem between cygwin and
> Windows.  And I only care about the C drive (I've learned to keep everything
> there). 

That's generally bad practice. But up to you, I suppose.

>> > I have an environment with lots of non-cygwin tools and translating
>> > paths between them is not workable.
>> 
>> Especially not the same, when you start to interoperate with
>> non-cygwin applications, and when you start to update your Cygwin installation.
>> 
>> Heed my suggestion, don't do it.

> Well, it's worked pretty well for me for the last 10 years. :-)
> Of course I've also learned not to update my cygwin. :-)

>> First, it just wrong. And were causing infinite grief in the past.
>> So, Cygwin
>> maintainers changed scheme to force some mounts off of cygwin1.dll
>> location.

> Can you say more about this?

> ...
>> Guess, what? It didn't worked well past the HDD mounts. 

> Correct -- I don't care about that (D drive etc.).  What I do care about is
> being able to mix cygwin command line tools with non-cygwin.  For example,
> Intel compiler.  Or (non-cygwin) python.  I'm really used to being able to say

>   # ls /my/path/foo.py
>   # python !$
> or
>   # vim /my/path/foo.cc   (cygwin)
>   # icl -c !$             (non-cygwin)

> and have it just work, like on Linux.  Not have to translate paths around
> and remember which utility is cygwin-based and which isn't. (I'm old, and
> seem to have become a serious command-line Windows hacker, but I'm still
> really a Unix guy.) 

As I said, if switching root folder works for you, you can make junctions back
to C:\ from Cygwin installation and have it work straights.


--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 18.10.2012, <15:59>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* 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).