Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

"mounting vfat case sensitive is plain wrong and dangerous"

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

"mounting vfat case sensitive is plain wrong and dangerous"

#1 Post by Soul Singin' »

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
craigevil
Posts: 5391
Joined: 2006-09-17 03:17
Location: heaven
Has thanked: 28 times
Been thanked: 39 times

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

#2 Post by craigevil »

Thanks for posting this.

Came across a 8gb flash drive that was less than a year old that had this issue.
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.69-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list

Post Reply