Bug 157378 - HAL+NTFS-3g fails to automount ntfs drives
Summary: HAL+NTFS-3g fails to automount ntfs drives
Status: RESOLVED DOWNSTREAM
Alias: None
Product: unknown
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-08 00:37 UTC by Shaumyadeep Chaudhuri
Modified: 2009-03-31 17:17 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to remove the uid and utf8 options from ntfs mounting (711 bytes, patch)
2009-02-08 14:48 UTC, Laurens Vanhove
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shaumyadeep Chaudhuri 2008-02-08 00:37:44 UTC
Version:           unknown (using 4.0.1 (KDE 4.0.1), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc-4.2.2 
OS:                Linux (i686) release 2.6.24-zen1

If i try to mount a ntfs partition using the sidepanel on dolphin, i get the error and the disk fails to mount:

An error occurred while accessing 'DSK1_VOL1', the sytem said: org.freedesktop.Hal.Device.Volume.UnknownFaliure: TODO have to rethink extra options.

I am using the ntfs-3g driver with fuse and the kernel ntfs driver disabled on a self compiled linux kernel.
Comment 1 Andrey 2008-02-08 22:02:52 UTC
I have the same problem. I'm using Gentoo and KDE 4.1 trunk. hal version is 0.5.10
Comment 2 Jisakiel 2008-02-18 22:44:08 UTC
Same problem over here. I have both fuse.ntfs (libntfs) and ntfs-3g but it can't mount it from the side panel. Also gentoo here (4.0.1). 
Comment 3 Paweł Zaskórski 2008-06-07 19:46:57 UTC
This problem still exist in KDE 4.0.5 (hal-0.5.11).
Comment 4 grzesiekw 2008-06-09 09:07:10 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 bgn66922 2008-08-01 03:27:10 UTC
Same problem here on archlinux kdemod 4.1.0.
Comment 6 Shaumyadeep Chaudhuri 2008-08-01 08:03:19 UTC
The problem still persists in kde 4.1
Now Using:
Version:           unknown (using 4.1.0 (KDE 4.1.0), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc-4.3.1
OS:                Linux (i686) release 2.6.26-zen2.0
HAL:               0.5.11
NTFS-3G:           1.2712

Though in the partitions section in kinfocenter it correctly identifies the partition as ntfs-3g
Comment 7 Rahul Jain 2008-08-02 21:33:43 UTC
Same Problem persists:
Version:  4.1.0, Gentoo
Compiler: i686-pc-linux-gnu-4.3.1
OS: Linux (i686) Tuxonice-Sources-2.6.26
HAL: 0.5.11-r1
NTFS-3G: 1.2712
Comment 8 freza 2008-08-14 09:22:25 UTC
Same problem with Hal 0.5.11-r1 in KDE 3.5.9
According to other buglist, there is some change in hal since 0.5.10
Comment 9 Fabian Lenz 2008-08-31 14:41:39 UTC
Same for me (KDE 4.1.0)

This bug is creeping around for aeons, please fix it!
Comment 10 Ravi Vagadia 2008-08-31 16:17:12 UTC
its still not working in KDE 4.1.1
Comment 11 Rahul Jain 2008-09-04 17:07:07 UTC
Are there are any plans to fix this, or should I just accept it as a feature?
Comment 12 Ravi Vagadia 2008-09-04 17:30:05 UTC
this is temporary fix for this bug, its working for me. i'm on arch linux (kde4 svn)

just add partition & mountpoint in /etc/fstab 

for ntfs its like this
/dev/sdax /media/[foldername] ntfs-3g defaults  0 0

Comment 13 Fabian Lenz 2008-09-04 17:56:46 UTC
My workaround is to apply two patches to HAL (0.5.11), but it's not a *solution*, it's just a workaround.

--- hal-0.5.9/tools/hal-storage-mount.c.orig	2007-08-27 11:22:46.000000000 -0600
+++ hal-0.5.9/tools/hal-storage-mount.c	2008-01-13 08:22:48.000000000 -0700
@@ -765,13 +765,13 @@
 
 	if (pol_is_fixed) {
 		if (pol_change_uid) {
-			action = NULL; /* "hal-storage-mount-fixed-extra-options"; TODO: rethink */
+			action = "hal-storage-mount-fixed-extra-options"; 
 		} else {
 			action = "org.freedesktop.hal.storage.mount-fixed";
 		}
 	} else {
 		if (pol_change_uid) {
-			action = NULL; /* "hal-storage-mount-removable-extra-options"; TODO: rethink "extra-options" */
+			action = "hal-storage-mount-removable-extra-options";
 		} else {
 			action = "org.freedesktop.hal.storage.mount-removable";
 		}



--- fdi/policy/10osvendor/20-storage-methods.fdi.orig	2007-10-28 19:40:22.000000000 +0000
+++ fdi/policy/10osvendor/20-storage-methods.fdi	2007-10-28 19:40:58.000000000 +0000
@@ -240,6 +240,8 @@
 	  <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">dmask=</append>
+	  <append key="volume.mount.valid_options" type="strlist">fmask=</append>
 	  <append key="volume.mount.valid_options" type="strlist">locale=</append>
 	  <append key="volume.mount.valid_options" type="strlist">utf8</append>
 	</match>
Comment 14 Li Qi 2008-11-24 05:11:17 UTC
This bug also takes place in KDE 4.1.3 of fedora 10 testing
Comment 15 Shaumyadeep Chaudhuri 2008-11-25 17:30:20 UTC
This even happens with pen drives formatted with ntfs and using the ntfs-3g driver.
Comment 16 Jaroslav Franek 2008-11-29 19:44:49 UTC
I got no such problem on Fedora 9 with KDE up to 4.1.2 until upgrading recently to KDE 4.1.3. Since that time I am getting the same annoying messages as put in the very first comment. Mounting by hand works fine, but it is nuisance when you deal with several USB drives.

hal-0.5.11-2.fc9.i386
ntfs-3g-1.5012-4.fc9.i386
e2fsprogs-1.41.3-2.fc9.i386
KDE 4.1.3 on Fedora 9
Comment 17 Rahul Jain 2009-01-09 07:31:20 UTC
This problem still exists on KDE-4.1.85! Without wanting to sound rude, I would just like to know whether there is any plan to resolve this or will it remain a "permanent feature" ?
Comment 18 Francesco Di Muccio 2009-01-26 09:24:35 UTC
I'm not sure that dolphin is the problem, I solved creating a new hal policy file in /usr/share/hal/fdi/policy/10osvendor and after an hald restart everything was fine, here is the content of 20-ntfs-config-write-policy.fdi

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
    <device>
        <match key="volume.fstype" string="ntfs">
           <match key="@block.storage_device:storage.hotpluggable" bool="true">
               <merge key="volume.fstype" type="string">ntfs-3g</merge>
               <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
               <append key="volume.mount.valid_options" type="strlist">locale=</append>
           </match>
        </match>
    </device>
</deviceinfo>

My system is Gentoo 2.6.27-gentoo-r7:
hal-0.5.11-r6
ntfs3g-1.5130
kde 4.1.4
Comment 19 Rahul Jain 2009-02-04 15:53:05 UTC
(In reply to comment #18)
> I'm not sure that dolphin is the problem, I solved creating a new hal policy
> file in /usr/share/hal/fdi/policy/10osvendor and after an hald restart
> everything was fine, here is the content of 20-ntfs-config-write-policy.fdi
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <deviceinfo version="0.2">
>     <device>
>         <match key="volume.fstype" string="ntfs">
>            <match key="@block.storage_device:storage.hotpluggable" bool="true">
>                <merge key="volume.fstype" type="string">ntfs-3g</merge>
>                <merge key="volume.policy.mount_filesystem"
> type="string">ntfs-3g</merge>
>                <append key="volume.mount.valid_options"
> type="strlist">locale=</append>
>            </match>
>         </match>
>     </device>
> </deviceinfo>
> 
> My system is Gentoo 2.6.27-gentoo-r7:
> hal-0.5.11-r6
> ntfs3g-1.5130
> kde 4.1.4
> 

Thank you, that solves the issue! 
Comment 20 Shaumyadeep Chaudhuri 2009-02-04 22:31:16 UTC
Thanks,
This definitely solves the problem.
But that policy will work only for removable drives.
With a little modification as below it will work for all ntfs drives including hard disks.

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
    <device>
        <match key="volume.fstype" string="ntfs">
	    <merge key="volume.fstype" type="string">ntfs-3g</merge>
    	    <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
	    <append key="volume.mount.valid_options" type="strlist">locale=</append>
        </match>
    </device>
</deviceinfo>
Comment 21 Laurens Vanhove 2009-02-08 14:48:01 UTC
Created attachment 31122 [details]
patch to remove the uid and utf8 options from ntfs mounting
Comment 22 Laurens Vanhove 2009-02-08 14:57:01 UTC
This might be marked resolved but it doesn't work for me ...
The 20-ntfs-config-write-policy.fdi does not fix it here.

I'm using hal 0.5.11 on gentoo and hal bugs out on the "uid" and "utf8" options. The (admittedly not very nice) patch I posted tells solid not to give these options to hal. This combined with an "ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs" does the job.


Is seems that gnome works like this already : they dont pass any uid or utf8 options and put ntfs-3g in fstype (which removes th need for a mount.ntfs symlink).
Comment 23 Nick Shaforostoff 2009-02-20 22:45:09 UTC
so your patch assumes that when fstype=="ntfs", it actually is ntfs-3g?

i see there is alternatives mechanism implemented (ctrl+F for 'alternativePreferred'), so if I understand it right, then you (and distros) should set ntfs-3g as preferred somewhere in hal options.

P.S. I don't even have /sbin/mount.ntfs in my system.
Comment 24 Nick Shaforostoff 2009-02-20 22:56:23 UTC
@Shaumyadeep Chaudhuri: your last code snippet contains error: it lacks second </match>
Comment 25 Shaumyadeep Chaudhuri 2009-02-20 23:01:53 UTC
Sorry, actually a second </merge> is missing.
I guess we can remove that too.
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
	<device>
		<match key="volume.fstype" string="ntfs">
        	<merge key="volume.fstype" type="string">ntfs-3g</merge>
		</match>
	</device>
</deviceinfo>