# Need help with pmount permissions....

## TerranAce007

I have hald/dbus/pmount working, but all my cd-rom and usb devices are only being mounted as root, which is getting really annoying. When I put a cd in, gnome-volume-manager finds it, puts an icon on the desktop, and launches nautilus, but I get an access denied error:

dmesg:

 *Quote:*   

> cdrom: hdc: mrw address space DMA selected
> 
> UDF-fs INFO UDF 0.9.8.1 (2004/29/09) Mounting volume 'Stage4 Backups 20060227', 
> 
> 

 

mount:

 *Quote:*   

> andrew@mobile ~ $ mount
> 
> /dev/hda4 on / type reiserfs (rw,noatime)
> 
> proc on /proc type proc (rw)
> ...

 

Notice that uid=1000 refers to me (andrew) and gid=100 refers to users, which I am also in...

bash:

 *Quote:*   

> andrew@mobile ~ $ cd /media/hdc
> 
> bash: cd: /media/hdc: Permission denied
> 
> andrew@mobile ~ $ su -
> ...

 

A simple chmod to change the permissions on the folder fails for the cdrom because it gets mounted readonly.

I realize that I can create fstab entries for my devices and manually create folder in /mnt or /media, but I want to be able to just plug in stuff and have it work without me having to edit the fstab every time I connect a new device. How do I edit the mount permissions that are used to automount stuff?

Also, with hal/bus/etc.., are coldplug & hotplug necessary anymore? I have them starting at boot, but I turned off hotplug and it didn't seem to affect the automount of anything, but it didn't fix the permissions problem either...

----------

## river

Hi,

I have exactly the same problem. Did you manage to find a solution?

--

R

----------

## TerranAce007

Switched to Kubuntu...

----------

## river

That's one way of solving the problem   :Very Happy: 

--

R

----------

## lartza

Same problem here, i've got

sys-apps/dbus-0.61-r1

sys-apps/pmount-0.9.9

sys-apps/hal-0.5.7-r1

sys-apps/ivman-0.6.12

I can't figure out what's wrong (nothing according to gentoo-wiki)

EDIT: I suppose this is the same problem we're experiencing: https://bugs.gentoo.org/show_bug.cgi?id=137073

----------

## TerranAce007

 *river wrote:*   

> That's one way of solving the problem  

 

Don't get me wrong, but I really like Gentoo. I had been using it on my laptop for about 2 years and learned a lot about linux through gentoo. I got tired of things breaking all the time though, and having to spend hours messing around trying to get things to work. The documentation is great (a lot better than ubuntu...), but all the fiddling made using linux on my laptop more of a project in itself. I really like ubuntu as well, because it just plain works (most of the time...). I will probably try gentoo first when I get a new dual core laptop for my computer science major, but ubuntu provides a convienent and simple alternitive in the case that I end up spending more time fixing than learning...

----------

## Aikidoka69

Pmount 9.13 fixes the UDF issue, but ntfs is continuing to be automounted root:root and hfsplus is root:cdrw.  Still can't use my external USB drives because of this.

----------

## pipert

I don't know alot about PMount and exactly how differently it is to operate from plain old mount...

BUT...

I know with (plain old) mount, NTFS filesystems are mounted by/for root by default (see the man page for mount)

```

FILESYSTEM SPECIFIC MOUNT OPTIONS

       The  following options apply only to certain file systems.  We sort them by file system. They

       all follow the -o flag.

...

...

...

Mount options for ntfs

...

...

       uid=value, gid=value and umask=value

              Set the file permission on the filesystem.  The umask value is  given  in  octal.   By

              default, the files are owned by root and not readable by somebody else.

```

So, if you use mount -o uid=USERID, it'll mount a given filesystem as the user specified by USERID

```

you@yourcomputer $  sudo mount -o uid=1000 /mnt/my_special_volume

```

There are some prerequisites however

(1) You need sudo; and you'd probably want to allow yourself to use sudo without typing a password (see man sudo)

(2) You would need to enable PMount to mount in that manner (if that's not what it does already)

Of course, you could just not use PMount and use plain old mount...

-P

----------

## Aikidoka69

 *pipert wrote:*   

> 
> 
> Of course, you could just not use PMount and use plain old mount...
> 
> -P

 

I have restorted to that.  From what I have found, pmount's options are hardcoded into the source.

----------

## z_sfeng

I can pass some of mount options from hal to pmount, by creating a hal policy in:

"/etc/hal/fdi/policy/95-usrpolicy.fdi"

```

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2"> 

    <device>

   <!-- mount options for NTFS -->

   <match key="volume.fstype" string="ntfs"> 

       <append key="volume.mount.valid_options" type="strlist">utf8</append>

       <append key="volume.mount.valid_options" type="strlist">uid=</append>

       <append key="volume.mount.valid_options" type="strlist">gid=100</append>

       <append key="volume.mount.valid_options" type="strlist">umask=002</append>

   </match> 

    </device> 

</deviceinfo>

```

It seems "utf8" and "uid=" is passed correctly, while the "gid" and "umask" has no effect.

AND, it only works in KDE, not in gnome  :Smile:  pmount option in gnome-volume-manager is hard-coded.

----------

