Auto mount using ntfs-3g in GNOME

Could anybody suggest right way to configure an auto mounting of NTFS file system in GNOME?

I have FreeBSD 7.2-STABLE on my computer and I would like to use my usb hard drive with NTFS file system without inputting mount/umount commands.


I had installed port sysutils/fusefs-ntfs and set someGConf keys
(/system/storage/default_options/ntfs/fstype_override to ntfs-3g and
/system/storage/default_options/ntfs-3g/mount_optins to fmask=111).

Although when I plugged in my usb drive I received an error
"Invalid mount option when attempting to mount the volume 'MOBILE'".
HAL's verbose output showed the following.
Code:
mount_point    = 'MOBILE' 
mount_fstype   = 'ntfs-3g' 
mount_options  = 'fmask=111' 
trying dir /media/MOBILE 
given_options[0] = 'fmask=111' 
allowed_options[0] = 'ro' 
allowed_options[1] = 'noexec' 
allowed_options[2] = 'noatime' 
allowed_options[3] = '-u=' 
allowed_options[4] = '-g=' 
allowed_options[5] = '-m=' 
allowed_options[6] = '-a' 
allowed_options[7] = '-i' 
allowed_options[8] = '-C=' 
allowed_options[9] = '-W=' 
pid 27245: rc=1 signaled=0: /usr/local/libexec/hal-storage-mount 
17:26:44.592 [I] hald_dbus.c:4042: No more methods in queue
17:26:44.592 [I] hald_dbus.c:4105: failed with 'org.freedesktop.Hal.Device.Volume.InvalidMountOption' 'The option 'fmask=111' is not allowed for uid=900'
Despite fstype_override has been set allowed_options for mount_ntfs is used.


I have created file /usr/local/etc/hal/fdi/policy/10-ntfs.fdi which
contains policy.
Code:
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="volume.fstype" string="ntfs">
      <append key="volume.mount.valid_options" type="strlist">uid=</append>
      <append key="volume.mount.valid_options" type="strlist">gid=</append>
      <append key="volume.mount.valid_options" type="strlist">umask=</append>
      <append key="volume.mount.valid_options" type="strlist">fmask=</append>
      <append key="volume.mount.valid_options" type="strlist">dmask=</append>
      <append key="volume.mount.valid_options" type="strlist">locale=</append>
    </match>
  </device>
</deviceinfo>
After this I received an error "Cannot mount volume.
Unable to mount the volume 'MOBILE'.
mount: /dev/ntfs/MOBILE : Operation not supported by device"


Then I got to know that in FreeBSD 7 branch file systems types hardcoded in mount.c
After applying a patch I achive an automounting.
Code:
--- /usr/src/sbin/mount/mount.c.orig2009-08-07 18:02:31.000000000 +0300
+++ /usr/src/sbin/mount/mount.c2009-08-07 18:42:49.000000000 +0300
@@ -140,7 +140,7 @@
  */
 unsigned int i;
 const char *fs[] = {
-"cd9660", "mfs", "msdosfs", "nfs", "nfs4", "ntfs",
+"cd9660", "mfs", "msdosfs", "nfs", "nfs4", "ntfs", "ntfs-3g",
 "nwfs", "nullfs", "portalfs", "smbfs", "udf", "unionfs",
 NULL
 };


I don't like this hacks. And I still can't unmount drive in nautilus.


Does more correct way exist to get an automounting?


Thanks in advance for any help.
 
Well maybe you should use simple mount command and set simple ntfs file system, but use mount option mountprog for internal ntfs-3g mount program .
 
Could you clarify what you mean?
Are you advising to use mount command in a shell? If so this approach doesn't suit for my goal.

I would like to configure an automounting or manual mount/unmount using Nautilus.
 
I suppose you found
/usr/local/share/doc/ntfs-3g/README
/usr/local/share/doc/ntfs-3g/README.FreeBSD
?

I just went with the patched /sbin/mount. So my ntfs drive mounts on boot and umounts on shutdown - hald doesn't handle it at all, so neither does nautilus. If I wanted to umount it, I would have to do it from a terminal.

I remember trying to get ntfs-3g to work with nautilus and hald, but gave up. It would work, but in a very strange way. When nautilus and hald were told to mount a drive (/dev/ntfs/My Drive), they would mount the fuse drive instead (/dev/fuse0, for example), and a new drive would appear in the nautilus Computer area. Then things wouldn't unmount properly - it was kind of messy.

There is also this: /usr/ports/sysutils/ntfsprogs. I can't remember if I looked at this.
 
Back
Top