Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(Using Snow Leopard.) When I plug in a flash drive formatted with FAT32, the permissions on all files on the drive are set as 0666; between colored ls and my obsessive-compulsive nature, this is annoying. Is there any way to make it automatically mount with a different umask?

share|improve this question

1 Answer 1

Modifying files under /System/Library can cause problems; enter at your own risk; take backups first, etc. Whatever: there's a reason this site is called Super User. Onward:

There is a file: /System/Library/Filesystems/msdos.fs/Contents/Info.plist

There is a section in that file that controls FAT32 behaviour on the system. In my machine (Tiger, but should be similar for yours) the section is at the bottom of the file and looks like this:

<key>MS-DOS FAT32</key>
<dict>
        <key>FSFormatArguments</key>
        <string>-F 32</string>
        <key>FSFormatContentMask</key>
        <string>DOS_FAT_32</string>
         ...

... blah blah blah. The important part for your purposes in that section is this part:

        <key>FSMountArguments</key>
        <string></string>
        <key>FSMountExecutable</key>
        <string>../../../../../../sbin/mount_msdos</string>

If you check the man page for mount_msdos you will see that there is a "-m" argument for setting the mask. You can set the mount arguments by changing the corresponding line:

        <key>FSMountArguments</key>
        <string>-m 644</string>

or to whatever mask you like. You can use other options (like "-o rdonly") in there as well if you wish. Note that this will of course apply to any mounts of that filesystem type. So choose wisely.

If you're truly OCD, don't spend too much time peeking at plist files though ... there's a lot in there to get distracted by. ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.