LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2005, 05:47 AM   #1
Iban
LQ Newbie
 
Registered: Jul 2004
Location: Pamplona (Spain)
Distribution: Fedora 4
Posts: 11

Rep: Reputation: 0
vfat charset mount help


Hello all, that is my question.

I recently bought a external HD which now have a FAT32 partition and a EXT3 partition. I have no problem in recognize both partitions and I can mount both without problem. My question is: are there any way to set a default charset for all vfat partitions (external HD, internal HD, usb keys...)? I can change all the internal partitions charset in fstab but all the external drives are recognized when I plug them in, so the charset I need is not set by default.

The easier solution for me would be to set a different charset by default for all vfat partitions, is there any way to do that?

Thank you very much.

Iban.
 
Old 11-08-2005, 06:18 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
when automounting devices, fstab is edited at runtime (just read mine) by fstab-sync. try reading it's manpage and so on..because the program that controls fstab, and causes the automated edit, defines at the same time which options (like charset) to use. so, I think you could alter the option there...

I have not done so myself, and I'm sorry I have no time to search for the answer myself (interests me too), because I don't have enough time. but personally I'd start by checking out whether or not fstab-sync edits your fstab, and what fstab-sync actually does, and how it can be affected.
 
Old 11-08-2005, 06:32 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
automount (autofs) uses the file /etc/auto.master for configuration. In that file there is a map file (default name is /etc/auto.misc) where you define the mount options. For example in my /etc/auto.misc I use this line:
Code:
usb -fstype=vfat,rw,iocharset=iso8859-7 :/dev/sdc1
to automount my usb stick with support for iso8859-7 filenames. So you have to edit that file with the correct iocharset=... option.

Regards
 
Old 11-08-2005, 09:05 AM   #4
Iban
LQ Newbie
 
Registered: Jul 2004
Location: Pamplona (Spain)
Distribution: Fedora 4
Posts: 11

Original Poster
Rep: Reputation: 0
One solution

Hello, and thank you two for your replies.

I have solved the problem using the HAL (Hardware Abstraction Layer) facilities suggested by b0uncer. I've selected this option as all the new hardware connected is managed by HAL. I will explain the solution.

HAL has its own policies but you can add your own ones that are checked before doing the default. To do that, you only need to put your own policy files in the "/etc/hal/fdi/policy" directory as explained in fstab-sync man. You can find example policy files in "/usr/share/doc/hal-0.5.2/conf". I've used the "storage-policy-examples.fdi" sample as template to write my own file:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">

<device>
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<match key="@block.storage_device:storage.vendor" string="FUJITSU">
<match key="@block.storage_device:storage.model" string="MHT2080AT">
<merge key="volume.policy.desired_mount_point" type="copy_property">volume.label</merge>
<!-- W95 FAT32 (LBA)-->
<match key="volume.partition.msdos_part_table_type" int="0x0c">
<merge key="volume.policy.mount_option.iocharset=utf8" type="bool">true</merge>
<merge key="volume.policy.mount_option.codepage=932" type="bool">true</merge>
</match>
</match>
</match>
</match>
</match>
</device>

With this policy file, all the volumes (partitions) of devices of vendor=FUJITSU and model=MHT2080AT are mounted in its volume label (volume.label) directory. Besides, all the partitions with FAT 32 LBA filesystem are mounted with charset utf8 and codepage 932.

The problem is that this only works for this device and you need to add a policy for each device. Maybe you can also modify the default policy file "/usr/share/hal/fdi/policy/10osvendor/10-storage-policy.fdi" but this solution is not recommended by the fstab-sync man page.

I hope this will help someone.

Iban.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot mount vfat bsdpowa Fedora 5 07-28-2005 09:22 AM
Can't mount vfat after 2.6 migration paul167 Linux - Hardware 12 04-10-2005 10:19 PM
NTFS partition: how to mount with UTF8 charset NullDevice23 Linux - General 0 02-28-2005 09:30 AM
Can't mount VFAT oneandoneis2 Linux - Hardware 5 12-18-2004 10:54 PM
mount vfat via modules tunedLow Linux - General 7 06-02-2002 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:22 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
Open Source Consulting | Domain Registration