X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=0.2 required=5.0	tests=AWL,BAYES_00,HOSTEUROPE_IXHASH,KHOP_THREADED
X-Spam-Check-By: sourceware.org
From: "Nellis, Kenneth" <Kenneth.Nellis@xerox.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: associating volume labels with drive letters
Date: Thu, 13 Sep 2012 14:35:35 +0000
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A7001F66B@USA7109MB022.na.xerox.net>
References: <20110729201556.GA13084@calimero.vinschen.de>
In-Reply-To: <20110729201556.GA13084@calimero.vinschen.de>
Content-Type: text/plain; charset="utf-8"
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 base64 to 8bit by delorie.com id q8DEZv70010770

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

