# HAL, udev, umask, USB mass storage & permissions

## kfiadeg

Hi there. I posted the same problem on the polish forum, but since it had not been resolved yet I do duplicate it here, in english.

The problem is about system assigning user/group of root/root (with umask=002) when I connect the USB mass storage device, such as thumbdrive. HAL mounts the device in /media/ directory. Unfortunatelly, common user doesn't have permission to write on the device.

Have a look:

```
$ ls -al /media

drwxr-xr-x  3 root root 4096 Nov 24 14:55 .

drwxr-xr-x 21 root root 4096 Oct 31 10:55 ..

-rw-r--r--  1 root root   76 Nov 24 14:55 .hal-mtab

-rw-------  1 root root    0 Nov 24 13:32 .hal-mtab-lock

-rw-r--r--  1 root root    0 Oct 19 17:28 .keep_sys-apps_hal-0

drwxrwxr-x 17 root root 4096 Jan  1  1970 SYSRESCUE

```

(where the SYSRESCUE is the example pendrive)

I am a member of these groups:

```
wheel, audio, cdrom, video, cdrw, usb, users, haldaemon, plugdev, vboxusers
```

I don't know why it happens. The prettiest solution would be to have system assign group of, for example, "plugdev" or "haldaemon" to devices like USB mass storage, so I could access them as a member of that group, without restrictions.

Can you help me? ("...occupy my brain", as O. Osbourne used to sing  :Razz:  )

----------

## rael1986

do 'ls -l /dev' and see what's the permission of the mounted media (/dev/sdx). i guess you missed disk group.

----------

## kfiadeg

Hi there again and thank you for your reply!  :Smile: 

So I did add myself to "disk" group, but it didn't help.

```
$ mount | grep SYSRESCUE

/dev/sdc1 on /media/SYSRESCUE type vfat (rw,nosuid,nodev,sync,uhelper=hal,umask=002)
```

```
$ ls -l /dev | grep sdc1

brw-rw---- 1 root  disk        8,  33 Nov 29 18:35 sdc1
```

```
$ ls -l /media

drwxrwxr-x 17 root root 4096 Jan  1  1970 SYSRESCUE
```

So, as you can see - /dev/sdc1 belongs to root|disk, however /media/SYSRESCUE (automounted by hal daemon) belongs to root|root and so adding myself to the "disk" group, although a good idea to try, could not help in this case  :Sad: 

As I remember it worked OK for some time, but I can't recall when it changed it's behaviour - I don't plug pendrives so often...

----------

## progman32

Bump. I have the same exact problem, and it's driving me crazy. Who sets permissions for mounted removable drives? Hal?

EDIT: Argh, I'm an idiot! I use XFCE, and it seems permissions are managed by /etc/xdg/xfce4/mount.rc, which I somehow missed when updating exo. Re-emerged exo, merged in the mount.rc with etc-update, and all is well!

----------

## kfiadeg

UP!  :Smile: 

I just don't get it.

I am happy (well, almost) GNOME user, and I just don't know what is going on inhere.

I have that utility called "Authorizations" under System/Preferences menu. As a root I have granted my regular user account almost all privileges: mount, unmount, reboot, poweroff... but NONE of the seem to apply anywhere.

Do I miss any packages for such a privileges control or what??

Here is a list of my current installed packages...

Please help. It is kinda annoying when I have to switch to root just to copy one file to my thumbdrive...

EDIT: OK, this is really stupid now. I have just removed myself from everywhere in the GNOME's System/Preferences/Authorizations and just changed org.freedesktop.hal.storage."Unmount file systems mounted by other users.", setting "Implicit Authorizations / Active Console" to "Yes", where previously was "Admin authentication (keep indefinitely)".

And that fixed the problem!

Any clues??

----------

