4.33. Why the weird directory structure? Why do /lib and /usr/lib (and /bin, /usr/bin) point to the same thing?
Why use mounts instead of symbolic links?
Can I use a disk root (e.g., C:) as Cygwin root? Why is this
discouraged?
After a new installation in the default location, your mount points
will look something like this:
bash$ mount
C:\cygwin\bin on /usr/bin type ntfs (binary,auto)
C:\cygwin\lib on /usr/lib type ntfs (binary,auto)
C:\cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
Note that /bin and /usr/bin point to the same location, as do /lib and
/usr/lib. This is intentional, and you should not undo these mounts
unless you really know what you are doing.
Various applications and packages may expect to be installed in /lib
or /usr/lib (similarly /bin or /usr/bin). Rather than distinguish
between them and try to keep track of them (possibly requiring the
occasional duplication or symbolic link), it was decided to maintain
only one actual directory, with equivalent ways to access it.
Symbolic links had been considered for this purpose, but were
dismissed because they do not always work on Samba drives. Also,
mounts are faster to process because no disk access is required to
resolve them.
Note that non-cygwin applications will not observe Cygwin mounts (or
symlinks for that matter). For example, if you use WinZip to unpack
the tar distribution of a Cygwin package, it may not get installed to
the correct Cygwin path. So don't do this!
It is strongly recommended not to make the Cygwin root directory the
same as your drive's root directory, unless you know what you are
doing and are prepared to deal with the consequences. It is generally
easier to maintain the Cygwin hierarchy if it is isolated from, say,
C:. For one thing, you avoid possible collisions with other
(non-cygwin) applications that may create (for example) \bin and \lib
directories. (Maybe you have nothing like that installed now, but who
knows about things you might add in the future?)
/usr/bin
实际上是c:\cygwin\bin
。 - Erik Bennettc:\cygwin64\usr\bin
目录,但是它并不存在。 - ChumboChappati