delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/09/29/11:10:51

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50670F67.3020200@tlinx.org>
Date: Sat, 29 Sep 2012 08:10:31 -0700
From: Linda Walsh <cygwin AT tlinx DOT org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: Earnie Boyd <earnie AT users DOT sourceforge DOT net>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: [BUG] Cygwin default mounts in 1.7
References: <CAHODtZQ6y8H=Teje=sjdBms_h9i45zFtY+76ihbFiTHgkamRug AT mail DOT gmail DOT com> <505C438B DOT 4040902 AT gmail DOT com> <loom DOT 20120922T223801-212 AT post DOT gmane DOT org> <505EC94B DOT 3040108 AT gmail DOT com> <CAHODtZS8jiVSJ56zD2bMm+CT7naxCBDbCNeGmdXGy5fUroFayQ AT mail DOT gmail DOT com> <50643F9D DOT 601 AT tlinx DOT org> <CA+sc5mmgrN0kLe=6MA1vi4OcFsVkKu2D-c2XHycPYeObxqqo+w AT mail DOT gmail DOT com> <50645A84 DOT 7050601 AT tlinx DOT org> <CA+sc5m=Ct4fWTSQ=OtxjaOqdAUv3yD7+N1EOM5gVRkR8QLNW6Q AT mail DOT gmail DOT com>
In-Reply-To: <CA+sc5m=Ct4fWTSQ=OtxjaOqdAUv3yD7+N1EOM5gVRkR8QLNW6Q@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019