Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.