delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/09/13/02:30:11

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,TW_UU
X-Spam-Check-By: sourceware.org
MIME-version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.431,0.0.0000 definitions=2012-09-13_03:2012-09-13,2012-09-13,1970-01-01 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=6 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1209120393
From: "Mark O'Keefe" <mark_okeefe AT mac DOT com>
Subject: UUID support in mount and fstab
Date: Thu, 13 Sep 2012 16:29:33 +1000
Message-id: <FDFC2DA2-E326-456C-8DFF-224DBA23B7B8@mac.com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

I'd like to suggest a possible enhancement to mount and fstab entries to support mounting a
path dependent on the usb drive that is attached.

I read a thread somewhat related (http://cygwin.com/ml/cygwin/2011-07/msg00367.html)
which was rejected, however I think that this is a different idea.

I'm particularly interested in fstab entries for automatic mounts rather than user specified
mounting via the commandline.  In particular I would like to remove the knowledge of the
drive letter that is forced into the fstab currently.  As you know, the drive letters can change
and make your fstab entries incorrect.  Or (in the case I'm looking at) mount the wrong drive
with potentially destructive implications.

fstab entry (current):
----------------
F:/mymount		/mnt/mymntpoint	vfat		binary,user


If I have lots of USB drives that I plug in at various times, this letter can change.  What doesn't
change is the ID for the drive.

fstab entry (proposed):
----------------
/mymount	UUID= cfa8-97e8-0008-fef7-0100-0000		/mnt/mymntpoint	vfat		binary,user


The idea is to use the UUID to determine the drive letter rather than hardcode it into the fstab.

I couldn't find a way to map the UUID returned by blkid to a drive letter.  What I did find was that
Windows has its own idea (not sure if it maps to UUID or not) of unique drive.  The information
is contained in the directory (registry):
"/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/MountedDevices/"
Each mounted drive exists in this directory in for form of:  <prefix><drive letter><suffix>
where:
<prefix> = "%5CDosDevices%5C"
<suffix> = "%3A"

So, the C: drive would be:  "%5CDosDevices%5CC%3A"

More information on this can be found here:
http://diddy.boot-land.net/firadisk/files/mounteddevices.htm

Also, from:  http://sources.redhat.com/cygwin/cygwin-ug-net/using-specialnames.html

bash$ od -t x1 MountedDevices/%5CDosDevices%5CC%3A

0000000 cf a8 97 e8 00 08 fe f7 01 00 00 00

So, from the fstab above we could deduce that we were looking for drive C: and the mount
could be altered (at mount time) to reflect this and mount the right location.

My thoughts are that this is not trying to change the mount system that cygwin has in place,
just provide an extension to remove the dependency on specific drive letters by dynamically
retrieving these based on the drive identifier.

NOTE:  I'm not sure what (if any) relationship there is between the above registry entry and
the uuid returned by blkid.  What I am hoping is that this information could be utilised to remove
drive letter dependency in mounts...

What are the thoughts of the experts?

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019