Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

kioslaves / pmount only mounts as root. [solved] by ntfs-3g

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
16 posts • Page 1 of 1
Author
Message
tipp98
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Sun Jan 28, 2007 1:06 pm

kioslaves / pmount only mounts as root. [solved] by ntfs-3g

  • Quote

Post by tipp98 » Fri Jul 18, 2008 6:05 am

So I'm trying to mount removable usb drives with user access ( write permission ) through KDE media and it's not working. I see dozens and dozens of threads regarding the same/similar issues and wonder, what is making this so difficult? Is it a kernel issue? Is it a portage problem? Is there some rogue file left over from something I previously did? ...

I once had ivman trying to get this to work, it's gone now. I did have the gparted lock file that I've seen mentioned and that has been deleted. This allowed me to mount filesystems by clicking on them in KDE media (but with root:root owner, except for vfat, that gives me kyle:root). I've removed/installed hal, hal-info, dbus, kioslaves, pmount several times in different orders hoping to get it going right, but it works less now than it did before ( now ext3 won't mount, giving me "TODO: have to rethink extra options" ). I am running from kdebase-startkde install and no kdm (although it is installed). KDE starts by mean of /etc/conf.d/local.start as described here. At first I thought well shoot, if kioslaves supposedly uses pmount, and pmount doesn't work right, then I need to get pmount working right. But now, I'm not sure pmount isn't working right. It says it allows normal users to mount filesystems, and it does this for me. So can someone confirm that pmount is doing what it was designed to do, and more importantly if I can/how can I get this setup working the way I want it?

Also, what's the deal with kioslaves, there are 4 different styles in portage, all with different sizes? Are they all the same or do some provide functionality that others do not?

Code: Select all

kyle@Falcon ~ $ groups
wheel floppy audio cdrom video cdrw usb users distcc portage kyle plugdev shutdown

Code: Select all

kyle@Falcon ~ $ emerge -pv hal dbus kdebase-kioslaves kdemultimedia-kioslaves pmount udev

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-fs/udev-119  USE="(-selinux)" 0 kB
[ebuild   R   ] sys-apps/dbus-1.1.20  USE="X -debug -doc (-selinux)" 0 kB
[ebuild   R   ] kde-base/kdemultimedia-kioslaves-3.5.9  USE="xinerama -arts -debug -encode -flac -kdeenablefinal -mp3 -vorbis" 0 kB
[ebuild   R   ] sys-apps/hal-0.5.11-r1  USE="X acpi crypt -apm -debug -dell -disk-partition -doc -laptop (-selinux)" 0 kB
[ebuild   R   ] kde-base/kdebase-kioslaves-3.5.9  USE="hal ldap samba xinerama -arts -debug -kdeenablefinal -kdehiddenvisibility -openexr" 0 kB
[ebuild   R   ] sys-apps/pmount-0.9.16  USE="crypt hal" 0 kB

Code: Select all

Falcon ~ # rc-update -s
               acpid |      default
           alsasound | boot
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
                dbus |      default
         distccd-x86 |      default
                hald |      default
            hostname | boot
             keymaps | boot
               local |      default nonetwork
          localmount | boot
             modules | boot
            net.eth0 |      default
              net.lo | boot
            netmount |      default
                 nfs |      default
           rmnologin | boot
           syslog-ng |      default
             urandom | boot
Last edited by tipp98 on Wed Jul 23, 2008 5:56 pm, edited 1 time in total.
Top
tgurr
Retired Dev
Retired Dev
Posts: 571
Joined: Tue Jan 27, 2004 11:48 pm
Location: germany

  • Quote

Post by tgurr » Fri Jul 18, 2008 11:20 am

You don't need pmount (anymore) for kde-base/kdebase-kioslaves to work, USE="hal" should be sufficient. However there are two problems left:

1. udev: USB devices are owned by root:disk so you'll also have to put your users also in the disk group which is not a very good idea since it enables users to do some fancy stuff with your harddrives as well. Another solution to this would be to write your own udev rule for usb devices to put them under control of the plugdev group.

2. hal: hal won't let you mount ntfs stuff anymore, see Bug 205901.
Top
tipp98
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Sun Jan 28, 2007 1:06 pm

  • Quote

Post by tipp98 » Fri Jul 18, 2008 7:35 pm

Hmmmm..... very interresting. First off, I grabbed an external ntfs drive, as I will be using these, to verify my stuff won't work, and it indeed does not work with the error that you gave me.

Also, why is it that vfat works, meaning I am the owner and root is the group (silly, as I am not part of root)? And if root:disk owns the drives, the why do the partitions (ext2,3) get mount root:root?

Now for the interresting part. This "TODO: have to rethink extra options" business... I was receiving this on ext3 partitions after trying to ignorantly hack /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi:

