[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#500540: kdebase: automounting vfat (partialy) case sensitive due to utf8 is plain wrong and dangerous



Package: kdebase
Version: 4:3.5.9.dfsg.1-5
Severity: grave
Justification: causes non-serious data loss


I just switched from etch to lenny and now gnupod warns me about the case
sensitive filesystem on my iPod:

> $ gnupod_check.pl
> gnupod_check.pl Version 0.99.8 (C) Adrian Ulrich
> /usr/local/bin/gnupod_check.pl: Warning: /media/IPOD is mounted case sensitive, that's bad:
>                                 FAT32-iPods should be mounted case
>                                 in-sensitive!
>                                 (try 'mount ... -o check=relaxed')
> Pass 1: Checking Files in the GNUtunesDB.xml...
> Pass 2: Checking Files on the iPod...
> ..finished
...

The filesystem gets automounted by KDE's mediamanager and
never caused a problem when I used Etch.

The kernel also complains:

[490945.600269] usb 4-3: new high speed USB device using ehci_hcd and address 23
[490945.733907] usb 4-3: configuration #1 chosen from 2 choices
[490945.761374] scsi18 : SCSI emulation for USB Mass Storage devices
[490945.762123] usb 4-3: New USB device found, idVendor=05ac, idProduct=1262
[490945.762138] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[490945.762147] usb 4-3: Product: iPod
[490945.762153] usb 4-3: Manufacturer: Apple Inc.
[490945.762159] usb 4-3: SerialNumber: 000A27001B256A33
[490945.762731] usb-storage: device found at 23
[490945.762742] usb-storage: waiting for device to settle before scanning
[490950.760450] usb-storage: device scan complete
[490950.776262] scsi 18:0:0:0: Direct-Access     Apple    iPod 1.62 PQ: 0 ANSI: 0
[490950.824634] sd 18:0:0:0: [sda] 1941441 4096-byte hardware sectors (7952 MB)
[490950.825383] sd 18:0:0:0: [sda] Write Protect is off
[490950.825397] sd 18:0:0:0: [sda] Mode Sense: 68 00 00 08
[490950.825404] sd 18:0:0:0: [sda] Assuming drive cache: write through
[490950.827876] sd 18:0:0:0: [sda] 1941441 4096-byte hardware sectors (7952 MB)
[490950.828416] sd 18:0:0:0: [sda] Write Protect is off
[490950.828429] sd 18:0:0:0: [sda] Mode Sense: 68 00 00 08
[490950.828436] sd 18:0:0:0: [sda] Assuming drive cache: write through
[490950.828443]  sda: sda1
[490950.830215] sd 18:0:0:0: [sda] Attached SCSI removable disk
[490951.932053] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!

And it is damn right to complain! So don't give me any of the "should be
ignored" comments that you might have googled here:
http://www.linuxfromscratch.org/lfs/view/development/chapter08/fstab.html

Now lets see the effects of case sensitive vfat, shall we?:

# mount | grep vfat
/dev/sda1 on /media/IPOD type vfat (rw,nosuid,nodev,noatime,uhelper=hal,flush,uid=1000,utf8,shortname=lower)
# cd /media/IPOD
/media/IPOD# touch TEST TESt TEsT
touch: cannot touch `TESt': File exists
touch: cannot touch `TEsT': File exists
/media/IPOD# touch TESTDIRECTORY TEStDIRECTORY TEsTDIRECTORY
/media/IPOD# ls -lsa TE*
0 -rwxr-xr-x 1 hlangos root 0 2008-09-28 15:33 TEsTDIRECTORY
0 -rwxr-xr-x 1 hlangos root 0 2008-09-28 15:33 TEStDIRECTORY
0 -rwxr-xr-x 1 hlangos root 0 2008-09-28 15:33 TESTDIRECTORY
/media/IPOD# ls -lsa te*
ls: cannot access test: No such file or directory
/media/IPOD# ls -lsa
ls: cannot access test: No such file or directory
total 32
4 drwxr-xr-x  8 hlangos root 4096 2008-09-28 15:33 .
4 drwxr-xr-x  4 root    root 4096 2008-09-28 15:31 ..
4 drwxr-xr-x  2 hlangos root 4096 2000-02-09 07:06 Calendars
4 drwxr-xr-x  2 hlangos root 4096 2008-04-09 15:23 Contacts
4 drwxr-xr-x 11 hlangos root 4096 2008-02-13 00:01 iPod_Control
0 -rwxr-xr-x  1 hlangos root    0 2000-02-09 07:06 .metadata_never_index
4 drwxr-xr-x  2 hlangos root 4096 2008-04-09 15:25 Notes
4 drwxr-xr-x  3 hlangos root 4096 2008-01-15 23:08 Photos
4 drwxr-xr-x  2 hlangos root 4096 2000-02-09 07:06 Recordings
? -?????????  ? ?       ?       ?                ? test
0 -rwxr-xr-x  1 hlangos root    0 2008-09-28 15:33 TEsTDIRECTORY
0 -rwxr-xr-x  1 hlangos root    0 2008-09-28 15:33 TEStDIRECTORY
0 -rwxr-xr-x  1 hlangos root    0 2008-09-28 15:33 TESTDIRECTORY
/media/IPOD#

That is FUBAR !

1. "touch TEST TESt TEsT" should not complain about existing files.
2. "touch TESTDIRECTORY TEStDIRECTORY TEsTDIRECTORY" should not create more
   than one file.
3. And WTF happend to "test" anaway?
      
BTW: If you try to delete some of those testdirectory files you may run
into more of those nasty questionmarks.
   
I didn't dare to continue working on a filesystem in such a state but to
me this looks like a corrupted file system. Hence severity "grave".


 
Now lets try again with more sane vfat options:

# mount | grep vfat
/dev/sda1 on /mnt type vfat (rw,nosuid,nodev,noatime,uhelper=hal,flush,uid=1000,shortname=lower,check=relaxed,codepage=850,iocharset=iso8859-1)
# cd /mnt
/mnt# touch TEST TESt TEsT
/mnt# touch TESTDIRECTORY TEStDIRECTORY TEsTDIRECTORY
/mnt# ls -lsa TE*
0 -rwxr-xr-x 1 hlangos root 0 2008-09-28 15:41 TESTDIRECTORY
/mnt# ls -lsa
total 32
4 drwxr-xr-x  8 hlangos root 4096 2008-09-28 15:41 .
4 drwxr-xr-x 23 root    root 4096 2008-09-26 22:07 ..
4 drwxr-xr-x  2 hlangos root 4096 2000-02-09 07:06 Calendars
4 drwxr-xr-x  2 hlangos root 4096 2008-04-09 15:23 Contacts
4 drwxr-xr-x 11 hlangos root 4096 2008-02-13 00:01 iPod_Control
0 -rwxr-xr-x  1 hlangos root    0 2000-02-09 07:06 .metadata_never_index
4 drwxr-xr-x  2 hlangos root 4096 2008-04-09 15:25 Notes
4 drwxr-xr-x  3 hlangos root 4096 2008-01-15 23:08 Photos
4 drwxr-xr-x  2 hlangos root 4096 2000-02-09 07:06 Recordings
0 -rwxr-xr-x  1 hlangos root    0 2008-09-28 15:41 test
0 -rwxr-xr-x  1 hlangos root    0 2008-09-28 15:41 TESTDIRECTORY
/mnt#

As you see it is not perfect as the "TEST" file gets only created as "test".
My guess is that "shortname=mixed" instead of "shortname=lower" should be
used but don't take my word for it.

As far as I have seen in archives and related bug reports the blame
for this problem gets shifted around from KDE to pmount to the kernel
itself and all the way back. Everybody happily points fingers at the others.

I don't want to join in. I just want control over the way KDE's mediamanager
mounts removable media. So here's the question:

Is there a way to override the DEFAULT options that KDE's media manager
uses to automount vfat on removable media or are they hardcoded ? (I know 
I can change some mount options for individual devices but those are not 
enough to save vfat from being messed up that way.)

I'd rather take the risk of having short names displayed wrongly (which
as far as I know is the only "risk" when not using the utf8 option)
than having vfat partitions FUBARed.

