From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7563 invoked by alias); 27 Jul 2011 08:35:45 -0000 Received: (qmail 7131 invoked by uid 22791); 27 Jul 2011 08:35:42 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_YG X-Spam-Check-By: sourceware.org Received: from goliath.siemens.de (HELO goliath.siemens.de) (192.35.17.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jul 2011 08:35:27 +0000 Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id p6R8ZPKI002266 for ; Wed, 27 Jul 2011 10:35:25 +0200 Received: from DEMCHP99ET2MSX.ww902.siemens.net (demchp99et2msx.ww902.siemens.net [139.25.131.241]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id p6R8ZOVL004981 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 27 Jul 2011 10:35:25 +0200 Received: from DEMCHP99ET5MSX.ww902.siemens.net (139.25.131.175) by DEMCHP99ET2MSX.ww902.siemens.net (139.25.131.241) with Microsoft SMTP Server (TLS) id 8.3.192.1; Wed, 27 Jul 2011 10:35:53 +0200 Received: from DEMCHP99E84MSX.ww902.siemens.net ([169.254.1.57]) by DEMCHP99ET5MSX.ww902.siemens.net ([139.25.131.175]) with mapi; Wed, 27 Jul 2011 10:35:24 +0200 From: "Schwarz, Konrad" To: "cygwin@cygwin.com" Date: Wed, 27 Jul 2011 08:35:00 -0000 Subject: RE: Device names in /proc/mounts Message-ID: <9B10FEAACF062F48A095880A451FF0590380118100@DEMCHP99E84MSX.ww902.siemens.net> References: <20110725140038.GA22821@calimero.vinschen.de> In-Reply-To: <20110725140038.GA22821@calimero.vinschen.de> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-07/txt/msg00350.txt.bz2 > -----Original Message----- > From: Corinna Vinschen > Sent: Monday, July 25, 2011 4:01 PM > Subject: Re: Device names in /proc/mounts >=20 > On Jul 25 14:29, Schwarz, Konrad wrote: > > There seems no way of mapping device names (resp. Win32 Device=20 > > Namespace names) to mount points -- >=20 > Cygwin mount pounts are not mapping disk devices to POSIX=20 > pathnames, but > Win32 pathnames to POSIX pathnames. That is incompatibile with Linux's /proc/mount and mount(8). Furthermore, Cygwin is inconsistent in this respect, as it uses POSIX disk device names elsewhere, e.g., in the output of blkid(8). I would like to find the mount point of a disk using its volume label (or U= UID). blk_id (on both Linux and Cygwin) outputs a string of the form /dev/sdXY, given a volume label as an argument. In Cygwin, there is no way of figuring out where /dev/sdXY is mounted. In Linux, mount(8) or /proc/mounts contains the necessary information. > > the Cygwin User's Guide suggests using comparing the output of=20 > > /proc/partitions with the output of df(1) to match up the two. > >=20 > > It then pointedly uses the registry > > entry '\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices' -- which=20 > encodes the=20 > > mapping from NT device names to DOS device names -- as an=20 > example for=20 > > regtool(1) (see=20 > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > thnames-proc-registry). > > It does not explain how to decode the information there --=20 > but neither does MSDN. >=20 > Huh? This is just an example for the virtual /proc/registry access. > It has nothing to do with device mapping. I merely find it telling that the key used in the example is the one you would need to map between NT names for disks and DOS/Win32 names -- this is the section right after the one you refer to below. > See=20 > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > thnames-posixdevices > instead, which shows how POSIX devices are mapped to native=20 > NT devices.=20=20 But that is not enough. What is missing is how to map POSIX device names to Cygwin mount points. (This mapping obviously goes from POSIX device names to NT devices to DOS/Win32 names to Cygwin mount point, but the link from NT devices to DOS/Win32 names is missing.) =20 > > However, blk_id(8) describes volumes in terms of (Cygwin)=20 > device names=20 > > (/dev/sda2), so an easier to use mapping would be nice to have. It=20 > > would also increase compatibility between Cygwin and Linux. > >=20 > > Some poking around MSDN reveals the function QueryDosDevice. This=20 > > function's purpose would seem to be to map DOS names to=20 > Win32 device=20 > > names. Would it make sense to use this to populate the=20 > first column=20 > > of /proc/mounts (after mapping Win32 device names \\.\ to=20 > Cygwin device names /dev/sdxy)? >=20 > No. As I wrote above, Cygwin mount pounts are not mapping devices but > Win32 pathnames to POSIX pathnames. Devices just don't make=20 > sense in this context. The mapping from NT devices to POSIX=20 > devices is used for direct device access only. Well, since Win32 pathnames corresponding to volumes have NT device names, and NT device names have Cygwin device names, wouldn't it be more consistent to use the Cygwin device names in those Cygwin mount points? Cygwin should limit mapping between its and the Win32 namespace to the cygpath utility. Cygpath would need to be extended to support mapping between Win32 device names (COM1:, C:, ...) and Cygwin device names (/dev/ttyS0, /dev/sda1, ...). People wanting to mount a device using Win32 names would then use mount "$(cygpath "")" rather than mount -- 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