Bug 1463 - VFAT: upper case file directory names showing in lower case
VFAT: upper case file directory names showing in lower case
Status: REJECTED DOCUMENTED
Product: File System
Classification: Unclassified
Component: FAT/VFAT/MSDOS
i386 Linux
: P2 normal
Assigned To: Olaf Kirch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-31 07:20 UTC by Ronan SALMON
Modified: 2007-03-12 12:49 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.4.2{0,1,2}
Tree: Mainline
Regression: ---


Attachments

Description Ronan SALMON 2003-10-31 07:20:54 UTC
Distribution: RedHat 9.0
Hardware Environment: i386
Software Environment:
fileutils-4.1.9-11
mtools-3.9.8-5
mount-2.11r-10

Problem Description:
I have windows 2000 on hda1 and redhat on hda2. From windows I created the
following folders :
c:\RONAN
c:\Salmon
c:\email

I boot RedHat and mount the vfat partition like that :
mount -t vfat /dev/hda1 /mnt/w2k
- Here the result of ls
# ls /mnt/w2k
ronan
Salmon
email

- Here the result of mdir :
# mcd c:\
# mdir
RONAN
Salmon
email

As you can see with ls, "RONAN" became "ronan". It is the same with files (eg
"FILE.JPG" will become "file.jpg". It seems that with the linux vfat driver, if
the filename or directory name is *only* in upper case, then the linux driver
converts/shows it in lower case.

The mtools command always display files/directories the way they were created
under windows.

We are using tar to make images of PCs to reload labs (something like Norton
Ghost). Since tar doesn't get the right file name when we create an image of a
PC, it can't restore a VFAT filesystems properly. I know that with windows it
should matter, but some software like Dreameweaver don't work anymore because
they use javascript which is case sensitive.

Thanks.
Comment 1 Martin J. Bligh 2003-10-31 07:59:08 UTC
Are you running the Red Hat supplied kernel, or a virgin kernel.org kernel?
Comment 2 Ronan SALMON 2003-10-31 08:41:36 UTC
I tried 2.4.18 from redhat and tried kernel 2.4.20 -> 2.4.22 from kernel.org
which I recompiled myself.
Comment 3 Zurd 2003-11-04 23:08:11 UTC
Strangely, here on my vfat partition I can only have all uppercase letters in a
filename only if the length of it is more than 8 characters.  If it's less it
doesn't work.  Example :

Creating a filename "A" will give "a" for the filename.
Creating a filename "AABBCCDD" will give "aabbccdd" for the filename.
Creating a filename "AABBCCDDE" will give "AABBCCDDE" for the filename.

This is giving problems to the GPRename software with the bug I submitted :
https://sourceforge.net/tracker/index.php?func=detail&aid=677203&group_id=40094&atid=427023

I have Linux localhost 2.4.20-gentoo-r5 !
Comment 4 keith mannthey 2003-12-03 17:31:01 UTC
Ok I looked into this problem.  The short answer is the the default way linux 
mounts a vfat fs sets the shortname options to display lowercase.  (If you look
around the kernel for  VFAT_SFN_DISPLAY_LOWER you can see what is going on.) 
Weather or not this is the correct default setting is not my place to say.  

The way to get around the issue is to mount the vfat with the shortname=mixed
option (mount -t vfat -o shortname=mixed ... ... ).  I don't know where this is
documneted but doing this will do what you want.  

I am guessing all kernel have this behavior if this issue was seen on
2.4.current since I looked at 2.6.0-test11.  

Keith 
Comment 5 Ronan SALMON 2003-12-09 07:02:06 UTC
I had mount version 2.11g. The option shortname=mixed does work but isn't
documented. I have mount-2.11y-9 installed on an other machine and that option
is documented.

Does anyone know if shortname=mixed could be the default option instead of
shortname=lower? It makes more sence to have 'mixed' to be the default.

It's working for me anyway, so I guess we could close this bug ?

Thanks, Ronan.
Comment 6 Zurd 2004-10-13 16:30:18 UTC
The shortname option is documented in "man mount" in the vfat section.

It do says that the default is "lower" which doesn't make sense in my opinion. 
Default one should be "winnt" which works just perfectly fine !

Is this a problem of the kernel or the mount command now?

Unless someone find an argument about why it should be lower, it would be safe
to change it to winnt.

Regardless of using the native FAT FS or VFAT from Linux, there shouldn't be any
case changes.
Comment 7 Olaf Kirch 2007-03-12 04:12:40 UTC
It looks like this is a configuration issue and can be closed.
Snatching the bug...
Comment 8 Olaf Kirch 2007-03-12 04:14:56 UTC
... and closing it as DOCUMENTED.
Comment 9 Zurd 2007-03-12 12:13:24 UTC
Yes, this bug is a configuration problem and it is documented, but could you
please leave it open.

Because, as I said, the shortname option for the mount command is, by default,
set to 'lower' and it would be better to set it to 'winnt' since this is the
option that any user would expect when handling VFAT partition.

Thanks
Comment 10 Olaf Kirch 2007-03-12 12:49:15 UTC
But that is an issue with mount(8), which you should discuss with the
util-linux maintainers. Let's keep the kernel bugzilla for kernel issues :-)

Note You need to log in before you can comment on or make changes to this bug.