Linux, FAT32 and mounting options

Oh boy, this was great

the other day I was having some problems with eclipse, basically for some reason my folders and filenames were automatically getting renamed to lower case, I couldnt figure out why, at first I was blaming eclipse, you can read about these problems I had here:

Eclipse and Plug-in Dependency Fun

In the end I thought it was eclipse, so posted a “WHY IS THIS HAPPENING TO ME” message to the eclipse newsgroups. At the end, I was informed that maybe my linux mount options are to blame and I should look up shortname property.

OMFG “?”?%”?”%!”%&&//%(&/(%&/$%!!!!!!!!!!!!!! FUCKING LINUX!!!!

To put it robustly.

You see, for some insanely stupid reason someone decided that automounting FAT32 partitions should use the property “shortname=lower” and if you check your Windows readable USB memory key in linux, you might find the same property.

What this means, is that ALL filenames, will be shown as lower case, regardless of the original filename, which MAY BE UPPER CASE. It will still come through as lower case. Why?? Who’s insane idea was this? So let me get this straight, I create a file called MANIFEST.MF, on a case retaining filesystem (which means, it’ll keep the case of the filename intact) and we’ll redisplay that file as manifest.mf ??? Since when are they the same file?

NOTE:

In terms of filesystems, here are some of the definitions which are important.

Case retaining means that if you create a file called MANIFEST.MF, it will retain (keep) the case you originally gave it. However, if you open the file “manifest.mf” you will STILL OPEN the same file. Hence it retains the case of the filename string, however when opening a file (to read, write, append, truncate, etc). It’s not important and will open anything which matches the string CONTENTS and not the string EXACTLY.

Examples:

MANIFEST.MF is equal to manifest.mf MaNiFeSt.Mf MANIfest.mf, etc.

Case Sensitive, however, means the above, that it will retain case and that attempting to open the file for whatever reason, MUST GIVE the same identical string, with same upper case and lower case letters.

Examples:

MANIFEST.MF is equal to: MANIFEST.MF

MANIFEST.MF is not equal to: Manifest.mf MANIfest.mf MaNiFeSt.Mf, etc.

So, FAT32, is case retaining, but not case sensitive. However eclipse is case sensitive, VERY VERY case sensitive. So, when the linux filesystem driver gives eclipse the filenames meta-inf and manifest.mf, eclipse looks whether they are the files which it *requires* to operate properly as a plugin, META-INF and MANIFEST.MF.

The comparison fails, so eclipse thinks they are different files and therefore your plugin project is invalid. If you rename these files to upper case, you’ll get a valid plugin again, until eclipse refreshes the file list, which obtains the new lower case filenames again and ***BAM***, your plugin again, is invalid.

The solution to this is thus, you must mount the FAT32 partition using shortname=mixed, you can either put this into your /etc/fstab, where it’ll use it automatically, or you can do what I did and install the parameter into the gconf options, so when it automounts, it’ll use the property. You can do that by following these instructions

  1. open the gconf editor (if you don’t have it installed, install it, then open it)
  2. you’ll find it in the system tools section of your Gnome desktop menu
  3. Navigate through the heirarchy of folders to:/system/storage/default_options/vfat
  4. On the right, you’ll see mount options, open it
  5. change the value of shortname=lower to shortname=mixed
  6. click accept
  7. close gconf
  8. Unmount and remount your FAT32 drives
  9. FINISHED.

Easy when you know how, huh?

3 thoughts on “Linux, FAT32 and mounting options”

  1. Thanks for this hint. I’m using a TrueCrypt / Fat32 volume to sync my workspace into a Dropbox account, and Eclipse got very confused when ‘CVS’ became ‘cvs’. Adding this option to my TrueCrypt mount configs fixed it.

Leave a Reply

Your email address will not be published. Required fields are marked *