Re: Is it OK to mount cygdrive on / ?

2017-02-05 Thread cyg Simple
On 2/3/2017 4:09 PM, Rustam wrote:
> I've added an extra / mountpoint in /etc/fstab in order to be able to
> access C: without /cygdrive like this:
> 
> none /cygdrive cygdrive binary,posix=0,user 0 0
> none / cygdrive binary,posix=0,user 0 0
> 
> It seems to work, I can access the C: drive with just /c.
> 
> But normally an "ls /cygdrive" should list the drives, whereas "ls /"
> lists the contents of the Cygwin root. So it seems there are now two
> root mountpoints overlaying each other.
> 
> So I was wondering if my approach is if this is technically undefined
> behavior and might conceivably break something or is it OK (less the
> drive listing limitation mentioned above).
> 

I've used the / as /cygdrive since the beginning of /cygdrive.  The
issue you see is the fact that Cygwin doesn't require a physical
directory to mount as Linux and friends do.  If you want to see them
then you simply create a physical empty directory in the Cygwin root
directory.  I do find it interesting that the mount also changes the
output of `ls /proc/cygdrive/` but that is a different issue.

Another method to see which drive letters are available is to simply
type mount at the command prompt.

-- 
cyg Simple

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



Re: Is it OK to mount cygdrive on / ? (usually, but may not be as portable).

2017-02-05 Thread Andrey Repin
Greetings, L. A. Walsh!

>> If you want to access Windows path, recommended route lies through the use of
>> cygpath utility to convert native paths to the Cygwin scheme. Et vice versa.
>>   
> I wouldn't recommend that -- it's too hard to type:

I didn't say "typing" anywhere.
I did mean permanent use, i.e. scripting.


-- 
With best regards,
Andrey Repin
Sunday, February 5, 2017 11:47:10

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



Re: Is it OK to mount cygdrive on / ? (usually, but may not be as portable).

2017-02-04 Thread L. A. Walsh

Andrey Repin wrote:
Accessing drive letters directly from inside Cygwin is often 
considered a grey area.


   How is it grey?


Too much may happen on this border. You have to clearly understand, how Cygwin 
interact with other system, to avoid issues.
  


I.e. if you think you may have programs that also want to use
/bin /usr, /sbin, /lib /etc, there could be conflicts.



If you want to access Windows path, recommended route lies through the use of
cygpath utility to convert native paths to the Cygwin scheme. Et vice versa.
  

I wouldn't recommend that -- it's too hard to type:

/> ls -d $(cygpath S:\Music\Anime)   
ls: cannot access S:MusicAnime: No such file or directory

/> ls -d $(cygpath 'S:\Music\Anime')
/s/Music/Anime/
...(vs.)
/> ls -d /s/Music/Anime
/s/Music/Anime/
-or-
ls -d $(cygpath \\ishtar\Music)
ls: cannot access /ishtarMusic: No such file or directory
/> ls -d $(cygpath '\\ishtar\Music')
//ishtar/Music/
---
Much easier just to type "//hostname/Share".


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



Re: Is it OK to mount cygdrive on / ?

2017-02-04 Thread Andrey Repin
Greetings, Rustam!

> I've added an extra / mountpoint in /etc/fstab in order to be able to
> access C: without /cygdrive like this:

> none /cygdrive cygdrive binary,posix=0,user 0 0
> none / cygdrive binary,posix=0,user 0 0

Only one cygdrive mount is effective.

> It seems to work, I can access the C: drive with just /c.

> But normally an "ls /cygdrive" should list the drives, whereas "ls /"
> lists the contents of the Cygwin root. So it seems there are now two
> root mountpoints overlaying each other.

> So I was wondering if my approach is if this is technically undefined
> behavior and might conceivably break something or is it OK (less the
> drive listing limitation mentioned above).

Undefined behavior, but only because you're using two mount entries at once.
Accessing drive letters directly from inside Cygwin is often considered a grey 
area.
Too much may happen on this border. You have to clearly understand, how Cygwin
interact with other system, to avoid issues.
If you want to access Windows path, recommended route lies through the use of
cygpath utility to convert native paths to the Cygwin scheme. Et vice versa.


-- 
With best regards,
Andrey Repin
Saturday, February 4, 2017 17:17:15

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



Re: Is it OK to mount cygdrive on / ?

2017-02-03 Thread Wells, Roger K.

On 02/03/2017 04:10 PM, Rustam wrote:

I've added an extra / mountpoint in /etc/fstab in order to be able to
access C: without /cygdrive like this:

none /cygdrive cygdrive binary,posix=0,user 0 0
none / cygdrive binary,posix=0,user 0 0

It seems to work, I can access the C: drive with just /c.

But normally an "ls /cygdrive" should list the drives, whereas "ls /"
lists the contents of the Cygwin root. So it seems there are now two
root mountpoints overlaying each other.

So I was wondering if my approach is if this is technically undefined
behavior and might conceivably break something or is it OK (less the
drive listing limitation mentioned above).

Thanks,
Rustam


The way that I do it (and have for a long time) is a line in my 
.bash_profile file:

mount --change-cygdrive-prefix /

then ls /c does what you want
but ls / may not

HTH

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





--
Roger Wells, P.E.
leidos
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.we...@leidos.com


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



Is it OK to mount cygdrive on / ?

2017-02-03 Thread Rustam
I've added an extra / mountpoint in /etc/fstab in order to be able to
access C: without /cygdrive like this:

none /cygdrive cygdrive binary,posix=0,user 0 0
none / cygdrive binary,posix=0,user 0 0

It seems to work, I can access the C: drive with just /c.

But normally an "ls /cygdrive" should list the drives, whereas "ls /"
lists the contents of the Cygwin root. So it seems there are now two
root mountpoints overlaying each other.

So I was wondering if my approach is if this is technically undefined
behavior and might conceivably break something or is it OK (less the
drive listing limitation mentioned above).

Thanks,
Rustam

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