Non-case sensitive filesystem on Linux – HOWTO


I was setting up a ColdFusion web application on my dev machine and ran into lots of errors because of the case sensitivity of Linux (which i was using) versus the non-case sensitivity of windows (where the application was developed).

I had a quick look to see if I could fix it up but quickly figured out that there were too many occurrences and so it was likely not worth fixing up at this point. To that end I set up a loopback vfat filesystem so that I could have a directory on my machine mounted as non-case sensitive.

Note: this is not recommended for production systems – but is a handy fix for a temporary development problem.

Create a virtual disk


dd if=/dev/zero of=virtual.dsk bs=1048576 count=150

Format it


mkfs.vfat virtual.dsk

Mount it


sudo mkdir /mnt/vfat
sudo mount virtual.dsk /mnt/vfat -t vfat -o loop,owner,group,umask=000

You can set this up to mount every time by putting the following line in your /etc/fstab


/path/to/virtual.dsk /mnt/vfat vfat loop,owner,group,umask=000 0 0

Note – the same trick works on OSX in reverse. I.e. if you are developing on a mac, but deploying to a linux production environment you can create a virtual disk with a case-sensitive filename, which will mean that any case sensitive issues get picked up on your dev machine, and not on your production/staging machines.

Cheers,
Mark


This post was posted in , , , , by on