delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/07/25/10:01:43

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 25 Jul 2011 16:00:38 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Device names in /proc/mounts
Message-ID: <20110725140038.GA22821@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <9B10FEAACF062F48A095880A451FF0590380117C0C AT DEMCHP99E84MSX DOT ww902 DOT siemens DOT net>
MIME-Version: 1.0
In-Reply-To: <9B10FEAACF062F48A095880A451FF0590380117C0C@DEMCHP99E84MSX.ww902.siemens.net>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jul 25 14:29, Schwarz, Konrad wrote:
> There seems no way of mapping device names (resp. Win32 Device Namespace names) to mount points --

Cygwin mount pounts are not mapping disk devices to POSIX pathnames, but
Win32 pathnames to POSIX pathnames.

> the Cygwin User's Guide suggests using comparing the output of /proc/partitions with the output
> of df(1) to match up the two.
> 
> It then pointedly uses the registry
> entry '\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices' -- which encodes the mapping
> from NT device names to DOS device names -- as an example for regtool(1)
> (see http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-proc-registry).
> It does not explain how to decode the information there -- but neither does MSDN.

Huh?  This is just an example for the virtual /proc/registry access.
It has nothing to do with device mapping.

See http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices
instead, which shows how POSIX devices are mapped to native NT
devices.  

> However, blk_id(8) describes volumes in terms of (Cygwin) device names (/dev/sda2),
> so an easier to use mapping would be nice to have.  It would also increase compatibility
> between Cygwin and Linux.
> 
> Some poking around MSDN reveals the function QueryDosDevice.  This function's purpose would
> seem to be to map DOS names to Win32 device names.  Would it make sense to use
> this to populate the first column of /proc/mounts (after mapping Win32 device
> names \\.\ to Cygwin device names /dev/sdxy)?

No.  As I wrote above, Cygwin mount pounts are not mapping devices but
Win32 pathnames to POSIX pathnames.  Devices just don't make sense in
this context.  The mapping from NT devices to POSIX devices is used for
direct device access only.


Corinna

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

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