This is the mail archive of the cygwin@cygwin.com 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 Confusion -- the tallest pique in the world!


On Sat, 1 Nov 2003, Lee D. Rothstein wrote:

> At 2003-11-01 03:27 PM, Igor Pechtchanski wrote:
> >> At 2003-10-31 01:08 PM, Igor Pechtchanski wrote:
>
> >> Why do /zc, /zd, /ze, /zf, /zg, ... ('mount c:/ /zc', ...
> >> 'mount g:/ /zg, ...) appear in ls output when no prior
> >> 'mkdir's have been carried out. What's different between
> >> /tmp and /<everything else>?
> >
> >WAG: this may be due to the code that lists /cygdrive automatic mounts
> >(since your cygdrive prefix is set to "/", you get your drives listed).
>
> 1st, the only cygdrive prefix that works on my system is /cygdrive/.
> 2nd, no matter what I set the prefix to /cyggdrive/ is the only
>      prefix that works.
> 3rd, even using your suggestion of 'mount -c -b -s /IIFOIALIP', for
>      example:
>
> cd /IIFOIALIP/c/ # does not get me to c:/, whereas
> cd /cygdrive/c/  # gets me there before during and after!!

I'm sorry, you must be doing something wrong:

$ mount -u -b -c "/IIFOIALIP"
$ ls /IIFOIALIP/c/cygwin/
Cygwin.bat*  bin/       dev/  export/  lib/  proc/  tmp/  var/
Cygwin.ico*  cygdrive/  etc/  home/    mnt/  root/  usr/
$ ls /cygdrive/c/cygwin/
/bin/ls: /cygdrive/c/cygwin/: No such file or directory
$ mount -u -b -c "/cygdrive"
$ ls /IIFOIALIP/c/cygwin/
/bin/ls: /IIFOIALIP/c/cygwin/: No such file or directory
$ ls /cygdrive/c/cygwin/
Cygwin.bat*  bin/       dev/  export/  lib/  proc/  tmp/  var/
Cygwin.ico*  cygdrive/  etc/  home/    mnt/  root/  usr/
$

Note: my *system* cygdrive prefix stayed "/cygdrive" throughout the above.

> Quite apart from the above:
>
> Why (how is it that) I can get /zc ... /zy to show up in the output of 'ls /',
> and I can do a cd to any of "/z?", without creating respective directories in /
> of /zc .. /zy?

Umm, could you please post the result of "ls /cygdrive/c/cygwin"?  Does it
contain all the "z*" directories?

> I submit to the group that whatever inconsistency in implementation or
> documentation is behind these problems, is the source of numerous
> configuration problems that people are having. I have run into this
> problem so many times that I refuse to let it rest until I understand
> it.
>
> >> >> Prior to my doing any of the above (w/ Cygwin root at
> >> >> 'c:/_Programs/Cygwin'), I've had recurring instances of something
> >> >> (apps?, 'setup.exe?, what?) creating 'tmp' and more frequently 'var' on
> >> >> both my 'c:' and 'e:' drives. This problem seems to have subsided since
> >> >> I moved the Cygwin root directory from 'c:/_Programs/Cygwin' to
> >> >> D:/Cygwin'.
> >> >
> >> >I'd bet you were installing as one user and running as another.
> >>
> >> You'd lose that bet. Only one ID -- Administrator. Cygwin always
> >> *only* installed for/by Administrator.
> >
> >Nope.  Services run as LocalSystem (aka SYSTEM). :-p
>
> I'm not getting the joke, and more importantly the point! Could someone
> else jump in here who is not as proud of their own sense of humor.

There is no joke.  Services (e.g., sshd, telnetd, cron) run under a
different username.  If they create files, you're likely to have them
owned by SYSTEM.  The emoticon was on the "I'd bet/you'll lose" exchange.

> >> One thing I do not understand, however, is the appearance of the
> >> owner/user SYSTEM on some files/directories when I do 'ls -l'.
> >
> >There you go. :-D
>
> There I go where? I am not installing anything as "SYSTEM". Cygwin
> setup (?) must be doing it? Why? How? How do I keep the mismatches
> from occurring again?

Another example of something owned by SYSTEM being created is by the
ssh-host-config script, which does an explicit "chown".  Some of the
"mismatches"  are necessary -- sshd, for example, won't work without them.

> >> >> Also, after I moved Cygwin, despite changing all the references in the
> >> >> profile and Windows environment variables, *and* reinstalling the whole
> >> >> of Cygwin, "Cygwin" "insisted" on looking at the C/_Programs... : root
> >> >> rather than the D:/Cygwin... directory
> >> >>
> >> >> Anybody know what's causing this?
> >> >
> >> >Stale user mounts?  Your "/", "/usr/bin" and "/usr/lib" mounts appear to
> >> >be user mounts.  You should probably remount them as "system" (i.e.,
> >> >'mount -f -s -b d:/Cygwin /', 'mount -f -s -b d:/Cygwin/bin /usr/bin',
> >> >'mount -f -s -b d:/Cygwin/lib /usr/lib', and 'umount -U').
>
> For the third time, why do I have to explicitly specify '-s' and '-b'
> when the man page says they are each the default?

You don't have to explicitly specify them, but it's good to make sure
you're doing *exactly* what you intend to do.  I've long stopped relying
on "default" option values in important tasks.  Besides, there's got to be
a reason your system cygdrive prefix ended up in textmode...

FWIW, the user cygdrive prefix does override the system one (as seen in my
example above).  However, the system one will show up for services and
such, so you may be surprised trying to access "/cygdrive/c/WINNT" from,
say, cron.

> What other sub-root directories besides /usr/bin /usr/lib require mounting
> for a valid Cygwin configuration?

None (unless your "/" is mounted in textmode, in which case /tmp and
/usr/X11R6/lib/X11/fonts should both be binary-mounted, or X won't work).

> >> As far as I know, my only cygdrive prefix is 'cygdrive'.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have to concede on one point: there is no way that I know (short of the
no-no of editing the registry) of removing the user cygdrive prefix, so
you probably weren't ever exposed to the system one during normal console
operation.  I really have no idea how your system prefix could have ended
up that way (i.e., "/" and textmode).  In any case, "mount -p" or "mount
-m" should show you both prefixes.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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


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