associating device names with cygdrive directories

Corinna Vinschen
Thu Aug 26 12:17:00 GMT 2010

On Aug 26 13:26, Corinna Vinschen wrote:
> On Aug 25 16:32, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> > On Wed, Aug 25, 2010 at 02:47:21PM -0500, Charles D. Russell wrote:
> > >On Linux, the mount command reveals the association between filesystem 
> > >names and /dev/ names, but Cygwin mount doesn't tell.
> > 
> > Is this what you want?  (The multiple spaces are really tabs.)
> > 
> > $ for F in /dev/s* ; do echo "$F    $(cygpath -w $F)" ; done
> I have another one:
>   $ for F in /dev/s* ; do echo "$F    $(cygpath -w $F)" ; done
>   /dev/sda    \\.\PhysicalDrive0
>   /dev/sda1    \\.\STORAGE#Volume#{781f8bd6-7d0d-11de-8012-806e6f6e6963}#0000000000100000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
>   /dev/sda2    \\.\Volume{781f8bda-7d0d-11de-8012-806e6f6e6963}
>   /dev/sda3    \\.\D:
> but there are two problems.
> Up to the current Cygwin 1.7.6 the info from /proc/partitions is
> incomplete for non-privileged users.  I just checked in a patch to
> Cygwin which allows the full partition info also for non-priv'ed users.
> Apart from that, the output of cygpath -w for devices isn't overly
> helpful yet.  I look into improving that a bit.

I applied a patch to cygpath which now prefers the \\.\X: DOS device
name over any other device name for harddisks.  In my case, the output
is now:

  $ for F in $(gawk '{if (FNR > 2) print "/dev/" $4;}' /proc/partitions) ; do echo "$F    $(./cygpath -w $F)" ; done
  /dev/sda    \\.\PhysicalDrive0
  /dev/sda1   \\.\Volume{781f8bd9-7d0d-11de-8012-806e6f6e6963}
  /dev/sda2   \\.\C:
  /dev/sda3   \\.\D:

/dev/sda1 is not available under a drive letter, so that's fine.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list