X-Recipient: archive-cygwin AT delorie DOT 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" To: "cygwin AT cygwin DOT 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 DOT GA13084 AT calimero DOT vinschen DOT 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 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 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? > > > > > 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