* Device names in /proc/mounts @ 2011-07-25 12:30 Schwarz, Konrad 2011-07-25 14:01 ` Corinna Vinschen 2011-07-25 15:07 ` Christopher Faylor 0 siblings, 2 replies; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-25 12:30 UTC (permalink / raw) To: cygwin 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-25 12:30 Device names in /proc/mounts Schwarz, Konrad @ 2011-07-25 14:01 ` Corinna Vinschen 2011-07-27 8:15 ` Schwarz, Konrad 2011-07-27 8:35 ` Schwarz, Konrad 2011-07-25 15:07 ` Christopher Faylor 1 sibling, 2 replies; 25+ messages in thread From: Corinna Vinschen @ 2011-07-25 14:01 UTC (permalink / raw) To: cygwin 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-25 14:01 ` Corinna Vinschen @ 2011-07-27 8:15 ` Schwarz, Konrad 2011-07-27 8:35 ` Schwarz, Konrad 1 sibling, 0 replies; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-27 8:15 UTC (permalink / raw) To: cygwin > -----Original Message----- > From: Corinna Vinschen > Sent: Monday, July 25, 2011 4:01 PM > Subject: Re: Device names in /proc/mounts > > 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. 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 UUID). 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 > > /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#pa > thnames-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. 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 > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > thnames-posixdevices > instead, which shows how POSIX devices are mapped to native > NT devices. No -- this section does not cover disks. It describes other types of devices, but not disks. > > 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. 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 "<win32path>")" <posixpath> rather than mount <win32path> <posixpath> -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-25 14:01 ` Corinna Vinschen 2011-07-27 8:15 ` Schwarz, Konrad @ 2011-07-27 8:35 ` Schwarz, Konrad 2011-07-27 9:41 ` Corinna Vinschen 1 sibling, 1 reply; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-27 8:35 UTC (permalink / raw) To: cygwin > -----Original Message----- > From: Corinna Vinschen > Sent: Monday, July 25, 2011 4:01 PM > Subject: Re: Device names in /proc/mounts > > 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. 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 UUID). 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 > > /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#pa > thnames-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. 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 > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > thnames-posixdevices > instead, which shows how POSIX devices are mapped to native > NT devices. 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.) > > 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. 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 "<win32path>")" <posixpath> rather than mount <win32path> <posixpath> -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-27 8:35 ` Schwarz, Konrad @ 2011-07-27 9:41 ` Corinna Vinschen 2011-07-27 11:19 ` Christopher Faylor 2011-07-28 8:18 ` Schwarz, Konrad 0 siblings, 2 replies; 25+ messages in thread From: Corinna Vinschen @ 2011-07-27 9:41 UTC (permalink / raw) To: cygwin On Jul 27 10:35, Schwarz, Konrad wrote: > > From: Corinna Vinschen > > 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. > > That is incompatibile with Linux's /proc/mount and mount(8). Yes. Cygwin is *not* an operating system. It does not mount devices. That's the task of the NT kernel as in "\??\C:" ==> "\Device\HarddiskVolume2". Cygwin mount points are mapping from a POSIX to a Win32 path, nothing else. That's how it is defined. > 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 UUID). > blk_id (on both Linux and Cygwin) outputs a string of the form /dev/sdXY, > given a volume label as an argument. As I wrote before, the /dev device names are only used for raw device access, not for the mount table. Given that the mount table contains paths like: D:/foo/bar /baz xyz binary,posix=0 0 0 //server/share/some/path /home/dummy smbfs binary,noacl 0 0 how would you map them to devices? Both paths are not devices, except that they are equivalent to the NT kernel paths \Device\HarddiskVolume3\foo\bar \Device\Mup\server\share\some\path > In Cygwin, there is no way of figuring out where /dev/sdXY is mounted. Yes, for the simple reason that they are not mounted in Cygwin, but only in NT. What you're asking for just doesn't make sense in this context. > > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > > thnames-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. > > 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. Ok, here's my official reply: This was just some example. It was not written with any ulterior motive. I just opened regedit and searched for a nice registry key to use as an example. It was not even written at the same time I rewrote the preceeding chapters. I'm sorry that you misinterpreted it, but the fact that the example was in another, unrelated section of the user's guide could have been used as a clue. > > http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pa > > thnames-posixdevices > > instead, which shows how POSIX devices are mapped to native > > NT devices. > > 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.) No. POSIX devices are not mounted at all. Win32 paths are. POSIX devices are only used for raw device access. There is no mapping from POSIX device to POSIX path. > > 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. > > 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? No. There is no reason to carry the Linux compatibility to such extremes. Forcing the users to use device names in /etc/fstab just won't fly. Let's use the above two examples again: D:/foo/bar /baz xyz binary,posix=0 0 0 //server/share/some/path /home/dummy smbfs binary,noacl 0 0 What would you like to see in fstab for both of them? /Device/HarddiskVolume3/foo/bar /baz xyz binary,posix=0 0 0 or /dev/sdb1/foo/bar /baz xyz binary,posix=0 0 0 Both are not Linux compatible either, since you can't use expressions like /dev/sdb1/foo/bar under Linux to access subdirectories on a drive. And what about remote shares? /Device/Mup/server/share/some/path /home/dummy smbfs binary,noacl 0 0 Where's the POSIX device here? There is none. Do you want to invent one, like, say, /dev/mup? There's no equivalent device on Linux. Again, not Linux compatible. Cygwin tries to have a Linux-like API. But it's running on Win32. So there are limitation what we can do and what makes sense, given the context. 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-27 9:41 ` Corinna Vinschen @ 2011-07-27 11:19 ` Christopher Faylor 2011-07-28 8:18 ` Schwarz, Konrad 1 sibling, 0 replies; 25+ messages in thread From: Christopher Faylor @ 2011-07-27 11:19 UTC (permalink / raw) To: cygwin On Wed, Jul 27, 2011 at 11:40:51AM +0200, Corinna Vinschen wrote: >On Jul 27 10:35, Schwarz, Konrad wrote: >>>From: Corinna Vinschen 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. >> >>That is incompatibile with Linux's /proc/mount and mount(8). > >Yes. Cygwin is *not* an operating system. It does not mount devices. >That's the task of the NT kernel as in > >"\??\C:" ==> "\Device\HarddiskVolume2". > >Cygwin mount points are mapping from a POSIX to a Win32 path, nothing >else. That's how it is defined. And that is how it has operated (and has been documented to operate) for, oh I don't know, fifteen+ years or so? It's not going to change. cgf -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-27 9:41 ` Corinna Vinschen 2011-07-27 11:19 ` Christopher Faylor @ 2011-07-28 8:18 ` Schwarz, Konrad 2011-07-28 11:22 ` Christopher Faylor 1 sibling, 1 reply; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-28 8:18 UTC (permalink / raw) To: cygwin > From: Corinna Vinschen > Sent: Wednesday, July 27, 2011 11:41 AM > Subject: Re: Device names in /proc/mounts > D:/foo/bar /baz xyz binary,posix=0 0 0 > //server/share/some/path /home/dummy smbfs binary,noacl 0 0 > > how would you map them to devices? Both paths are not > devices, except that they are equivalent to the NT kernel paths > > \Device\HarddiskVolume3\foo\bar > \Device\Mup\server\share\some\path Why not display these (in /proc/mounts) as /cygdrive/d/foo/bar /baz bind ... //server/share/some/path /home/dummy bind ... I think this is the Linux bind mount syntax. > > In Cygwin, there is no way of figuring out where /dev/sdXY > is mounted. > > Yes, for the simple reason that they are not mounted in > Cygwin, but only in NT. What you're asking for just doesn't > make sense in this context. As far as I understand, Cygwin mount knows about - fixed mounts /, /usr/bin, /usr/lib - user-defined mounts taken from /etc/fstab, /etc/fstab.d, and the command-line - Win32 drive letters implicitly mounted under /cygdrive The last case is actually handled by Windows, as you point out. What would be the problem (otherwise than backwards compatibility) in using Cygwin device names in this last case? For the second case (and the first, should you so desire), you could use the /cygdrive prefix or //server/share notation, as above. > No. There is no reason to carry the Linux compatibility to > such extremes. Forcing the users to use device names in > /etc/fstab just won't fly. Let's use the above two examples again: > > D:/foo/bar /baz xyz binary,posix=0 0 0 > //server/share/some/path /home/dummy smbfs binary,noacl 0 0 > > What would you like to see in fstab for both of them? > > /Device/HarddiskVolume3/foo/bar /baz xyz binary,posix=0 0 0 > > or > > /dev/sdb1/foo/bar /baz xyz binary,posix=0 0 0 > > Both are not Linux compatible either, since you can't use > expressions like /dev/sdb1/foo/bar under Linux to access > subdirectories on a drive. Well, I would use /cygdrive/d/foo/bar /baz bind ... as I suggested above. Even better would be if Linux rebinding did it this way. But mostly I would like /dev/sda1 /cygdrive/c ntfs ... rather than C: /cygdrive/c ntfs ... > And what about remote shares? > > /Device/Mup/server/share/some/path /home/dummy smbfs > binary,noacl 0 0 > > Where's the POSIX device here? There is none. Do you want > to invent one, like, say, /dev/mup? There's no equivalent > device on Linux. Again, as suggested above: //server/share/some/path /home/dummy smbs ... > Cygwin tries to have a Linux-like API. > But it's running on Win32. So there are limitation what we > can do and what makes sense, given the context. I quite understand, it's just that I think you could sensibly stretch the limits a little bit more in this case :-). -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-28 8:18 ` Schwarz, Konrad @ 2011-07-28 11:22 ` Christopher Faylor 2011-07-29 7:46 ` Schwarz, Konrad 0 siblings, 1 reply; 25+ messages in thread From: Christopher Faylor @ 2011-07-28 11:22 UTC (permalink / raw) To: cygwin On Thu, Jul 28, 2011 at 10:18:26AM +0200, Schwarz, Konrad wrote: >As far as I understand, Cygwin mount knows about >- fixed mounts /, /usr/bin, /usr/lib >- user-defined mounts taken from /etc/fstab, /etc/fstab.d, and the command-line >- Win32 drive letters implicitly mounted under /cygdrive > >The last case is actually handled by Windows, as you point out. > >What would be the problem (otherwise than backwards compatibility) in using >Cygwin device names in this last case? The above is inaccurate and misleading. Cygwin's mount utility is a mapping between windows paths and posix paths. That's it. The "drive letters" above could be anything that Windows maps to a drive letter. A drive does not necessarily directly map to a physical device. >For the second case (and the first, should you so desire), you could use >the /cygdrive prefix or //server/share notation, as above. /cygdrive is a user-settable value. Some users use other values like "/dev" instead of /cygdrive. Some people get rid of the /cygdrive entirely and just map to /a. We're not going to introduce this level of recursive confusion to the mount table handling. Please give it a rest. We're not changing the mount table for you. cgf -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-28 11:22 ` Christopher Faylor @ 2011-07-29 7:46 ` Schwarz, Konrad 2011-07-29 9:21 ` Corinna Vinschen 0 siblings, 1 reply; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-29 7:46 UTC (permalink / raw) To: cygwin > -----Original Message----- > From: Christopher Faylor > Subject: Re: Device names in /proc/mounts > The "drive letters" above could be anything that > Windows maps to a drive letter. A drive does not necessarily > directly map to a physical device. That's why the proposal suggests using /dev/sdXY names only when a driver letter does indeed map to a hard disk. > /cygdrive is a user-settable value. So use whatever /cygdrive is actually set to. > Some users use other > values like "/dev" instead of /cygdrive. How does /dev/ttyS0 resolve in this case? Those users have already shot themselves in the foot. > Some people get rid > of the /cygdrive entirely and just map to /a. Which would be a rebind. /cygdrive (or the user's selected replacement) still exists, right? > We're not > going to introduce this level of recursive confusion to the > mount table handling. The proposal is sound. It works on Linux, after all. > Please give it a rest. We're not changing the mount table for you. Ok. Can you answer the following question: Given a volume label, how does one figure out where the corresponding volume has been mounted into the Cygwin namespace? Thanks, 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-29 7:46 ` Schwarz, Konrad @ 2011-07-29 9:21 ` Corinna Vinschen 2011-07-29 13:34 ` Schwarz, Konrad 0 siblings, 1 reply; 25+ messages in thread From: Corinna Vinschen @ 2011-07-29 9:21 UTC (permalink / raw) To: cygwin On Jul 29 09:45, Schwarz, Konrad wrote: > > From: Christopher Faylor > > We're not > > going to introduce this level of recursive confusion to the > > mount table handling. > > The proposal is sound. It works on Linux, after all. Ok, so I assume Cygwin should be able to load Linux kernel modules and provide tools like modprobe and lsmod, right? After all, it works on Linux. It does not really help to drive the compatibility in with a hammer. > > Please give it a rest. We're not changing the mount table for you. > Ok. > > Can you answer the following question: > > Given a volume label, how does one figure out where the corresponding > volume has been mounted into the Cygwin namespace? We're not mounting volumes, we're mounting Win32 paths. There is no direct correspondence between volumes and Cygwin mount points. 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-29 9:21 ` Corinna Vinschen @ 2011-07-29 13:34 ` Schwarz, Konrad 2011-07-29 20:16 ` Corinna Vinschen 2011-07-29 21:28 ` Device names in /proc/mounts Buchbinder, Barry (NIH/NIAID) [E] 0 siblings, 2 replies; 25+ messages in thread From: Schwarz, Konrad @ 2011-07-29 13:34 UTC (permalink / raw) To: cygwin > > Can you answer the following question: > > > > Given a volume label, how does one figure out where the > corresponding > > volume has been mounted into the Cygwin namespace? > > We're not mounting volumes, we're mounting Win32 paths. > There is no direct correspondence between volumes and Cygwin > mount points. When a person inserts removable media (USB memory stick, optical disk, ...), Windows assigns a more-or-less random drive letter. Cygwin automatically makes this drive letter available under /cygdrive/ (or whatever the user has renamed /cygdrive to). Given a (unique) volume label or disk UUID, blk_id(8) on both Linux and Cygwin tells you the disk and partition in /dev/sdXY format. In Linux, you can look up the mount point for device /dev/sdXY in /proc/mounts or in the output of mount(8). Thus, given a volume label, you can figure out where to access the files on the volume. How do you do that in Cygwin? -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-29 13:34 ` Schwarz, Konrad @ 2011-07-29 20:16 ` Corinna Vinschen 2011-07-30 4:53 ` Christopher Faylor ` (2 more replies) 2011-07-29 21:28 ` Device names in /proc/mounts Buchbinder, Barry (NIH/NIAID) [E] 1 sibling, 3 replies; 25+ messages in thread From: Corinna Vinschen @ 2011-07-29 20:16 UTC (permalink / raw) To: cygwin On Jul 29 15:34, Schwarz, Konrad wrote: > > > Can you answer the following question: > > > > > > Given a volume label, how does one figure out where the > > corresponding > > > volume has been mounted into the Cygwin namespace? > > > > We're not mounting volumes, we're mounting Win32 paths. > > There is no direct correspondence between volumes and Cygwin > > mount points. > > When a person inserts removable media (USB memory stick, optical disk, ...), > Windows assigns a more-or-less random drive letter. > Cygwin automatically makes this drive letter available > under /cygdrive/ (or whatever the user has renamed /cygdrive to). > > Given a (unique) volume label or disk UUID, blk_id(8) on > both Linux and Cygwin tells you the disk and partition > in /dev/sdXY format. It does? Interesting. Where does it get the data under Cygwin? > In Linux, you can look up the mount point for device /dev/sdXY > in /proc/mounts or in the output of mount(8). Thus, given > a volume label, you can figure out where to access the files > on the volume. > > How do you do that in Cygwin? ls /cygdrive. Insert the disk. ls /cygdrive again. There's a new directory entry now. Or, open the "Computer" Window on your desktop. 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-29 20:16 ` Corinna Vinschen @ 2011-07-30 4:53 ` Christopher Faylor 2011-07-30 8:18 ` Corinna Vinschen 2011-08-06 23:53 ` pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) Cyrille Lefevre 2012-09-13 16:27 ` associating volume labels with drive letters Nellis, Kenneth 2 siblings, 1 reply; 25+ messages in thread From: Christopher Faylor @ 2011-07-30 4:53 UTC (permalink / raw) To: cygwin On Fri, Jul 29, 2011 at 10:15:56PM +0200, Corinna Vinschen wrote: >On Jul 29 15:34, Schwarz, Konrad wrote: >> > > Can you answer the following question: >> > > >> > > Given a volume label, how does one figure out where the >> > corresponding >> > > volume has been mounted into the Cygwin namespace? >> > >> > We're not mounting volumes, we're mounting Win32 paths. >> > There is no direct correspondence between volumes and Cygwin >> > mount points. >> >> When a person inserts removable media (USB memory stick, optical disk, ...), >> Windows assigns a more-or-less random drive letter. >> Cygwin automatically makes this drive letter available >> under /cygdrive/ (or whatever the user has renamed /cygdrive to). >> >> Given a (unique) volume label or disk UUID, blk_id(8) on >> both Linux and Cygwin tells you the disk and partition >> in /dev/sdXY format. > >It does? Interesting. Where does it get the data under Cygwin? Huh. On my system blk_id(8) says "command not found". And, http://cygwin.com/cgi-bin2/package-grep.cgi?grep=blk_id says "Found 0 matches for blk_id" cgf -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-30 4:53 ` Christopher Faylor @ 2011-07-30 8:18 ` Corinna Vinschen 2011-08-01 13:10 ` Nellis, Kenneth 0 siblings, 1 reply; 25+ messages in thread From: Corinna Vinschen @ 2011-07-30 8:18 UTC (permalink / raw) To: cygwin On Jul 30 00:52, Christopher Faylor wrote: > On Fri, Jul 29, 2011 at 10:15:56PM +0200, Corinna Vinschen wrote: > >On Jul 29 15:34, Schwarz, Konrad wrote: > >> > > Can you answer the following question: > >> > > > >> > > Given a volume label, how does one figure out where the > >> > corresponding > >> > > volume has been mounted into the Cygwin namespace? > >> > > >> > We're not mounting volumes, we're mounting Win32 paths. > >> > There is no direct correspondence between volumes and Cygwin > >> > mount points. > >> > >> When a person inserts removable media (USB memory stick, optical disk, ...), > >> Windows assigns a more-or-less random drive letter. > >> Cygwin automatically makes this drive letter available > >> under /cygdrive/ (or whatever the user has renamed /cygdrive to). > >> > >> Given a (unique) volume label or disk UUID, blk_id(8) on > >> both Linux and Cygwin tells you the disk and partition > >> in /dev/sdXY format. > > > >It does? Interesting. Where does it get the data under Cygwin? > > Huh. On my system blk_id(8) says "command not found". And, > > http://cygwin.com/cgi-bin2/package-grep.cgi?grep=blk_id > > says "Found 0 matches for blk_id" Konrad means blkid. It's in the util-linux package. 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-30 8:18 ` Corinna Vinschen @ 2011-08-01 13:10 ` Nellis, Kenneth 2011-08-01 13:22 ` Christopher Faylor 0 siblings, 1 reply; 25+ messages in thread From: Nellis, Kenneth @ 2011-08-01 13:10 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1423 bytes --] > From: Corinna Vinschen > > Konrad means blkid. It's in the util-linux package. That's funny. Setup indicates my util-linux package is up-to-date with version 2.17.2-1, but yet: $ type blkid -bash: type: blkid: not found $ which blkid which: no blkid in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Business Objects/Common/3.5/bin/NOTES:/cygdrive/c/Program Files/Business Objects/Common/3.5/bin/NOTES/DATA:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/Intel/DMIX:/cygdrive/c/Program Files/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/Wave Systems Corp/Gemalto/Access Client/v5:/cygdrive/c/Program Files/Common Files/Roxio Shared/DLLShared:/cygdrive/c/Program Files/Common Files/Roxio Shared/9.0/DLLShared:/cygdrive/c/Program Files/IBM/RationalSDLC/ClearCase/bin:/cygdrive/c/Program Files/IBM/RationalSDLC/common:/cygdrive/c/Program Files/Microsoft SQL Server/90/Tools/binn:/cygdrive/c/Program Files/QuickTime/QTSystem:/cygdrive/c/Program Files/Graphviz2.26.3/bin:/cygdrive/d/cyghome/knellis/scripts/acs:/cygdrive/d/cyghome/knellis/scripts:/cygdrive/d/cyghome/knellis/bin/i686:/cygdrive/c/Program Files/Microsoft Office/Office12) $ Is it hiding in an obscure directory not part of the standard PATH? cygcheck -svr | attached --Ken Nellis [-- Attachment #2: cygcheck.out --] [-- Type: application/octet-stream, Size: 32391 bytes --] [-- Attachment #3: Type: text/plain, Size: 218 bytes --] -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-08-01 13:10 ` Nellis, Kenneth @ 2011-08-01 13:22 ` Christopher Faylor 0 siblings, 0 replies; 25+ messages in thread From: Christopher Faylor @ 2011-08-01 13:22 UTC (permalink / raw) To: cygwin On Mon, Aug 01, 2011 at 08:10:30AM -0500, Nellis, Kenneth wrote: >> From: Corinna Vinschen >> >> Konrad means blkid. It's in the util-linux package. > >That's funny. Setup indicates my util-linux package is up-to-date >with version 2.17.2-1, but yet: > >$ type blkid >-bash: type: blkid: not found >$ which blkid >which: no blkid in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Business Objects/Common/3.5/bin/NOTES:/cygdrive/c/Program Files/Business Objects/Common/3.5/bin/NOTES/DATA:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/Intel/DMIX:/cygdrive/c/Program Files/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/Wave Systems Corp/Gemalto/Access Client/v5:/cygdrive/c/Program Files/Common Files/Roxio Shared/DLLShared:/cygdrive/c/Program Files/Common Files/Roxio Shared/9.0/DLLShared:/cygdrive/c/Program Files/IBM/RationalSDLC/ClearCase/bin:/cygdrive/c/Program Files/IBM/RationalSDLC/common:/cygdrive/c/Program Files/Microsoft SQL Server/90/Tools/binn:/cygdrive/c/Program Files/QuickTime/QTSystem:/cygdrive/c/Program Files/Graphviz2.26.3/bin:/cygdrive/d/cyghome/knellis/scripts/acs:/cygdrive/d/cyghome/knellis/scripts:/cygdrive/d/cyghome/knellis/bin/i686:/cygdrive/c/Program Fi >les/Microsoft Office/Office12) >$ > >Is it hiding in an obscure directory not part of the standard PATH? http://cygwin.com/packages/ shows that the binary is in /usr/sbin. cgf -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) 2011-07-29 20:16 ` Corinna Vinschen 2011-07-30 4:53 ` Christopher Faylor @ 2011-08-06 23:53 ` Cyrille Lefevre 2011-08-07 11:38 ` Corinna Vinschen 2012-09-13 16:27 ` associating volume labels with drive letters Nellis, Kenneth 2 siblings, 1 reply; 25+ messages in thread From: Cyrille Lefevre @ 2011-08-06 23:53 UTC (permalink / raw) To: cygwin Le 29/07/2011 22:15, Corinna Vinschen a écrit : > On Jul 29 15:34, Schwarz, Konrad wrote: >>>> Can you answer the following question: >>>> >>>> Given a volume label, how does one figure out where the >>> corresponding >>>> volume has been mounted into the Cygwin namespace? >>> >>> We're not mounting volumes, we're mounting Win32 paths. >>> There is no direct correspondence between volumes and Cygwin >>> mount points. >> >> When a person inserts removable media (USB memory stick, optical disk, ...), >> Windows assigns a more-or-less random drive letter. >> Cygwin automatically makes this drive letter available >> under /cygdrive/ (or whatever the user has renamed /cygdrive to). >> >> Given a (unique) volume label or disk UUID, blk_id(8) on >> both Linux and Cygwin tells you the disk and partition >> in /dev/sdXY format. > > It does? Interesting. Where does it get the data under Cygwin? > >> In Linux, you can look up the mount point for device /dev/sdXY >> in /proc/mounts or in the output of mount(8). Thus, given >> a volume label, you can figure out where to access the files >> on the volume. >> >> How do you do that in Cygwin? > > ls /cygdrive. Insert the disk. ls /cygdrive again. There's a new > directory entry now. > > Or, open the "Computer" Window on your desktop. some times ago, someone (you?) modifies cygpath to handle /dev/sdXY paths. however, it seems there is a problem somewhere ? v2$ uname -a CYGWIN_NT-6.0 pcvista 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin v2$ /usr/sbin/blkid /dev/sda1: LABEL="BOOT500G0 (CW_VM_2)" UUID="905A77A75A77892C" TYPE="ntfs" /dev/sda2: LABEL="DATA500G0 (DL_2)" UUID="3CBA5BBFBA5B747C" TYPE="ntfs" /dev/sda3: LABEL="RECOVER_2" UUID="8644-3F52" TYPE="vfat" /dev/sda4: UUID="e57dd3da-585e-4d23-9761-f714c75f32c0" SEC_TYPE="ext2" TYPE="ext3" /dev/sda5: UUID="138b9a25-2681-4b4f-a428-ff8dd62e18ff" TYPE="swap" /dev/sdb1: LABEL="ESATA2T1 (MOVIES)" UUID="1E5275B85275956D" TYPE="ntfs" /dev/sdc1: LABEL="ESATA2T2 (OAV_SERIES_BD_DOC_PSP)" UUID="DE6EC4C36EC49625" TYPE="ntfs" /dev/sdd1: LABEL="SATA500G0 (BOOT_CW_VM)" UUID="905A77A75A77892C" TYPE="ntfs" /dev/sdd2: LABEL="SATA500G1 (DL)" UUID="4024F55724F55080" TYPE="ntfs" /dev/sdd3: LABEL="RECOVER" UUID="8644-3F52" TYPE="vfat" /dev/sde1: LABEL="SATA500G2 (EMULE_NORTON)" UUID="886606C66606B54A" TYPE="ntfs" /dev/sdi1: LABEL="USB500G1 (MM_OLD_TUHS)" UUID="4CA87E8AA87E7276" TYPE="ntfs" /dev/sdj1: LABEL="USB1T1 (REPS)" UUID="FEB2DCA1B2DC5FA7" TYPE="ntfs" v2$ cygpath -w $(/usr/sbin/blkid | cut -d: -f1 \\.\E: \\.\G: \\.\H: \\.\STORAGE#Volume#1&19f7e59c&0&Signature1A08653EOffset320053F800Length12996C000#{7f108a28-9833-4b3b-b780-2c6b5fa5c062} \\.\STORAGE#Volume#1&19f7e59c&0&Signature1A08653EOffset3329EB3600Length11A5CA00#{7f108a28-9833-4b3b-b780-2c6b5fa5c062} \\.\I: \\.\J: \\.\C: \\.\D: E:0 E:1 E:5 E:6 sda1..5 ok sdb1, sdc1, sdd1..2 ok sdd3 ko E:0 instead of R: sde1 ko E:1 instead of S: sdi1 ko E:2 instead of F: sdj1 ko E:3 instead of K: any ideas ? part of cygcheck -s : Cygwin Configuration Diagnostics Current System Time: Sun Aug 07 01:38:51 2011 Windows Vista Home Premium Ver 6.0 Build 6002 Service Pack 2 Path: C:\cygwin\home\Cyrille\bin C:\cygwin\usr\local\bin C:\cygwin\bin C:\Windows\system32 C:\Windows C:\Windows\system32\wbem C:\cygwin\lib\lapack C:\cygwin\usr\pkg\bin C:\cygwin\opt\wbin Output from C:\cygwin\bin\id.exe UID: 1000(Cyrille) GID: 513(None) 513(None) 0(root) 544(Administrateurs) 545(Utilisateurs) SysDir: C:\Windows\system32 WinDir: C:\Windows USER = 'Cyrille' PWD = '/home/Cygille' CYGWIN = 'nodosfilewarning' HOME = '/home/Cyrille' obcaseinsensitive set to 1 Cygwin installations found in the registry: System: Key: 50a84960ed2ca80d Path: C:\cygwin System: Key: c5e39b7a9d22bafb Path: C:\cygwin System: Key: c5e39b7a9d22bafb?"?? Path: C:\cygwin System: Key: a8fb4064ab2b92ac Path: C:\Windows (ORPHANED) System: Key: 10b99c96e3dd575f Path: C:\Users\Cyrille\Temp (ORPHANED) c: hd NTFS 238469Mb 67% CP CS UN PA FC SATA500G0 (BOOT_CW_VM) d: hd NTFS 204799Mb 95% CP CS UN PA FC SATA500G1 (DL) e: hd NTFS 204800Mb 55% CP CS UN PA FC BOOT500G0 (CW_VM_2) f: hd NTFS 476936Mb 87% CP CS UN PA FC USB500G1 (MM_OLD_TUHS) g: hd NTFS 204799Mb 91% CP CS UN PA FC DATA500G0 (DL_2) h: hd FAT32 33659Mb 17% CP UN RECOVER_2 i: hd NTFS 1907726Mb 100% CP CS UN PA FC ESATA2T1 (MOVIES) j: hd NTFS 1907726Mb 99% CP CS UN PA FC ESATA2T2 (OAV_SERIES_BD_DOC_PSP) k: hd NTFS 953866Mb 98% CP CS UN PA FC USB1T1 (REPS) o: cd N/A N/A r: hd FAT32 33658Mb 95% CP UN RECOVER s: hd NTFS 476936Mb 77% CP CS UN PA FC SATA500G2 (EMULE_NORTON) v: cd N/A N/A w: cd N/A N/A x: fd N/A N/A y: fd N/A N/A z: fd N/A N/A C:\cygwin / system binary,auto C:\cygwin-legacy /legacy system binary C:/cygwin/bin /usr/bin system binary C:/cygwin/lib /usr/lib system binary cygdrive prefix /cygdrive user binary,auto ... Regards, Cyrille Lefevre -- mailto:Cyrille.Lefevre-lists@laposte.net -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) 2011-08-06 23:53 ` pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) Cyrille Lefevre @ 2011-08-07 11:38 ` Corinna Vinschen 0 siblings, 0 replies; 25+ messages in thread From: Corinna Vinschen @ 2011-08-07 11:38 UTC (permalink / raw) To: cygwin On Aug 7 01:53, Cyrille Lefevre wrote: > some times ago, someone (you?) modifies cygpath to handle /dev/sdXY paths. > > however, it seems there is a problem somewhere ? > > v2$ uname -a > CYGWIN_NT-6.0 pcvista 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin > > v2$ /usr/sbin/blkid > /dev/sda1: LABEL="BOOT500G0 (CW_VM_2)" UUID="905A77A75A77892C" TYPE="ntfs" > /dev/sda2: LABEL="DATA500G0 (DL_2)" UUID="3CBA5BBFBA5B747C" TYPE="ntfs" > /dev/sda3: LABEL="RECOVER_2" UUID="8644-3F52" TYPE="vfat" > /dev/sda4: UUID="e57dd3da-585e-4d23-9761-f714c75f32c0" > SEC_TYPE="ext2" TYPE="ext3" > /dev/sda5: UUID="138b9a25-2681-4b4f-a428-ff8dd62e18ff" TYPE="swap" > /dev/sdb1: LABEL="ESATA2T1 (MOVIES)" UUID="1E5275B85275956D" TYPE="ntfs" > /dev/sdc1: LABEL="ESATA2T2 (OAV_SERIES_BD_DOC_PSP)" > UUID="DE6EC4C36EC49625" TYPE="ntfs" > /dev/sdd1: LABEL="SATA500G0 (BOOT_CW_VM)" UUID="905A77A75A77892C" > TYPE="ntfs" > /dev/sdd2: LABEL="SATA500G1 (DL)" UUID="4024F55724F55080" TYPE="ntfs" > /dev/sdd3: LABEL="RECOVER" UUID="8644-3F52" TYPE="vfat" > /dev/sde1: LABEL="SATA500G2 (EMULE_NORTON)" UUID="886606C66606B54A" > TYPE="ntfs" > /dev/sdi1: LABEL="USB500G1 (MM_OLD_TUHS)" UUID="4CA87E8AA87E7276" > TYPE="ntfs" > /dev/sdj1: LABEL="USB1T1 (REPS)" UUID="FEB2DCA1B2DC5FA7" TYPE="ntfs" > > v2$ cygpath -w $(/usr/sbin/blkid | cut -d: -f1 > \\.\E: > \\.\G: > \\.\H: > \\.\STORAGE#Volume#1&19f7e59c&0&Signature1A08653EOffset320053F800Length12996C000#{7f108a28-9833-4b3b-b780-2c6b5fa5c062} > \\.\STORAGE#Volume#1&19f7e59c&0&Signature1A08653EOffset3329EB3600Length11A5CA00#{7f108a28-9833-4b3b-b780-2c6b5fa5c062} > \\.\I: > \\.\J: > \\.\C: > \\.\D: > E:0 > E:1 > E:5 > E:6 > > sda1..5 ok > sdb1, sdc1, sdd1..2 ok > sdd3 ko E:0 instead of R: > sde1 ko E:1 instead of S: > sdi1 ko E:2 instead of F: > sdj1 ko E:3 instead of K: > > any ideas ? No. I don't see what's going on inside and I don't have an environment available to reproduce the problem. This appears to occur inside of cygpath's get_device_name(), a simple ~140 lines function. Care to debug it yourself? Thanks, 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* associating volume labels with drive letters 2011-07-29 20:16 ` Corinna Vinschen 2011-07-30 4:53 ` Christopher Faylor 2011-08-06 23:53 ` pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) Cyrille Lefevre @ 2012-09-13 16:27 ` Nellis, Kenneth 2012-09-26 6:22 ` Mark O'Keefe 2 siblings, 1 reply; 25+ messages in thread From: Nellis, Kenneth @ 2012-09-13 16:27 UTC (permalink / raw) To: cygwin From: Corinna Vinschen On Jul 29 15:34, Schwarz, Konrad wrote: > > > > Can you answer the following question: > > > > > > > > Given a volume label, how does one figure out where the > > > corresponding > > > > volume has been mounted into the Cygwin namespace? > > > <snip> > > In Linux, you can look up the mount point for device /dev/sdXY > > in /proc/mounts or in the output of mount(8). Thus, given > > a volume label, you can figure out where to access the files > > on the volume. > > > > How do you do that in Cygwin? > > ls /cygdrive. Insert the disk. ls /cygdrive again. There's a new > directory entry now. > > Or, open the "Computer" Window on your desktop. Dredging up an old thread (http://sourceware.org/ml/cygwin/2011-07/msg00390.html)... Regarding Corinna's last suggestion, it seems to me that if Windows can associate a volume label with a drive letter, there must be a way to script this association, whether using Cygwin shell commands directly or indirectly through DOS commands. Using blkid(8), from the util-linux package, I can get a device name from a label: $ blkid -L CRUZER /dev/sdc1 Now, if I'm on the right path, how can I associate that block-special file with a drive letter or a /cygdrive/x path reference? --Ken Nellis ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: associating volume labels with drive letters 2012-09-13 16:27 ` associating volume labels with drive letters Nellis, Kenneth @ 2012-09-26 6:22 ` Mark O'Keefe 2012-09-26 13:43 ` Nellis, Kenneth 0 siblings, 1 reply; 25+ messages in thread From: Mark O'Keefe @ 2012-09-26 6:22 UTC (permalink / raw) To: Nellis, Kenneth, cygwin On 14/09/2012, at 12:35 AM, Nellis, Kenneth wrote: > From: Corinna Vinschen > On Jul 29 15:34, Schwarz, Konrad wrote: >>>>> Can you answer the following question: >>>>> >>>>> Given a volume label, how does one figure out where the >>>> corresponding >>>>> volume has been mounted into the Cygwin namespace? >>>> > <snip> >>> In Linux, you can look up the mount point for device /dev/sdXY >>> in /proc/mounts or in the output of mount(8). Thus, given >>> a volume label, you can figure out where to access the files >>> on the volume. >>> >>> How do you do that in Cygwin? >> >> ls /cygdrive. Insert the disk. ls /cygdrive again. There's a new >> directory entry now. >> >> Or, open the "Computer" Window on your desktop. > > Dredging up an old thread > (http://sourceware.org/ml/cygwin/2011-07/msg00390.html)... > > Regarding Corinna's last suggestion, it seems to me that if > Windows can associate a volume label with a drive letter, > there must be a way to script this association, whether > using Cygwin shell commands directly or indirectly through > DOS commands. > > Using blkid(8), from the util-linux package, I can get a device > name from a label: > > $ blkid -L CRUZER > /dev/sdc1 > > Now, if I'm on the right path, how can I associate that > block-special file with a drive letter or a /cygdrive/x > path reference? > > --Ken Nellis Hi, Here is a perl script which I believe should do the trick. It adds: (for example) DRIVE="C:" to the end of the blkid output where the drive letter matches the correct drive location. Along the same lines I've also played around with a customised version of cygwin that allows the mount command to use UUID's to identify the drive letter instead of hard coding into fstab. This would be useful if you wanted specific drives to be mounted to specific locations without dependence on the drive letter. I haven't extensively tested this, just quickly put it together to give you the idea. ------------ cut ------------- #!/usr/bin/perl use strict; use Cwd 'abs_path'; # no buffer $| = 1; my %drives; for (my $i = 0; $i < 26; $i++) { my $chr = chr(ord('A') + $i); my $str = sprintf ("/proc/sys/GLOBAL\?\?/$chr:"); if (-l $str) { my $path = abs_path ($str); $drives{"$path"} = "$chr"; } } open (BLKID, "blkid |") or die "Failed: $!"; while (<BLKID>) { chomp; my $line = $_; my $drive; # Print the blkid line. printf ("%s", $line); # Deal with harddisk case. if (s|(^/dev/sd)([a-z]*)([0-9]*):.*$|$1$2$3|) { # Convert to cygwin device. my $disk = ord(substr($2, 0, 1)) - ord('a'); if (length($2) == 2) { $disk = ($disk + 1) * 26 + (ord(substr($2, 1, 1)) - ord('a')); } my $partition = ord(substr($3, 0, 1)) - ord('0'); if (length($3) == 2) { $partition = ($partition * 10) + (ord(substr($3, 1, 1)) - ord('0')); } my $path = abs_path("/proc/sys/Device/harddisk${disk}/partition${partition}"); $drive = $drives{$path}; printf (" DRIVE=\"%s:\"\n", $drive); } } ------------ cut ------------- Cheers, Mark. -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: associating volume labels with drive letters 2012-09-26 6:22 ` Mark O'Keefe @ 2012-09-26 13:43 ` Nellis, Kenneth 2012-10-19 18:45 ` Nellis, Kenneth 0 siblings, 1 reply; 25+ messages in thread From: Nellis, Kenneth @ 2012-09-26 13:43 UTC (permalink / raw) To: cygwin From: Mark O'Keefe > Hi, > > Here is a perl script which I believe should do the trick. > > It adds: (for example) > DRIVE="C:" > to the end of the blkid output where the drive letter matches the correct drive location. > > Along the same lines I've also played around with a customised version of cygwin that allows the mount > command to use UUID's to identify the drive letter instead of hard coding into fstab. This would be useful > if you wanted specific drives to be mounted to specific locations without dependence on the drive letter. > > I haven't extensively tested this, just quickly put it together to give you the idea. <snip> Thanx, Mark. Works great! --Ken Nellis -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: associating volume labels with drive letters 2012-09-26 13:43 ` Nellis, Kenneth @ 2012-10-19 18:45 ` Nellis, Kenneth 2012-10-19 18:52 ` Corinna Vinschen 0 siblings, 1 reply; 25+ messages in thread From: Nellis, Kenneth @ 2012-10-19 18:45 UTC (permalink / raw) To: cygwin -----Original Message----- From: Nellis, Kenneth From: Mark O'Keefe > Hi, > > Here is a perl script which I believe should do the trick. > > It adds: (for example) > DRIVE="C:" > to the end of the blkid output where the drive letter matches the correct drive location. > > Along the same lines I've also played around with a customised version of cygwin that allows the mount > command to use UUID's to identify the drive letter instead of hard coding into fstab. This would be useful > if you wanted specific drives to be mounted to specific locations without dependence on the drive letter. > > I haven't extensively tested this, just quickly put it together to give you the idea. <snip> Thanx, Mark. Works great! --Ken Nellis -----END Original Message----- The following bash command line provides another way to learn the drive letter associated with a given label, in this case the drive labeled "CRUZER": $ echo -e "list volume\nexit" | diskpart | awk '/CRUZER/ {print $3}' G $ --Ken Nellis -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: associating volume labels with drive letters 2012-10-19 18:45 ` Nellis, Kenneth @ 2012-10-19 18:52 ` Corinna Vinschen 0 siblings, 0 replies; 25+ messages in thread From: Corinna Vinschen @ 2012-10-19 18:52 UTC (permalink / raw) To: cygwin On Oct 19 18:45, Nellis, Kenneth wrote: > -----Original Message----- > From: Nellis, Kenneth > From: Mark O'Keefe > > Hi, > > > > Here is a perl script which I believe should do the trick. > > > > It adds: (for example) > > DRIVE="C:" > > to the end of the blkid output where the drive letter matches the correct drive location. > > > > Along the same lines I've also played around with a customised version of cygwin that allows the mount > > command to use UUID's to identify the drive letter instead of hard coding into fstab. This would be useful > > if you wanted specific drives to be mounted to specific locations without dependence on the drive letter. > > > > I haven't extensively tested this, just quickly put it together to give you the idea. > <snip> > > Thanx, Mark. Works great! > --Ken Nellis > -----END Original Message----- > > The following bash command line provides another way to learn the > drive letter associated with a given label, in this case the drive > labeled "CRUZER": > > $ echo -e "list volume\nexit" | diskpart | awk '/CRUZER/ {print $3}' Better make that /bin/echo. The tcsh echo works slightly different than bash's version... 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: Device names in /proc/mounts 2011-07-29 13:34 ` Schwarz, Konrad 2011-07-29 20:16 ` Corinna Vinschen @ 2011-07-29 21:28 ` Buchbinder, Barry (NIH/NIAID) [E] 1 sibling, 0 replies; 25+ messages in thread From: Buchbinder, Barry (NIH/NIAID) [E] @ 2011-07-29 21:28 UTC (permalink / raw) To: cygwin, 'Schwarz, Konrad' Schwarz, Konrad sent the following at Friday, July 29, 2011 9:34 AM >> > Given a volume label, how does one figure out where the >> corresponding >> > volume has been mounted into the Cygwin namespace? >> >> We're not mounting volumes, we're mounting Win32 paths. >> There is no direct correspondence between volumes and Cygwin >> mount points. > >When a person inserts removable media (USB memory stick, optical disk, >...), Windows assigns a more-or-less random drive letter. Cygwin >automatically makes this drive letter available under /cygdrive/ (or >whatever the user has renamed /cygdrive to). > >Given a (unique) volume label or disk UUID, blk_id(8) on both Linux and >Cygwin tells you the disk and partition in /dev/sdXY format. > >In Linux, you can look up the mount point for device /dev/sdXY in >/proc/mounts or in the output of mount(8). Thus, given a volume label, >you can figure out where to access the files on the volume. > >How do you do that in Cygwin? One could use a windows tool to get the volume. Here is a possible start. /c> echo ' n' | cmd /c label h: Volume in drive H: is CIFS.HOMEDIR Volume label (ENTER for none)? Delete current volume label (Y/N)? n /c> Good luck. - Barry Disclaimer: Statements made herein are not made on behalf of NIAID. -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Device names in /proc/mounts 2011-07-25 12:30 Device names in /proc/mounts Schwarz, Konrad 2011-07-25 14:01 ` Corinna Vinschen @ 2011-07-25 15:07 ` Christopher Faylor 1 sibling, 0 replies; 25+ messages in thread From: Christopher Faylor @ 2011-07-25 15:07 UTC (permalink / raw) To: cygwin On Mon, Jul 25, 2011 at 02:29:46PM +0200, Schwarz, Konrad wrote: >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. This is a literal dump of the Cygwin mount table. It is terribly useful if you want to know what Cygwin's mount mappings look like. cgf -- 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2012-10-19 18:52 UTC | newest] Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-07-25 12:30 Device names in /proc/mounts Schwarz, Konrad 2011-07-25 14:01 ` Corinna Vinschen 2011-07-27 8:15 ` Schwarz, Konrad 2011-07-27 8:35 ` Schwarz, Konrad 2011-07-27 9:41 ` Corinna Vinschen 2011-07-27 11:19 ` Christopher Faylor 2011-07-28 8:18 ` Schwarz, Konrad 2011-07-28 11:22 ` Christopher Faylor 2011-07-29 7:46 ` Schwarz, Konrad 2011-07-29 9:21 ` Corinna Vinschen 2011-07-29 13:34 ` Schwarz, Konrad 2011-07-29 20:16 ` Corinna Vinschen 2011-07-30 4:53 ` Christopher Faylor 2011-07-30 8:18 ` Corinna Vinschen 2011-08-01 13:10 ` Nellis, Kenneth 2011-08-01 13:22 ` Christopher Faylor 2011-08-06 23:53 ` pb w/ cygpath -w /dev/sdXY (was Re: Device names in /proc/mounts) Cyrille Lefevre 2011-08-07 11:38 ` Corinna Vinschen 2012-09-13 16:27 ` associating volume labels with drive letters Nellis, Kenneth 2012-09-26 6:22 ` Mark O'Keefe 2012-09-26 13:43 ` Nellis, Kenneth 2012-10-19 18:45 ` Nellis, Kenneth 2012-10-19 18:52 ` Corinna Vinschen 2011-07-29 21:28 ` Device names in /proc/mounts Buchbinder, Barry (NIH/NIAID) [E] 2011-07-25 15:07 ` Christopher Faylor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).