Code: Select all

      <!-- allow these mount options for ext3 -->
      <match key="volume.fstype" string="ext3">
        <append key="volume.mount.valid_options" type="strlist">acl</append>
        <append key="volume.mount.valid_options" type="strlist">user_xattr</append>
#         <append key="volume.mount.valid_options" type="strlist">uid=0</append>
#         <append key="volume.mount.valid_options" type="strlist">gid=100</append>
#         <append key="volume.mount.valid_options" type="strlist">umask=0777</append>
        <append key="volume.mount.valid_options" type="strlist">data=</append>
      </match>
I've removed these lines and my ext3 works, but now I can't help but wonder if there is something in this file we can alter to get ntfs working ??? And on another observation, I noticed that the bug was opened on 1/14/08 and it is now 7/18/08 and I have a different version than the one that the bug was originally posted to. So what about this comment by ZITTA "Perhaps it could be masked to let the author "rethink" :)" Anyway, how dangerous is it to go back to a working version?
Top
tipp98
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Sun Jan 28, 2007 1:06 pm

  • Quote

Post by tipp98 » Sat Jul 19, 2008 8:48 pm

Well, I don't have write access to ext2/3, as I haven't looked at the udev rules yet, but I managed to get ntfs accessible and writable. And that is good enough for me, for now.

Code: Select all

emerge -av1 "<hal-0.5.10"     - to fix ntfs , before developer started thinking :p
emerge -u ntfsprogs           - write support on by default
Oh, and I had to recompile my kernel with ntfs write support as I was using ntfs-3g.


Thanks for the help tgurr!
Top
tipp98
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Sun Jan 28, 2007 1:06 pm

  • Quote

Post by tipp98 » Wed Jul 23, 2008 4:50 am

So I lied. Instead of actually writing anything I was just looking at the permissions. If I try to write something I receive an "Access denied." error.

Apparently, udev rules have nothing to do with the way kioslaves mounts drives. I added the following rule for the firewire interface.

Code: Select all

SUBSYSTEMS=="ieee1394", GROUP="plugdev", MODE="770"
and I get the following as expected.

Code: Select all

brwxrwx--- 1 root plugdev   8,  96 2008-07-22 23:46 sdg
brwxrwx--- 1 root plugdev   8,  97 2008-07-22 23:46 sdg1
But, when it gets mounted...

Code: Select all

drwx------ 1 kyle root 12288 2008-07-21 20:17 BACKUPS
From /etc/mtab

Code: Select all

/dev/sdg1 /media/BACKUPS ntfs rw,nosuid,nodev,uid=1000,utf8 0 0
From /proc/config.gz

Code: Select all

CONFIG_NTFS_FS=y
CONFIG_NTFS_RW=y
From /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
      <append key="info.callouts.add" type="strlist">hal-storage-cleanup-all-mountpoints</append>
    </match>

    <match key="storage.media_check_enabled" bool="true">
      <append key="info.addons" type="strlist">hald-addon-storage</append>
    </match>

    

    <match key="volume.fsusage" string="filesystem">



      <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>

      <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Mount</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">ssas</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">mount_point fstype extra_options</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-mount</append>

      <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Unmount</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-unmount</append>

      <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>

      <!-- allow these mount options for all file systems -->
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
        <append key="volume.mount.valid_options" type="strlist">ro</append>
        <append key="volume.mount.valid_options" type="strlist">sync</append>
        <append key="volume.mount.valid_options" type="strlist">dirsync</append>
        <append key="volume.mount.valid_options" type="strlist">noatime</append>
        <append key="volume.mount.valid_options" type="strlist">nodiratime</append>
        <append key="volume.mount.valid_options" type="strlist">noexec</append>
        <append key="volume.mount.valid_options" type="strlist">quiet</append>
        <append key="volume.mount.valid_options" type="strlist">remount</append>
        <append key="volume.mount.valid_options" type="strlist">exec</append>
      </match>


      <!-- allow these mount options for ntfs -->
      <match key="volume.fstype" string="ntfs">
        <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
          <append key="volume.mount.valid_options" type="strlist">rw</append>
          <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">locale=</append>
          <append key="volume.mount.valid_options" type="strlist">utf8</append>
        </match>
      </match>


    </match>


  </device>
</deviceinfo>
Does anybody out there have any more ideas? I just recently switched over to utf8 if that might cause a problem, but I don't know how to go about testing that theory out. Not that I want to.... :?
Top
tipp98
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Sun Jan 28, 2007 1:06 pm

  • Quote

Post by tipp98 » Wed Jul 23, 2008 5:54 pm

Bingo!
From [topic=696568]this top[/topic]

Code: Select all

ln -s /bin/ntfs-3g /sbin/mount.ntfs



The irony here is that this post is the one that lead me down the ntfsprogs path... :evil: I wasn't able to get that working.
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Tue Aug 26, 2008 3:35 am

The best thing to do is this :

