Creating an udev rule mounting all usb drive as 666
Hi, i need all my /media/* newly created by insertion of usb drives, chmodded 666.
I tried some tips using various threads, but i failed. I'm on Slack 64 13.0. |
If you chmod a directory 666 then you will not be able to open it. So why do you want to do that ?
|
Oh !
So 777 ? I want all users to be able to write/read without any restriction. |
You could write a local udev rule to make it so. The best guide to writing udev rules that I know of is here. Let us know how you get on.
|
I've been looking and it seems to be difficult to do it using udev. But I'm using Fedora, so you might have more luck.
What I've found is it is better to use udev to give a specific device a constant name, then use that to create an fstab entry, where you can specify the permissions more easily. Of course you need to know the usb devices specifications and attributes first. In Fedora, udev hands off all usb interaction to hal which doesn't seem to have any permissions config accessible. Also, bear in mind that anything with a windows filesystem will be limited, because it doesn't understand permissions. |
I have difficulties to set a working rule, even using the guide...
And it's not for a specific drive. Every plugged key must have 777. I just need permission for the key root folder. |
Well in Fedora the usb drive is always mounted as owned by the user who mounted it. So they will have to change the permissions appropriately. I can't find out where the default permissions are set. Maybe it's easier to make a udev rule that runs a script, and the script then does the chmod.
something like Code:
KERNEL=="sd?1", DRIVERS=="usb", ACTION=="add", RUN+="/path/to/script" You might try using OPTIONS+="last_rule" too. But as I say, I can't make it work using udev. All the web resources I've found refer to an older version of Fedora where there was a 50-udev.rules which no longer exists. Also, according to the link that catkin gave, only on some devices can you affect ownership. It doesn't specify which devices ! |
Quote:
Code:
root@CW8:~# ls -l /dev/sd[ab][1-9] What is the output of /bin/ls -ld /media/* when you have some of these USB keys plugged in? |
It's rw r r
I need at least rw rw r And indeed, rules.d used to be highly populated, but now i have to set rules from scratch, which didn't worked well for now |
Shoulda have tried this before... chmod 0777 /dev/media/* doesn't work.
It's impossible to change anything. It belongs to the user and the group root. Do someone knows where this behavior is set ? |
Quote:
|
Ooops i meant /media, not /dev/media
No i can't change permission as root. Ex. /media/KINGSTON is drwxr-xr-x it belongs to me, and group root. I can't change this. |
Found rules are now in /lib/udev/rules.d
Added MODE="0777" @ usb line in 65-permissions.rules /dev/sd* are now rwxrwxrwx Still can't make /media/KINGSTON writable by all users. Maybe should i investigate HAL ? |
The problem may caused by how the file systems are mounted. They may be mounted read-only; that would explain why you are not able to change them despite their /dev/ files now being 777 (660 should be plenty). How are you mounting them?
|
It's mounted via udev/hal and Xfce volman.
|
All times are GMT -5. The time now is 12:31 AM. |