And who came up with the idea to mount vfat with utf8 anyway? It was never
designed to take short utf8 names. Those are strictly 8.3 and if you try to
stick utf8 characters in there, you get all kinds of length checking problems.
Long names on vfat are stored in unicode anyway. So whats the big gain here?
For the sake of squeezing utf8 into places where it never was ment to be,
we get messed up filesystems?


BTW: Ubuntu seems to have the same problem:
https://launchpad.net/ubuntu/+bug/62321

I'd like to write a sarcastic reply to Simon Law's comment
> We must set the iocharset to utf8, or things will break horribly.
but in this case reality is satire enough.


cheers
-henrik
(Using Debian since buzz.)

PS: I probably should have added some <rant> tags but I am frustrated 
because I lost the few hours that I had for programming on this 
weekend to this utf8 on vfat mess.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kdebase depends on:
ii  hal        0.5.11-3                      Hardware Abstraction Layer
ii  kappfinder 4:3.5.9.dfsg.1-5              non-KDE application finder for KDE
ii  kate       4:3.5.9.dfsg.1-5              advanced text editor for KDE
ii  kcontrol   4:3.5.9.dfsg.1-5              control center for KDE
ii  kdebase-bi 4:3.5.9.dfsg.1-5              core binaries for the KDE base mod
ii  kdebase-da 4:3.5.9.dfsg.1-5              shared data files for the KDE base
ii  kdebase-ki 4:3.5.9.dfsg.1-5              core I/O slaves for KDE
ii  kdepasswd  4:3.5.9.dfsg.1-5              password changer for KDE
ii  kdeprint   4:3.5.9.dfsg.1-5              print system for KDE
ii  kdesktop   4:3.5.9.dfsg.1-5              miscellaneous binaries and files f
ii  kfind      4:3.5.9.dfsg.1-5              file-find utility for KDE
ii  khelpcente 4:4.0.0.really.3.5.9.dfsg.1-5 help center for KDE
ii  kicker     4:3.5.9.dfsg.1-5              desktop panel for KDE
ii  klipper    4:3.5.9.dfsg.1-5              clipboard utility for KDE
ii  kmenuedit  4:3.5.9.dfsg.1-5              menu editor for KDE
ii  konqueror  4:3.5.9.dfsg.1-5              KDE's advanced file manager, web b
ii  konqueror- 4:3.5.9.dfsg.1-5              Netscape plugin support for Konque
ii  konsole    4:3.5.9.dfsg.1-5              X terminal emulator for KDE
ii  kpager     4:3.5.9.dfsg.1-5              desktop pager for KDE
ii  kpersonali 4:3.5.9.dfsg.1-5              installation personalizer for KDE
ii  ksmserver  4:3.5.9.dfsg.1-5              session manager for KDE
ii  ksplash    4:3.5.9.dfsg.1-5              the KDE splash screen
ii  ksysguard  4:3.5.9.dfsg.1-5              system guard for KDE
ii  ktip       4:3.5.9.dfsg.1-5              useful tips for KDE
ii  kwin       4:3.5.9.dfsg.1-5              the KDE window manager
ii  libkonq4   4:3.5.9.dfsg.1-5              core libraries for Konqueror
ii  pmount     0.9.17-2                      mount removable devices as normal 

Versions of packages kdebase recommends:
ii  kdm                     4:3.5.9.dfsg.1-5 X display manager for KDE

Versions of packages kdebase suggests:
pn  kdebase-doc-html              <none>     (no description available)

-- no debconf information



Reply to: