FAT32 filenames in Linux

I have a multi-boot machine with Solaris, Linux & Windows installed.
So my hard disk currently has all different sorts of filesystems.

root@lnx(~)# fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1912    15358108+   7  HPFS/NTFS
/dev/sda2            4086        8682    36925402+   f  W95 Ext'd (LBA)
/dev/sda3            1913        4080    17414460   bf  Solaris
/dev/sda4   *        8683        9729     8410027+  83  Linux
/dev/sda5            4086        6635    20482843+   b  W95 FAT32
/dev/sda6            6636        8420    14337981    b  W95 FAT32
/dev/sda7            8421        8682     2104483+  82  Linux swap / Solaris

When using Linux, I’ve been struggling to work with any NetBeans web application projects that were stored in my FAT32 partitions.
Upon opening a web project, NetBeans would complain that WEB-INF folder is missing.

After a quick ls -l, I noticed that the WEB-INF folder appears as web-inf i.e. in lowercase.
Well the reason behind this anomaly was the way the Windows FAT32 partitons were mounted on my system.

root@lnx(~)# vi /etc/fstab
. . .
/dev/sda5            /mnt/win_d/          vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/sda6            /mnt/win_e/          vfat       users,gid=users,umask=0002,utf8=true 0 0
. . .

So I remounted the FAT32 partitions with the option shortname=mixed and everything became fine.

root@lnx(~)# umount /mnt/win_d/
root@lnx(~)# umount /mnt/win_e/
root@lnx(~)# vi /etc/fstab
. . .
/dev/sda5            /mnt/win_d/          vfat       users,gid=users,umask=0002,utf8=true,shortname=mixed 0 0
/dev/sda6            /mnt/win_e/          vfat       users,gid=users,umask=0002,utf8=true,shortname=mixed 0 0
. . .
root@lnx(~)# mount -a

The WEB-INF folder now appears as it is (i.e. in uppercase).
The default behaviour of a FAT32 mount uses shortname=lower, so any file/folder with a shortname i.e. less than 8 chars (excluding file extension) would appear in lowercase.


1 comment so far

  1. Anonymous on

    Great tip 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: