Kernel Bug Tracker – Bug 1463
VFAT: upper case file directory names showing in lower case
Last modified: 2007-03-12 12:49:15 UTC
Distribution: RedHat 9.0
Hardware Environment: i386
I have windows 2000 on hda1 and redhat on hda2. From windows I created the
following folders :
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
- Here the result of mdir :
# mcd c:\
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
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
Are you running the Red Hat supplied kernel, or a virgin kernel.org kernel?
I tried 2.4.18 from redhat and tried kernel 2.4.20 -> 2.4.22 from kernel.org
which I recompiled myself.
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 :
I have Linux localhost 2.4.20-gentoo-r5 !
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.
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
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 ?
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
It looks like this is a configuration issue and can be closed.
Snatching the bug...
... and closing it as DOCUMENTED.
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.
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 :-)