You are not logged in.

#1 2007-10-03 05:28:35

hybrid
Member
Registered: 2007-02-05
Posts: 261

Having HAL automount USB-storage devices writable for users

Is it possible to have the hal mount my external harddisk so that users can write on it too? Cuz right now hal puts root:root with 755-permissions on there. Something like root:storage 775 would be good imo.

Offline

#2 2007-10-03 09:32:12

decaturguy
Member
From: Sweden
Registered: 2006-11-28
Posts: 117

Re: Having HAL automount USB-storage devices writable for users

gpasswd -a USERNAME video
gpasswd -a USERNAME audio
gpasswd -a USERNAME optical
gpasswd -a USERNAME floppy
gpasswd -a USERNAME storage
gpasswd -a USERNAME scanner

Last edited by decaturguy (2007-10-03 09:37:21)

Offline

#3 2007-10-03 11:32:31

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: Having HAL automount USB-storage devices writable for users

I am in the group storage already. That's why I can mount it. But I don't have write access.
Anyhow for that matter, I am in the following groups: video, audio, optical, storage, games . I temporarily put my user into the groups hal and dbus as well, but then konqueror refused to automount  my drive at all, so I got my user outta there again.

Just out of curiosity I checked my udev.rules and it looks fine. But still, I'm missing something somewhere. It works fine with an USB-stick, it gets mounted under the user's name and group is groups, so I got write access there. But when I plug in my external hdd it gets mounted as root:root and so of course only root is able to write on it.
Weird, why does it handle the usb-stick and my ext. hdd differently? udev doesn't, it creates in both cases a
brw-rw---- 1 root storage 8, 17 2007-10-03 13:22 /dev/sdb1
device.

edit: whoops, my fault, I didn't explicitly mention all that in my first post (about being able to mount and stuff), so no offense decatorguy.

Last edited by hybrid (2007-10-03 11:37:27)

Offline

#4 2007-10-03 12:45:47

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Having HAL automount USB-storage devices writable for users

what filesystem has the hdd ?


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2007-10-03 13:04:11

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: Having HAL automount USB-storage devices writable for users

Filesystem is ext3.
It's a 250GB Maxtor IDE HDD in an IcyBox (IB-360UE) external case and connected to my computer via USB. Mainboard is a Gigabyte GA-965P-DS3.

Offline

#6 2007-10-03 13:18:33

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: Having HAL automount USB-storage devices writable for users

as far as I know this is an intended behavior (isn't it? [experts call]). you may create a directory inside your HD and change its permissions to your user:group (as root).

Offline

#7 2007-10-03 13:29:24

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: Having HAL automount USB-storage devices writable for users

I was gonna say: I don't think it's an intended call because for the USB-stick it's apparently working differently.
But then the USB-stick has FAT as it's filesystem on there, my hdd has ext3. So maybe you are right. I'm gonna give it a shot once I get back home later today.

Offline

#8 2007-10-03 14:03:04

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: Having HAL automount USB-storage devices writable for users

hybrid wrote:

But then the USB-stick has FAT as it's filesystem on there, my hdd has ext3.

oh yeah, ext3 is permissions aware (AFAIK).

Offline

#9 2007-10-03 15:32:07

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Having HAL automount USB-storage devices writable for users

This is a permissions problem. chown all dirs recursively, and set permissions if they are screwed up (recursively as well. there are scripts for this kind of thing.) 755 is standard for directories, and 644 for most "files".


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#10 2007-10-03 15:36:12

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Having HAL automount USB-storage devices writable for users

Since it's possible to mount the stick disk, hal should work fine, just as you thought. If I understand your problem, you would want all users to be able to write to the filesystem, you could use chmod to make the whole filesystem on the disk writeable for everyone (777).

Alternative (which is generally a good idea), is to create a special usergroup for the users you want to be able to modify the files, and use chmod to give that group write permission to the filesystem, and add the users you want to that group.

In any way, the following should suit you is you want to change filesystem:
chgrp -R <group> </path/to/mountpoint>

or, if you want to make everyone able to write to the filesystem:
chmod -R 777 </path/to/mountpoint>

(make sure to change <group> and </path/to/mountpoint> to appropriate)
(also, note that the commands also will change to permission on the directory on which the mount is made, but that will allow users to create files in the top level of the filesystem (and not just under a directory of the filesystem))

update: you were faster than me, Pelle wink

Last edited by 1311219 (2007-10-03 15:37:39)

Offline

#11 2007-10-03 18:29:52

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Having HAL automount USB-storage devices writable for users

Only by 5 seconds wink
Good advice about using the same group though. I forgot about that.
I do this with ubuntu and arch, sharing the same storage/data partitions. in ubuntu the default user are uid/1000:gid/1000, and since in arch i have uid/100:gid/1000 there are no problems with permissions (since i'm in the same group), unless permissions are altered to something else than directories/755, files/644.
[edit]of course im wrong about this. didn't think it through! i have the same uid in ubuntu/arch but not the same gid. Of course *that* works, but if you share gid, 775/664 permissions is what you need[/edit]

Alternative (which is generally a good idea), is to create a special usergroup for the users you want to be able to modify the files, and use chmod to give that group write permission to the filesystem, and add the users you want to that group.

Aah, yes, but when creating new files, you should set the "sticky bit" on the containing folder, because you will still mark the files with your umask (username:primary-groupname), unless "sticky bit" preserves the gid that the folder has (the secondary group created to share files). That is my limited understanding though.

The simplest (not the safest) solution is just to be a (primary) member of the same group, namely "users". That'll require virtually no modifications, but "just work" in most cases.
[edit]wrong again. as i said earlier, 775/664 permissions is what you need to share gid[/edit]

Last edited by pelle.k (2007-10-04 04:21:12)


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#12 2007-10-03 19:24:13

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: Having HAL automount USB-storage devices writable for users

You got the UID and GID for arch mixed up pelle.k, it's the other way around. smile

Yeah, you all are right, I can just create directories and chown them for my user or group and it works fine.
I just wasn't thinking about that when I started this thread, I was only thinking about passing a more suitable GID (or UID) to hal. but you guys are absolutellly right. For now I just created the directories I wanted as root and chowned them to my regular user.
Thank you all for your help! smile

Offline

Board footer

Powered by FluxBB