Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running Fedora 17 and I want to give several users access to files on my secondary hard drives on /run/media/haukur/. This is what I initially did:

chmod -R 755 /run/media/

But every time I turn the computer off these permissions are reset to:

ls -l /run/media/
drwxr-x---+ 4 root root 80 Jul  5 17:42 haukur

The same applies to /run/media/haukur/. I made a symbolic link in every user's home directory pointing to /run/media/haukur/ but they stop working (permission errors) all the time.

What can I do to make these changes permanent?

Edit: I solved the problem by adding the devices to /etc/fstab:

/dev/sdc1   /media/a                               ext4    defaults        0 0
/dev/sdb1   /media/b                               ext4    defaults        0 0
share|improve this question
    
You could try a @reboot chmod -R 755 /run/media in root's crontab. –  donothingsuccessfully Jul 5 '12 at 18:51
    
Thanks. Will this only be executed once, on the next reboot? –  Haukur Jul 5 '12 at 19:03
    
Fedora has a specific file for executing post boot, check my answer below. –  Tim Jul 5 '12 at 19:04
    
The /run directory is the mount point of an in-memory filesystem (tmpfs). Whatever is in there is recreated at each boot. Given the names, the directories look like mount points. What is the output of the command cat /proc/mounts? And plain mount? How are these filesystems mounted? –  Gilles Jul 6 '12 at 1:23
add comment

1 Answer 1

up vote 3 down vote accepted

For a Fedora system, the file /etc/rc.local contains commands to run after the system has booted and started all services in the runlevel. If you are looking to fix the permissions when the system boots up, drop chmod -R 755 /run/media in the /etc/rc.local file.

/etc/rc.local is treated like a shell script.

share|improve this answer
    
Thanks, but this did not solve the problem. When Fedora boots, /run/media doesn't exist. It is created when I mount my two other partitions (another annoyance, I'd like this to be done automatically, without authentication). And when it is created it is created with the permissions above. –  Haukur Jul 5 '12 at 19:21
1  
Is there a reason why you cannot add the mountpoints to /etc/fstab? Mountpoints listed in fstab are mounted during the boot process. –  Tim Jul 5 '12 at 19:33
    
No, not really, and that's what I ended up doing. I just didn't know how it was done. Thanks for pointing me in the right direction! –  Haukur Jul 6 '12 at 12:05
    
No problem. Glad to help! –  Tim Jul 6 '12 at 12:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.