X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-4.6 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI
X-Spam-Check-By: sourceware.org
From: "Schwarz, Konrad" <konrad.schwarz@siemens.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Date: Mon, 25 Jul 2011 14:29:46 +0200
Subject: Device names in /proc/mounts
Message-ID: <9B10FEAACF062F48A095880A451FF0590380117C0C@DEMCHP99E84MSX.ww902.siemens.net>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p6PCUJGf028522

Hi,

in Linux, /proc/mounts maps device names (/dev/sda2) to mount points (/home).

in Cygwin, /proc/mounts maps DOS names (C:) to cygwin names (/cygdrive/c).
This is not terribly useful.

There seems no way of mapping device names (resp. Win32 Device Namespace names) to mount points --
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.

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

Regards
Konrad Schwarz

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


