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: [BUG] Cygwin default mounts in 1.7


Earnie Boyd wrote:

It doesn't matter. If the working drive is E: and the symlink is on C: then /usr/bin doesn't exist on E: and /usr/bin/ls or any other binary will not work.


Ah... this sounds like a different problem than I understood it to be.


Let me relate an example and see if it sounds the same.

If am in Windows and browse in explorer to my 'D' drive (documents)
and start Gvim from Explorer, Explorer will have set my current
drive and PATH, to D:/<somedir under Documents>.

Now if I start a SHELL from Gvim, it will start bash (in my setup I
config bash as my SHELL in the SYSTEM ENV).

But if I only have SHELL=/bin/bash.exe, it will "die" because
it will try to open that as D:/bin/bash.exe.

Two ways to attack that problem, not sure which would be better
for you.

My Shell var really says:
/tmp> uname -a
CYGWIN_NT-6.1-WOW64 Athenae 1.7.16(0.262/5/3) 2012-07-20 22:55 i686 Cygwin
/tmp> echo $SHELL
C:/Bin/Bash.exe
...
So you can make sure you prepend a C: to the paths you want protected
"through" a windows trip".  Since I have my CYG prefix set to "/":
/c> mount -p
Prefix              Type         Flags
/                   nouser       binmode
when cygwin sees a reference to a driver letter in the cygdir, it maps
it to the right drive...


For whatever reason, I have 2 symlinks... created in windows: /c> cmd Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\>dir ? Volume in drive C is System Disk Directory of C:\ 12/16/2009 12:09 PM <SYMLINKD> m [M:\] 07/12/2010 03:50 PM <SYMLINKD> p [P:\] --- But IN CYGWIN, the single letters work fine in that location because "/" is also my CYGDIR that is the root of the cygwin mounts: C:\>exit /c> mount C:/bin on /usr/bin type ntfs (binary,auto) C:/lib on /usr/lib type ntfs (binary,auto) C: on / type ntfs (binary,auto) D: on /d type nfs (binary,posix=0,noumount,auto) H: on /h type nfs (binary,posix=0,noumount,auto) I: on /i type nfs (binary,posix=0,noumount,auto) M: on /m type nfs (binary,posix=0,noumount,auto) P: on /p type nfs (binary,posix=0,noumount,auto) S: on /s type nfs (binary,posix=0,noumount,auto) T: on /t type nfs (binary,posix=0,noumount,auto) X: on /x type ntfs (binary,posix=0,noumount,auto)

...

The other way to solve it is to go completely with 1 drive.
Use no drive letters and mount all of your drive letters
under NTFS dirs using junction or linkd:

/c> junction.exe

Junction v1.06 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

The first usage is for displaying reparse point information, the
second usage is for creating a junction point, and the last for
deleting a junction point:
usage: C:\prog\sysinternals\cmd\junction.exe [-s] [-q] <file or directory>
       -q     Don't print error messages (quiet)
       -s     Recurse subdirectories

usage: C:\prog\sysinternals\cmd\junction.exe <junction directory> <junction target>
       example: junction d:\link c:\windows

usage: C:\prog\sysinternals\cmd\junction.exe -d <junction directory>
/c> linkd
Links an NTFS directory to a target valid object name in Windows 2000.

LINKD Source [/D] Destination

Source - Displays the Windows 2000 name targeted by Source

  Source Destination - Links source directory to Destination directory or a
                       Windows 2000 device or any valid Windows 2000 name

  Source /D          - Deletes Source, regardless of whether a link exists at
                       source

/? - Prints this help message

LINKD grafts (links) the target name directly into the name space at Source,
so that Source subsequently acts as a name space junction. The Source directory

must reside on a disk formatted with NTFS in Windows 2000. The destination
(the target of the link) can be any valid directory name or device name or valid
object name in Windows 2000. When the target name does not resolve to a directory
or a device, open calls fail.

All characters in both the Source and Destination names must be in the ASCII
character set. Usage of arbitrary Unicode characters is not supported.

Type "LINKD /? | more" if you need to see all the help text

linkd last came in the win2000RK and is likely still downloadable off
the MS website.. junction is a cmdline facility with sysinternals.

...
So you'd no longer use anything with a drive letter in it at all -- the
problem would be with existing installed programs that reference
other drive letters...

Which is why I liked the judicious use of symlinks and putting
my cygroot dir in "/" enough to deal with the few problems I have
like that.

Sorry if this isn't the same as your prob -- just sounded very much
the same (i.e. a win program switched programs to another drive... )...


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


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