Code: Select all

# echo 'sys-fs/ntfsprogs fuse' ­­>> /etc/portage/package.use 
# emerge -v ntfsprogs 
 
And then mount your partition by hand with the root account.

Code: Select all

# ntfsmount /dev/sdb1 /media -o ro 
 
After that, the user can acces the /media without any problem.
Top
mamac
l33t
l33t
User avatar
Posts: 890
Joined: Sun Feb 29, 2004 9:23 pm

  • Quote

Post by mamac » Wed Sep 10, 2008 12:10 pm

Hi,

I worked with ntfs-3g and decided to give a try to ntfsmount but it gives me errors, ntfs-3g does it well (but manually) for me.

Still no way for ntfs partitions to be mounted automatically under KDE? What about the bug?
Powered by Gentoo Linux since 2003
Top
mamac
l33t
l33t
User avatar
Posts: 890
Joined: Sun Feb 29, 2004 9:23 pm

  • Quote

Post by mamac » Tue Sep 23, 2008 8:37 am

Hi,

Someone found a fix for the bug, you can now mount your ntfs external usb drive with r/w access.

Just need to modify hal ebuild and emerge the instable ntfs-3g with hal flag.

Enjoy!
Powered by Gentoo Linux since 2003
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Wed Sep 24, 2008 12:24 am

Can you post the exact solution plz ?
Top
mamac
l33t
l33t
User avatar
Posts: 890
Joined: Sun Feb 29, 2004 9:23 pm

  • Quote

Post by mamac » Wed Sep 24, 2008 7:27 am

I'd say:

1. fetch only hal package

Code: Select all

# emerge -f hal
2. unpack sources

Code: Select all

# ebuild /usr/portage/sys-apps/hal-[your_version_of_hal].ebuild unpack
3. Now you will find a file in the work directory in /var/tmp/portage/sys-apps/hal_etc... a directory called 'tools' and in this directory a file called 'hal-storage-mount.c'. Edit the file and find the following lines, add the lines marked with a ++ (of course don't add the '++'!):

Code: Select all

		if (strcmp (libhal_volume_get_fstype (volume), "vfat") != 0 &&
+		    strcmp (libhal_volume_get_fstype (volume), "ntfs") != 0 &&
+		    strcmp (libhal_volume_get_fstype (volume), "ntfs-3g") != 0 &&
 		    strcmp (libhal_volume_get_fstype (volume), "iso9660") != 0 &&
 		    strcmp (libhal_volume_get_fstype (volume), "hfs") != 0 &&
 		    strcmp (libhal_volume_get_fstype (volume), "udf") != 0) {
4. hal source is now changed, we need to merge it:

Code: Select all

# ebuild /usr/portage/sys-apps/hal-[your_version_of_hal].ebuild merge
5. hal is now merged with the fix, restart it

Code: Select all

# /etc/init.d/hald restart
6. if you want read access, make sure ntfs support is enabled in you kernel and that should be enough. If you want write access, you need to use unstable ntfs-3g emerged with hal flag. Add ntfs-3g to your keyword file to get the latest version and make sure it's build with hal flag.

You should now be able to plug your usb ntfs drive and use it normally.
Powered by Gentoo Linux since 2003
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Thu Sep 25, 2008 1:19 am

I guess that this little problem will be solve in a near futur officially ?
Top
mamac
l33t
l33t
User avatar
Posts: 890
Joined: Sun Feb 29, 2004 9:23 pm

  • Quote

Post by mamac » Thu Sep 25, 2008 6:27 am

I think it will be officially fixed when the fix for hal will be published in its stable version, and when ntfs3g-1.2531-r1 will be declared as stable as it's the first version to have 'hal' USE flag.

I have no idea how long it could take.
Powered by Gentoo Linux since 2003
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Thu Sep 25, 2008 3:36 pm

No problem, for now I use NTFS-PROG and I mount my partition with root, and after that it automagically works with my user.

When I do that, I see a new icone on my KDE desktop and everything works like the old time.
Top
renrutal
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 135
Joined: Sat Mar 26, 2005 3:28 am
Location: Brazil

  • Quote

Post by renrutal » Sat Oct 11, 2008 12:06 am

mamac wrote:You should now be able to plug your usb ntfs drive and use it normally.
Ahhhh it works! Thank you!
Top
Sevein
n00b
n00b
User avatar
Posts: 32
Joined: Sat Apr 26, 2003 6:41 am
Location: Sevilla (España)
Contact:
Contact Sevein
Website

  • Quote

Post by Sevein » Sun Feb 01, 2009 2:29 am

mamac wrote:I'd say:
[...]
You should now be able to plug your usb ntfs drive and use it normally.
mamac, your solution worked for me! unstable ntfs-3g, hal patched, kde, or whatever, finally mounts!
THANKS!!
Top
Post Reply

16 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic