Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 08-05-2008, 05:01 PM   #1
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544
Using udev rules to modify floppy permissions

Recently I tried using kfloppy to format a floppy disk. I received a cryptic message, but some quick investigating revealed permissions problems. All of the /dev/fd0* devices are tagged with 640 permissions. Manually modifying those permissions to 660 solved the kfloppy issue.

I can install the same command in my rc.local, but I wondered how to solve the problem with udev. From what I understand, to avoid losing custom rules during any software updating, rather than modify the default set of rules I should create a 99-local.rules file and those rules should override any previous rules created in the default rule set. I created such a file with the following:

KERNEL=="fd[0-9]*", ACTION=="add", RUN+="device_permissions %k* 0660 floppy"

I both restarted the udev service and rebooted but nothing changed. I'm running Slackware 12.1 and KDE 3.5.9.

What is the correct way to change the permissions to 660 through udev?

Old 08-06-2008, 10:22 AM   #2
ne pas
Registered: Jul 2008
Posts: 55

Rep: Reputation: 23
Try using
KERNEL="fd[0-9]*", NAME="floppy/%n", SYMLINK="%k", GROUP="floppy", MODE="0660"
Old 08-06-2008, 04:35 PM   #3
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544
Thanks for responding, but the new rule failed to do what I needed.

After much head scratching, I discovered a few things.

One, the rc.udev script option for restart does not reload the rules before restarting udev. I tested this by copying the cdrom rules from 65-permissions.rules but changing the permissions to 666. Nothing happened when I ran rc.udev restart. Regardless of what I did to my 99-local.rules file, nothing happened.

Second, running rc.udev reload and then rc.udev restart does not reload the rules.

The only method I found successful was to run rc.udev stop and rc.udev start. Therefore I modified the rc.udev restart option to function the same as the start option after killing all udev processes. That worked. My modified script looks like this:

killall udevd
sleep 3
udevd --daemon
/sbin/udevtrigger $OPT && /sbin/udevsettle --timeout=120 &
Lastly, I stumbled over a set of 99-local.rules that succeeded. I copied the original default rules but modified the group and permissions.

# change floppy device ownership and permissions
# default permissions are 640, which prevents group users from having write access

# first fix primary devices (/dev/fd0, /dev/fd1, etc.)
# also change group ownership from disk to floppy
KERNEL=="fd[0-9]*", GROUP="floppy", MODE="0660"

# next recreate secondary devices (/dev/fd0u720, /dev/fd0u1440, etc.)
KERNEL=="fd[0-9]*", ACTION=="add", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k"

I hope this helps somebody.
Old 08-22-2008, 02:46 AM   #4
LQ Newbie
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Thumbs up Thanks

Yep, helped me. Thanks a lot!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Udev Rules - reg zoobave Linux - Kernel 1 06-20-2007 07:41 AM
udev rules Slackware 11 swampdog2002 Slackware 9 11-17-2006 07:06 PM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
UDEV Rules Location Toods Slackware 1 04-28-2006 02:23 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 10:07 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration