FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I use the loopback device to play dvd movie iso's, and for non-root users to be able to do so, I need to make all the loop device files world readable. I do this with chmod a+r /dev/loop* and it works fine. After a reboot, however, I find that I have the same problem again. Something has gone behind me and changed the /dev/loop permissions back to 640 from 644. I even stuck a "chmod a+r /dev/loop*" into my rc.local, but something still goes and changes the permissions back to 640, and by examining the timestamps from "ls -ltc /dev/loop*" it seems that whatever is doing this can be acting 30 min or so after boot.
I've disabled SELinux, so I don't think that is the problem.
not sure where your specific udev rules live. probably in /etc/udev
in there cd to rules.d and edit the rules file. You'll find a section for loop back devices and you will be able to change the default permissions.,,.......
Thanx for the suggestions. I am new to Fedora and udev, I would not have known to look there.
But I am having limited luck trying to modify the permissions for my loopback devices.
I've tried adding the line
KERNEL=="loop7", MODE="0644"
to both /etc/udev/rules.d/50-udev.rules (yes, I know I'm supposed to stick it in another file...)
and into 10-local.rules (my own file) with no effect
part of the problem may be that
...# udevinfo -q path -n /dev/loop7
spat out "no such device until I actually used losetup to setup an iso, afterwich it found all the loopback devices (setup or not)
..# udevinfo -q path -n /dev/loop7
/block/loop7
My main trouble is that the ONLY thing that has any effect is changing the line
SUBSYSTEM=="block", GROUP="disk", MODE="0640"
to
SUBSYSTEM=="block", GROUP="disk", MODE="0644"
in /etc/udev/rules.d/50-udev.rules
but this changes ALL my block devs to 0644 (not an issue with me, but I don't know the full ramifications of that, at the very least it could make the swap partition world readable, which is security hole)
I've tried the following lines, both in 50-udev.rules and in 10-local.rules, then either run "udevstart" or just rebooted, but again, nothing seems to have ANY effect except modifying the line above.
SUBSYSTEM=="block", SYSFS{dev}=="7:7", GROUP="disk", MODE="0644"
KERNEL=="loop7", GROUP="disk", MODE="0644"
So, any suggestions would be greatly appreciated.
oh, yeah, once udevinfo found my loopbacks, this is sample output
# udevinfo -a -p /block/loop7
udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.
device '/sys/block/loop7' has major:minor 7:7
looking at class device '/sys/block/loop7':
SUBSYSTEM=="block"
SYSFS{dev}=="7:7"
SYSFS{range}=="1"
SYSFS{removable}=="0"
SYSFS{size}=="0"
SYSFS{stat}==" 0 0 0 0 0 0 0 0 0 0 0"
I'm not sure that udev has much to do with it...
I'm running FC5 now, and looking thru /etc/udev/rules.d/50-default.rules
Code:
# skip rules for inappropriate block devices
KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end"
and if I try looking for a loop device...
Code:
[root@k7som-5c rules.d]# udevinfo -q path -n /dev/loop7
no record for 'loop7' in database
[root@k7som-5c rules.d]# udevtest loop7
main: unable to open 'loop7'
But since I first struggled with this, I have discovered /etc/security/console.perms and
/etc/security/console.perm.d/50-default.perms
The latter contains rules which give ownership of various devices, especially removable media, to any user logged into the console(tty or X session)
I added this rule (to 50-default.perms) to give ownership of /dev/loop7 to the console user, and set the default (no user at console) to mode 0644:
Code:
<console> 0640 <loop> 0644 root.disk
and voila! /dev/loop7 was mode 0664 (no user at console, I'm logged in via VNC, doesn't count ;-)
Now all I need to do is figure out how to tell pam to scr8w the console user and just set the device to mode 0644 all the time...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.