LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 01-24-2008, 10:33 AM   #1
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Rep: Reputation: 32
SD card mounted with wrong filesystem encoding


I have a UTF-8 Ubuntu 7.04 installation with KDE 3.5.8 on a Dell Inspiron E1505/6400. When I connect the SD card from my Nokia 6288 to the computer via USB memory card reader, the filenames have all non-ASCII characters replaced with question marks. So I need to add a mount option such that the card will always be mounted as a specific iocharset and codepage. However, I do not want this mount option to affect other USB memory sticks/cards.
 
Old 01-24-2008, 11:29 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
With the device mounted, and after noting which device is used, use the udevinfo command to get the uuid of the filesystem.

ex:
udevinfo -q env -n /dev/sdb1

There will be a line of output like:
ID_FS_UUID=24B452EDB452C14A

In your /etc/fstab file add an entry for this partition, but use the uuid of the filesystem instead of the device node:
Code:
UUID=24B452EDB452C14A /mnt/nokia vfat noauto,user,rw,nosuid,nodev,noatime,flush,uid=yourusername,utf8,shortname=lower 0 0
In your case you would use different encoding options in the fstab entry and your particular UUID number. My main point is that this entry is unique for that particular SD card. The noauto option will prevent the system from trying to mount it when you boot up. The "user" or "users" option will allow you to mount it as a normal user. You might want to use the fmask and dmask options as well to change the permissions. On this computer, with the appropriate fmask and dmask values, such as "fmask=077,dmask=077" it will only be readable by you and root.
 
Old 01-24-2008, 05:40 PM   #3
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Original Poster
Rep: Reputation: 32
Thanks, I'm fooling around with it now. I'll report back if I get things working (or not).
 
Old 01-25-2008, 09:35 AM   #4
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Original Poster
Rep: Reputation: 32
Thanks. After some time googling, I suspect that I need to add the
iso-8859-8 codepage to the fstab entry. However, I don't seem to have
it:
Code:
$ locate 8859 | grep ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-9.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-6.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-14.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-13.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-7.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-3.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-15.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-2.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-5.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-4.ko
/lib/modules/2.6.20-15-generic/kernel/fs/nls/nls_iso8859-1.ko
How to install nls_iso8859-8.ko on Ubuntu?

Also, what is the meaning of the uid=yourusername option. Can I leave that out if I want all users to be able to read the card?
 
Old 01-26-2008, 05:49 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Check if the character set is supported by the kernel:
zcat /proc/config.gz | grep ISO8859_8
CONFIG_NLS_ISO8859_8=m

If so modprobe the "nls_iso8859_8" module. Even though there isn't an nls_iso8859_8.ko kernel module, "sudo /sbin/modprobe nls_iso8859_8" should work, and the kernel module "nls_cp1255" will be used instead.

If you use "fmask=111,dmask=000" all users will be able to read the disk.
 
Old 01-28-2008, 06:40 AM   #6
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Original Poster
Rep: Reputation: 32
I'm not sure what happened, but now the card automatically mounts, and even in the proper charset! I have not made any changes since yesterday, when the card wouldn't even automount. We will see how long the situation stays this way, as in the meantime I don't have to fix anything. Tell me, though, while it is properly mounting, where can I check the mounted parameters, so if I ever have to reproduce them I will know what values to use?

Thanks!
 
Old 01-30-2008, 06:46 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Just type in "mount" without arguments. You can also at the hidden files in /media/. There is a hidden mtab file the HAL writes. You can also look at the /etc/mtab file.
 
Old 02-06-2008, 02:58 AM   #8
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Original Poster
Rep: Reputation: 32
Thanks for the info, jschiwal.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Touble with wrong encoding in filenames elektronaut Linux - General 13 09-06-2009 04:20 PM
question on mounted filesystem xiaozheyu AIX 3 11-27-2006 03:33 PM
gnome-terminal wrong character encoding guillaume31 Linux - General 2 02-01-2006 10:04 AM
possible character encoding probelm - some characters show up wrong. ukultra Linux - Newbie 2 10-05-2003 09:19 AM
e2fsck on a mounted filesystem glock19 Linux - General 2 07-09-2003 08:12 PM


All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration