This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

UUID support in mount and fstab


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]