"mounting vfat case sensitive is plain wrong and dangerous"

Kernels & Hardware, configuring network, installing services

"mounting vfat case sensitive is plain wrong and dangerous"

Postby Soul Singin' » 2009-08-14 01:22

This post is based on: Debian Bug #501339.

Once upon a time, I had an army of USB flash drives. Today, I have a cemetery filled with fallen soldiers. Their cause of death remains a mystery, but I wonder if it had anything to do with the fact that they were mounted case-sensitive.

I've noticed that placing the following line in my /etc/fstab file:
Code: Select all
/dev/sda1       /media/sda1     auto    rw,user,noauto,exec  0       0

and running:
Code: Select all
mkdir /media/sda1

mounts a FAT-formatted USB flash drive case-insensitive:

Code: Select all
[ Thu 13-Aug-2009 21.11 XXXX ] ~ $ mount /dev/sda1
[ Thu 13-Aug-2009 21.11 XXXX ] ~ $ mount
...
/dev/sda1 on /media/sda1 type vfat (rw,nosuid,nodev,user=XXXX)
[ Thu 13-Aug-2009 21.11 XXXX ] ~ $
[ Thu 13-Aug-2009 21.11 XXXX ] ~ $ cd /media/sda1
[ Thu 13-Aug-2009 21.11 XXXX ] sda1 $
[ Thu 13-Aug-2009 21.11 XXXX ] sda1 $ echo hello > hello.txt
[ Thu 13-Aug-2009 21.11 XXXX ] sda1 $ echo hello > Hello.txt
bash: Hello.txt: File exists
[ Thu 13-Aug-2009 21.11 XXXX ] sda1 $
[ Thu 13-Aug-2009 21.11 XXXX ] sda1 $ ls -l
total 4
-rwxr-xr-x 1 XXXX XXXX 6 2009-08-13 21:11 hello.txt
[ Thu 13-Aug-2009 21.12 XXXX ] sda1 $


For those of you who prefer to let KDE or GNOME (or something else) automatically mount a USB flash drive upon insertion, fear not! It will still mount automatically. The difference is that the /etc/fstab line above will mount your FAT-formatted flash drives case insensitive (as it should be!).

Enjoy!
- Soul Singin'
.
User avatar
Soul Singin'
 
Posts: 1471
Joined: 2008-12-21 07:02

Re: "mounting vfat case sensitive is plain wrong and dangerous"

Postby craigevil » 2010-04-10 10:06

Thanks for posting this.

Came across a 8gb flash drive that was less than a year old that had this issue.
Debian Sid KDE Kernel 3.17 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5192
Joined: 2006-09-17 03:17
Location: Oz


Return to System configuration

Who is online

Users browsing this forum: tuxxie and 6 guests

fashionable