X-Recipient: archive-cygwin AT delorie DOT 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" To: "cygwin AT cygwin DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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