Default mount options on auto-mounted NTFS partitions (how to add `noexec` and `fmask=0111`?) [closed]

I use auto-mounting of external USB devices, and it works as expected, except that NTFS partitions are mounted with executability flag on. For example:

/dev/sdb1 on /media/Elements type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

All normal files are -rwxrwxrwx on this partition. I am not happy with the xs. I know I can have it mounted the way I want if I pass the fmask=0111 option.

Now I use Lucid, and suppose it uses some new auto-mounting mechanism (gvfs-mount?), but I don't really know how the default mounting options can be changed now. Gconf settings in /system/storage/default_options/ntfs/mount_options have no effect.

So, how do I make fmask=0111 the default automounting option for all NTFS partitions? (I'd be grateful also if someone explains how the current automounting mechanism works, how to configure it, and if the default mounting options are hard-coded, what I have to recompile to change them).

I know that I can put a line in the /etc/fstab and/or mount manually, but this is not the solution I want, because 1) I don't want to edit /etc/fstab for each and every external drive I use, 2) fstab records appear in the Places pane of Nautilus, even if the drives are not present. The questions is how to change the defaults.

Update: installing udisks 1.0.1+git20100614 or later gives more sensible defaults for NTFS, the problem which remains is how the user can specify arbitrary mount options.


if the default mounting options are hard-coded, what I have to recompile to change them

Edit the file device.c with your custom defaults:

mkdir -p build/udisks
cd build/udisks
apt-get source udisks
gedit udisks-1.0.1/src/device.c

Search for ntfs_defaults, edit, save and exit.
If the mount option isn't already on ntfs_allow list below ntfs_defaults, must also add that new option to ntfs_allow.

Build (see the other answer for a pbuilder way):

cd udisks-1.0.1
dch -l custom "Mount custom defaults fix."
dpkg-buildpackage -b -us -uc -rfakeroot

Install the newly compiled udisk:

sudo dpkg -i ../udisks_1.0.1-1ubuntu1custom1_amd64.deb